tableau_api 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4798e618f0d34f889de213df1639f637bd10725
4
- data.tar.gz: 101be1cca96ab9cb21fd6061f557ea2d718ac8a7
3
+ metadata.gz: 32337332fcbfbd3e1df178024ad0eb90c64ba347
4
+ data.tar.gz: 1acad5975fe2d1e33637e0d7092415697d0db997
5
5
  SHA512:
6
- metadata.gz: 2ebb0f01b35a52a1270cd50dc21dc883d801acfe82dfaa4d0284ab3c47cef1fc61a0c024d02abc9720ac3114852355e105ba711d7b8ff4a926950b5dda7f0bd6
7
- data.tar.gz: 75afe1a966db2064aa0a89c2f0e321e43a701288bba57a1dd8f22f031db2be5e2a699e2a74ad988196517923bbf63f91d71737ff88b61282c7cc2dda54b1f6fa
6
+ metadata.gz: a2685533571a39906bc593726395b3555123b7ceee2e2921ed3d614938873d9b03777e7b20f215180999e2e2af25064004b575ed5793bb2dd53710bf31a5062c
7
+ data.tar.gz: 91f5141706ffff117ec5fd6c4643b00066d17a19e69c2f895256b6c4f33fd7dc6e2f4c8e7c22d672f185ec60af27ed0ccd720767060f3d1c6020cf7fc4e3b50f
@@ -1 +1 @@
1
- 2.4.1
1
+ 2.4.9
@@ -3,6 +3,21 @@
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
+ ## [3.0.0] -
7
+
8
+ ### Added
9
+
10
+ - Added Jobs resource
11
+
12
+
13
+ ### Changed
14
+
15
+ - Updated to API version 3.1
16
+ - This is a breaking change for site roles:
17
+ https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_new_site_roles.htm
18
+ - Include full error detail in TableauError message
19
+
20
+
6
21
  ## [2.0.0] - 2019-08-29
7
22
 
8
23
  - Updated to API version 2.8, compatible with Tableau Server >= 10.5
data/README.md CHANGED
@@ -62,16 +62,31 @@ docker exec -it CONTAINER_ID /bin/bash -c "cd /src && bundle && rake"
62
62
 
63
63
  Cassettes should be self-contained, generated by a single spec file
64
64
  run in defined order. To make changes to specs, it's best to delete a whole cassette
65
- and rerun the whole spec file.
65
+ and rerun the whole spec file, except for auth.yml, since it could be difficult to
66
+ generate a trusted ticket from a non-trusted host.
66
67
 
67
- Set the environment variables below to an administrator account, create a tunnel
68
- to your tableau server on port 2000, then run the commands below.
68
+ To regenerate all the the cassettes, you'll first need to create the following on the Tableau server:
69
+ * *Site*: Default
70
+ * *Site*: TestSite
71
+ * *Datasource*: test
72
+ * *Username*: test_test
73
+
74
+ And delete the following if they exist:
75
+ * *Group*: testgroup (probably under TestSite)
76
+ * *Project*: test_project (probably under Default)
77
+ * *Site*: Test Site 2
78
+ * *User*: test (probably under TestSite)
79
+ * *Workbook*: test
80
+ * *Workbook*: testpublish
81
+
82
+ Set the environment variables below to an administrator account and your Tableau Server hostname.
83
+
84
+ Then run the commands below:
69
85
 
70
86
  ```
71
87
  docker run -it -d \
72
88
  -v $(pwd):/src \
73
- --add-host=docker:$(ifconfig en0 | grep 'inet\b' | cut -d ' ' -f 2) \
74
- -e TABLEAU_HOST='http://docker:2000' -e TABLEAU_ADMIN_USERNAME -e TABLEAU_ADMIN_PASSWORD \
89
+ -e TABLEAU_HOST -e TABLEAU_ADMIN_USERNAME -e TABLEAU_ADMIN_PASSWORD \
75
90
  ruby /bin/bash
76
91
  docker exec -it CONTAINER_ID /bin/bash -c "cd /src && bundle && rake"
77
92
  ```
@@ -13,6 +13,7 @@ require 'tableau_api/resources/users'
13
13
  require 'tableau_api/resources/groups'
14
14
  require 'tableau_api/resources/workbooks'
15
15
  require 'tableau_api/resources/datasources'
16
+ require 'tableau_api/resources/jobs'
16
17
  require 'tableau_api/version'
17
18
 
18
19
  module TableauApi
@@ -29,7 +29,8 @@ module TableauApi
29
29
  users: TableauApi::Resources::Users,
30
30
  groups: TableauApi::Resources::Groups,
31
31
  workbooks: TableauApi::Resources::Workbooks,
32
- datasources: TableauApi::Resources::Datasources
32
+ datasources: TableauApi::Resources::Datasources,
33
+ jobs: TableauApi::Resources::Jobs
33
34
  }
34
35
  end
35
36
 
@@ -1,6 +1,6 @@
1
1
  module TableauApi
2
2
  class Connection
3
- API_VERSION = '2.8'.freeze
3
+ API_VERSION = '3.1'.freeze
4
4
 
5
5
  include HTTParty
6
6
 
@@ -22,7 +22,7 @@ module TableauApi
22
22
  page_number = (args[0].delete(:page_number) { 1 }).to_i
23
23
 
24
24
  loop do
25
- uri = URI::HTTP.build(path: "/#{path}", query: URI.encode_www_form(pageSize: page_size, pageNumber: page_number)).request_uri
25
+ uri = URI::HTTP.build(path: "/#{path}", query: URI.encode_www_form(**args[0], pageSize: page_size, pageNumber: page_number)).request_uri
26
26
 
27
27
  res = api_get(uri, *args)
28
28
  raise TableauError, res if res.code.to_s != '200'
@@ -8,7 +8,7 @@ module TableauApi
8
8
  @error_code = error['code']
9
9
  @summary = error['summary']
10
10
  @detail = error['detail']
11
- super(summary)
11
+ super("#{error_code}: #{summary}; #{detail}")
12
12
  end
13
13
  end
14
14
  end
@@ -0,0 +1,10 @@
1
+ module TableauApi
2
+ module Resources
3
+ class Jobs < Base
4
+ def list(kwargs = {})
5
+ url = "sites/#{@client.auth.site_id}/jobs"
6
+ @client.connection.api_get_collection(url, 'backgroundJobs.backgroundJob', **kwargs)
7
+ end
8
+ end
9
+ end
10
+ end
@@ -2,13 +2,14 @@ module TableauApi
2
2
  module Resources
3
3
  class Users < Base
4
4
  SITE_ROLES = %w[
5
- Interactor
6
- Publisher
7
- SiteAdministrator
5
+ Creator
6
+ Explorer
7
+ ExplorerCanPublish
8
+ SiteAdministratorCreator
9
+ SiteAdministratorExplorer
10
+ ServerAdministrator
8
11
  Unlicensed
9
- UnlicensedWithPublish
10
12
  Viewer
11
- ViewerWithPublish
12
13
  ].freeze
13
14
 
14
15
  def create(username:, site_role: 'Viewer')
@@ -1,3 +1,3 @@
1
1
  module TableauApi
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '3.0.0'.freeze
3
3
  end
@@ -26,7 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'multipart-post', '~> 2.0'
27
27
  spec.add_dependency 'rubyzip', '~> 1.0'
28
28
 
29
- spec.add_development_dependency 'bundler', '~> 1.12'
30
29
  spec.add_development_dependency 'rake', '~> 11.0'
31
30
  spec.add_development_dependency 'rspec', '~> 3.6'
32
31
  spec.add_development_dependency 'vcr', '~> 3.0'
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: 2.0.0
4
+ version: 3.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: 2019-08-30 00:00:00.000000000 Z
13
+ date: 2020-11-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -68,20 +68,6 @@ dependencies:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
70
  version: '1.0'
71
- - !ruby/object:Gem::Dependency
72
- name: bundler
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '1.12'
78
- type: :development
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - "~>"
83
- - !ruby/object:Gem::Version
84
- version: '1.12'
85
71
  - !ruby/object:Gem::Dependency
86
72
  name: rake
87
73
  requirement: !ruby/object:Gem::Requirement
@@ -223,6 +209,7 @@ files:
223
209
  - lib/tableau_api/resources/base.rb
224
210
  - lib/tableau_api/resources/datasources.rb
225
211
  - lib/tableau_api/resources/groups.rb
212
+ - lib/tableau_api/resources/jobs.rb
226
213
  - lib/tableau_api/resources/projects.rb
227
214
  - lib/tableau_api/resources/sites.rb
228
215
  - lib/tableau_api/resources/users.rb
@@ -249,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
236
  version: '0'
250
237
  requirements: []
251
238
  rubyforge_project:
252
- rubygems_version: 2.5.2.3
239
+ rubygems_version: 2.6.14.4
253
240
  signing_key:
254
241
  specification_version: 4
255
242
  summary: Ruby interface to the Tableau API.