tableau_server_client 0.3.0 → 0.4.4
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/CHANGELOG.md +3 -0
- data/README.md +6 -0
- data/lib/tableau_server_client/request_url.rb +1 -1
- data/lib/tableau_server_client/resources/datasource.rb +1 -1
- data/lib/tableau_server_client/resources/group.rb +31 -0
- data/lib/tableau_server_client/resources/site.rb +6 -0
- data/lib/tableau_server_client/resources/user.rb +18 -1
- data/lib/tableau_server_client/resources/workbook.rb +1 -1
- data/lib/tableau_server_client/version.rb +1 -1
- data/tableau_server_client.gemspec +1 -1
- metadata +9 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a9fcfc2f4fb4ee9d576bc4049b462fa7127c3a12116f1b789a0ca65839311960
|
|
4
|
+
data.tar.gz: 9769ba75f0c2f1e70314cd92296fbedeb24d2a255f2dd060310e970f83ad77ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c286496bc37d8d01a1d9871b6b4f30e1c7d4abba5287173bc89874c106259baeddb0399a3627fa554f7a5143096a47afea21f225782fc7f7a1bdd5e282a78387
|
|
7
|
+
data.tar.gz: a35dc1650c7b3806c031580a2f720542b7d7b936f3eebdd90d916cc50cd2fed52b0451c29d50e70edc67440fcd7744960b5020413a5bc93972690e0deb2884f8
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
|
@@ -9,7 +9,7 @@ module TableauServerClient
|
|
|
9
9
|
class Datasource < Resource
|
|
10
10
|
include Downloadable
|
|
11
11
|
|
|
12
|
-
attr_reader :id, :name, :webpage_url, :content_url, :type, :created_at, :updated_at, :is_certified
|
|
12
|
+
attr_reader :id, :name, :webpage_url, :content_url, :type, :created_at, :updated_at, :is_certified, :project_id, :owner_id
|
|
13
13
|
attr_writer :owner
|
|
14
14
|
|
|
15
15
|
def self.from_response(client, path, xml)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require 'tableau_server_client/resources/resource'
|
|
2
|
+
|
|
3
|
+
module TableauServerClient
|
|
4
|
+
module Resources
|
|
5
|
+
|
|
6
|
+
class Group < Resource
|
|
7
|
+
|
|
8
|
+
attr_reader :id, :name, :site_role
|
|
9
|
+
|
|
10
|
+
def self.from_response(client, path, xml)
|
|
11
|
+
attrs = extract_attributes(xml)
|
|
12
|
+
if xml.xpath("xmlns:import")[0]
|
|
13
|
+
attrs['site_role'] = xml.xpath("xmlns:import")[0]['siteRole']
|
|
14
|
+
end
|
|
15
|
+
new(client, path, attrs)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.from_collection_response(client, path, xml)
|
|
19
|
+
xml.xpath("//xmlns:groups/xmlns:group").each do |s|
|
|
20
|
+
id = s['id']
|
|
21
|
+
yield from_response(client, "#{path}/#{id}", s)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def users
|
|
26
|
+
@client.get_collection(User.location(path))
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -5,6 +5,7 @@ require 'tableau_server_client/resources/user'
|
|
|
5
5
|
require 'tableau_server_client/resources/subscription'
|
|
6
6
|
require 'tableau_server_client/resources/extract_refresh'
|
|
7
7
|
require 'tableau_server_client/resources/view'
|
|
8
|
+
require 'tableau_server_client/resources/group'
|
|
8
9
|
|
|
9
10
|
module TableauServerClient
|
|
10
11
|
module Resources
|
|
@@ -77,6 +78,11 @@ module TableauServerClient
|
|
|
77
78
|
@client.get_collection ExtractRefresh.location("#{path}/tasks")
|
|
78
79
|
end
|
|
79
80
|
|
|
81
|
+
def groups(filter: [])
|
|
82
|
+
@client.get_collection Group.location(path, filter: filter)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
|
|
80
86
|
end
|
|
81
87
|
end
|
|
82
88
|
end
|
|
@@ -20,7 +20,7 @@ module TableauServerClient
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def reload
|
|
23
|
-
@client.get
|
|
23
|
+
@client.get location
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def full_name
|
|
@@ -39,6 +39,23 @@ module TableauServerClient
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
def to_request
|
|
43
|
+
request = build_request {|b|
|
|
44
|
+
b.user(siteRole: site_role)
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def update_site_role!(role)
|
|
49
|
+
@site_role = role
|
|
50
|
+
# Using location to get corretct path
|
|
51
|
+
# When initialized from Group path will be groups/group_id/users/user_id
|
|
52
|
+
@client.update(self, path: location.path)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def location
|
|
56
|
+
User.location(site_path, id)
|
|
57
|
+
end
|
|
58
|
+
|
|
42
59
|
end
|
|
43
60
|
end
|
|
44
61
|
end
|
|
@@ -16,7 +16,7 @@ module TableauServerClient
|
|
|
16
16
|
|
|
17
17
|
def self.from_response(client, path, xml)
|
|
18
18
|
attrs = extract_attributes(xml)
|
|
19
|
-
attrs['project_id'] = xml.
|
|
19
|
+
attrs['project_id'] = xml.at_xpath("xmlns:project")&.[]('id')
|
|
20
20
|
attrs['owner_id'] = xml.xpath("xmlns:owner")[0]['id']
|
|
21
21
|
attrs['tags'] = xml.xpath("xmlns:tags/xmlns:tag").map {|t| t['label'] }
|
|
22
22
|
new(client, path, attrs)
|
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
|
11
11
|
|
|
12
12
|
spec.summary = %q{Tableau Server REST API Client}
|
|
13
13
|
spec.description = %q{REST API Client for Tableau Server.}
|
|
14
|
-
spec.homepage = "https://github.com/
|
|
14
|
+
spec.homepage = "https://github.com/cookpad/tableau-server-client"
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tableau_server_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- shimpeko
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-07-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -131,6 +131,7 @@ extensions: []
|
|
|
131
131
|
extra_rdoc_files: []
|
|
132
132
|
files:
|
|
133
133
|
- ".gitignore"
|
|
134
|
+
- CHANGELOG.md
|
|
134
135
|
- Gemfile
|
|
135
136
|
- README.md
|
|
136
137
|
- Rakefile
|
|
@@ -145,6 +146,7 @@ files:
|
|
|
145
146
|
- lib/tableau_server_client/resources/datasource.rb
|
|
146
147
|
- lib/tableau_server_client/resources/downloadable.rb
|
|
147
148
|
- lib/tableau_server_client/resources/extract_refresh.rb
|
|
149
|
+
- lib/tableau_server_client/resources/group.rb
|
|
148
150
|
- lib/tableau_server_client/resources/job.rb
|
|
149
151
|
- lib/tableau_server_client/resources/project.rb
|
|
150
152
|
- lib/tableau_server_client/resources/resource.rb
|
|
@@ -158,11 +160,11 @@ files:
|
|
|
158
160
|
- lib/tableau_server_client/token.rb
|
|
159
161
|
- lib/tableau_server_client/version.rb
|
|
160
162
|
- tableau_server_client.gemspec
|
|
161
|
-
homepage: https://github.com/
|
|
163
|
+
homepage: https://github.com/cookpad/tableau-server-client
|
|
162
164
|
licenses:
|
|
163
165
|
- MIT
|
|
164
166
|
metadata: {}
|
|
165
|
-
post_install_message:
|
|
167
|
+
post_install_message:
|
|
166
168
|
rdoc_options: []
|
|
167
169
|
require_paths:
|
|
168
170
|
- lib
|
|
@@ -177,8 +179,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
177
179
|
- !ruby/object:Gem::Version
|
|
178
180
|
version: '0'
|
|
179
181
|
requirements: []
|
|
180
|
-
rubygems_version: 3.
|
|
181
|
-
signing_key:
|
|
182
|
+
rubygems_version: 3.3.8
|
|
183
|
+
signing_key:
|
|
182
184
|
specification_version: 4
|
|
183
185
|
summary: Tableau Server REST API Client
|
|
184
186
|
test_files: []
|