tableau_api 1.1.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -0
- data/.rubocop_todo.yml +12 -0
- data/.travis.yml +2 -3
- data/CHANGELOG.md +5 -1
- data/Rakefile +1 -1
- data/lib/tableau_api/client.rb +2 -1
- data/lib/tableau_api/connection.rb +7 -2
- data/lib/tableau_api/resources/datasources.rb +10 -0
- data/lib/tableau_api/resources/users.rb +2 -2
- data/lib/tableau_api/resources/workbooks.rb +15 -4
- data/lib/tableau_api/version.rb +1 -1
- data/lib/tableau_api.rb +1 -0
- data/tableau_api.gemspec +4 -2
- metadata +22 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4798e618f0d34f889de213df1639f637bd10725
|
4
|
+
data.tar.gz: 101be1cca96ab9cb21fd6061f557ea2d718ac8a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ebb0f01b35a52a1270cd50dc21dc883d801acfe82dfaa4d0284ab3c47cef1fc61a0c024d02abc9720ac3114852355e105ba711d7b8ff4a926950b5dda7f0bd6
|
7
|
+
data.tar.gz: 75afe1a966db2064aa0a89c2f0e321e43a701288bba57a1dd8f22f031db2be5e2a699e2a74ad988196517923bbf63f91d71737ff88b61282c7cc2dda54b1f6fa
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2019-08-21 17:54:45 +0000 using RuboCop version 0.49.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 13
|
10
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
11
|
+
Metrics/BlockLength:
|
12
|
+
Max: 316
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,11 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
-
## [
|
6
|
+
## [2.0.0] - 2019-08-29
|
7
|
+
|
8
|
+
- Updated to API version 2.8, compatible with Tableau Server >= 10.5
|
9
|
+
- Add `refresh` and `image_preview` methods for workbooks
|
10
|
+
- Bumped the Ruby versions in the Travis matrix build to 2.3.4, 2.2.7, and
|
7
11
|
|
8
12
|
## [1.1.2] - 2017-05-24
|
9
13
|
|
data/Rakefile
CHANGED
data/lib/tableau_api/client.rb
CHANGED
@@ -28,7 +28,8 @@ module TableauApi
|
|
28
28
|
sites: TableauApi::Resources::Sites,
|
29
29
|
users: TableauApi::Resources::Users,
|
30
30
|
groups: TableauApi::Resources::Groups,
|
31
|
-
workbooks: TableauApi::Resources::Workbooks
|
31
|
+
workbooks: TableauApi::Resources::Workbooks,
|
32
|
+
datasources: TableauApi::Resources::Datasources
|
32
33
|
}
|
33
34
|
end
|
34
35
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module TableauApi
|
2
2
|
class Connection
|
3
|
-
API_VERSION = '2.
|
3
|
+
API_VERSION = '2.8'.freeze
|
4
4
|
|
5
5
|
include HTTParty
|
6
6
|
|
@@ -45,10 +45,14 @@ module TableauApi
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def api_post(path, *args)
|
48
|
+
args[0][:headers] = {} unless args[0][:headers]
|
49
|
+
args[0][:headers]['Content-Type'] = 'application/xml'
|
48
50
|
api_method(:post, path, *args)
|
49
51
|
end
|
50
52
|
|
51
53
|
def api_put(path, *args)
|
54
|
+
args[0][:headers] = {} unless args[0][:headers]
|
55
|
+
args[0][:headers]['Content-Type'] = 'application/xml'
|
52
56
|
api_method(:put, path, *args)
|
53
57
|
end
|
54
58
|
|
@@ -75,7 +79,8 @@ module TableauApi
|
|
75
79
|
# do not attach auth headers or attempt to signin if we're signing in
|
76
80
|
unless path == 'auth/signin'
|
77
81
|
args[0] = {} unless args[0]
|
78
|
-
args[0][:headers] =
|
82
|
+
args[0][:headers] = {} unless args[0][:headers]
|
83
|
+
args[0][:headers].merge!(auth_headers)
|
79
84
|
end
|
80
85
|
self.class.send(method, url_for(path), *args)
|
81
86
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module TableauApi
|
2
2
|
module Resources
|
3
3
|
class Users < Base
|
4
|
-
SITE_ROLES = %w
|
4
|
+
SITE_ROLES = %w[
|
5
5
|
Interactor
|
6
6
|
Publisher
|
7
7
|
SiteAdministrator
|
@@ -9,7 +9,7 @@ module TableauApi
|
|
9
9
|
UnlicensedWithPublish
|
10
10
|
Viewer
|
11
11
|
ViewerWithPublish
|
12
|
-
|
12
|
+
].freeze
|
13
13
|
|
14
14
|
def create(username:, site_role: 'Viewer')
|
15
15
|
raise 'invalid site_role' unless SITE_ROLES.include? site_role
|
@@ -48,12 +48,12 @@ module TableauApi
|
|
48
48
|
end
|
49
49
|
# rubocop:enable Metrics/ParameterLists
|
50
50
|
|
51
|
-
CAPABILITIES = %w
|
51
|
+
CAPABILITIES = %w[
|
52
52
|
AddComment ChangeHierarchy ChangePermissions Delete ExportData ExportImage ExportXml
|
53
53
|
Filter Read ShareView ViewComments ViewUnderlyingData WebAuthoring Write
|
54
|
-
|
54
|
+
].freeze
|
55
55
|
|
56
|
-
CAPABILITY_MODES = %w
|
56
|
+
CAPABILITY_MODES = %w[ALLOW DENY].freeze
|
57
57
|
|
58
58
|
def permissions(workbook_id:)
|
59
59
|
res = @client.connection.api_get("sites/#{@client.auth.site_id}/workbooks/#{workbook_id}/permissions")
|
@@ -98,7 +98,7 @@ module TableauApi
|
|
98
98
|
raise 'invalid mode' unless CAPABILITY_MODES.include? capability_mode.to_s
|
99
99
|
|
100
100
|
subpath = user_id ? "users/#{user_id}" : "groups/#{group_id}"
|
101
|
-
subpath += "/#{capability}/#{capability_mode}"
|
101
|
+
subpath += "/#{capability}/#{capability_mode.capitalize}"
|
102
102
|
res = @client.connection.api_delete("sites/#{@client.auth.site_id}/workbooks/#{workbook_id}/permissions/#{subpath}")
|
103
103
|
|
104
104
|
res.code == 204
|
@@ -116,6 +116,17 @@ module TableauApi
|
|
116
116
|
res.code == 200
|
117
117
|
end
|
118
118
|
|
119
|
+
def refresh(workbook_id:)
|
120
|
+
request = Builder::XmlMarkup.new.tsRequest
|
121
|
+
res = @client.connection.api_post("sites/#{@client.auth.site_id}/workbooks/#{workbook_id}/refresh", body: request)
|
122
|
+
res.code == 202
|
123
|
+
end
|
124
|
+
|
125
|
+
def preview_image(workbook_id:)
|
126
|
+
res = @client.connection.api_get("sites/#{@client.auth.site_id}/workbooks/#{workbook_id}/previewImage")
|
127
|
+
res.body if res.code == 200
|
128
|
+
end
|
129
|
+
|
119
130
|
def find(workbook_id)
|
120
131
|
res = @client.connection.api_get("sites/#{@client.auth.site_id}/workbooks/#{workbook_id}")
|
121
132
|
res['tsResponse']['workbook'] if res.code == 200
|
data/lib/tableau_api/version.rb
CHANGED
data/lib/tableau_api.rb
CHANGED
@@ -12,6 +12,7 @@ require 'tableau_api/resources/sites'
|
|
12
12
|
require 'tableau_api/resources/users'
|
13
13
|
require 'tableau_api/resources/groups'
|
14
14
|
require 'tableau_api/resources/workbooks'
|
15
|
+
require 'tableau_api/resources/datasources'
|
15
16
|
require 'tableau_api/version'
|
16
17
|
|
17
18
|
module TableauApi
|
data/tableau_api.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'tableau_api/version'
|
@@ -10,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
10
11
|
'Jonathan Cobian']
|
11
12
|
spec.email = ['opensource@civisanalytics.com']
|
12
13
|
|
13
|
-
spec.summary = 'Ruby interface to the Tableau
|
14
|
+
spec.summary = 'Ruby interface to the Tableau API.'
|
14
15
|
spec.homepage = 'https://github.com/civisanalytics/tableau_api'
|
15
16
|
spec.license = 'BSD-3-Clause'
|
16
17
|
|
@@ -32,5 +33,6 @@ Gem::Specification.new do |spec|
|
|
32
33
|
spec.add_development_dependency 'webmock', '~> 3.0'
|
33
34
|
spec.add_development_dependency 'pry', '~> 0.10'
|
34
35
|
spec.add_development_dependency 'pry-byebug', '~> 3.4'
|
35
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
36
|
+
spec.add_development_dependency 'rubocop', '~> 0.49.0'
|
37
|
+
spec.add_development_dependency 'chunky_png', '~> 1.3.11'
|
36
38
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tableau_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Manning
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2019-08-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -172,14 +172,28 @@ dependencies:
|
|
172
172
|
requirements:
|
173
173
|
- - "~>"
|
174
174
|
- !ruby/object:Gem::Version
|
175
|
-
version: 0.
|
175
|
+
version: 0.49.0
|
176
176
|
type: :development
|
177
177
|
prerelease: false
|
178
178
|
version_requirements: !ruby/object:Gem::Requirement
|
179
179
|
requirements:
|
180
180
|
- - "~>"
|
181
181
|
- !ruby/object:Gem::Version
|
182
|
-
version: 0.
|
182
|
+
version: 0.49.0
|
183
|
+
- !ruby/object:Gem::Dependency
|
184
|
+
name: chunky_png
|
185
|
+
requirement: !ruby/object:Gem::Requirement
|
186
|
+
requirements:
|
187
|
+
- - "~>"
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: 1.3.11
|
190
|
+
type: :development
|
191
|
+
prerelease: false
|
192
|
+
version_requirements: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - "~>"
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: 1.3.11
|
183
197
|
description:
|
184
198
|
email:
|
185
199
|
- opensource@civisanalytics.com
|
@@ -190,6 +204,7 @@ files:
|
|
190
204
|
- ".gitignore"
|
191
205
|
- ".rspec"
|
192
206
|
- ".rubocop.yml"
|
207
|
+
- ".rubocop_todo.yml"
|
193
208
|
- ".ruby-version"
|
194
209
|
- ".travis.yml"
|
195
210
|
- CHANGELOG.md
|
@@ -206,6 +221,7 @@ files:
|
|
206
221
|
- lib/tableau_api/error.rb
|
207
222
|
- lib/tableau_api/resources/auth.rb
|
208
223
|
- lib/tableau_api/resources/base.rb
|
224
|
+
- lib/tableau_api/resources/datasources.rb
|
209
225
|
- lib/tableau_api/resources/groups.rb
|
210
226
|
- lib/tableau_api/resources/projects.rb
|
211
227
|
- lib/tableau_api/resources/sites.rb
|
@@ -233,8 +249,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
233
249
|
version: '0'
|
234
250
|
requirements: []
|
235
251
|
rubyforge_project:
|
236
|
-
rubygems_version: 2.
|
252
|
+
rubygems_version: 2.5.2.3
|
237
253
|
signing_key:
|
238
254
|
specification_version: 4
|
239
|
-
summary: Ruby interface to the Tableau
|
255
|
+
summary: Ruby interface to the Tableau API.
|
240
256
|
test_files: []
|