gazer 0.2.60 → 0.3.1
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/.github/workflows/release.yml +1 -1
- data/.github/workflows/ruby-ci.yml +2 -2
- data/CHANGELOG.md +19 -0
- data/Gemfile.lock +1 -1
- data/lib/gzr/command.rb +15 -9
- data/lib/gzr/commands/attribute/create.rb +3 -3
- data/lib/gzr/commands/attribute/import.rb +2 -2
- data/lib/gzr/commands/attribute/rm.rb +2 -2
- data/lib/gzr/commands/attribute.rb +2 -2
- data/lib/gzr/commands/connection/ls.rb +1 -1
- data/lib/gzr/commands/dashboard/cat.rb +1 -0
- data/lib/gzr/commands/dashboard/mv.rb +2 -2
- data/lib/gzr/commands/dashboard.rb +3 -1
- data/lib/gzr/commands/folder/create.rb +2 -2
- data/lib/gzr/commands/folder/export.rb +2 -0
- data/lib/gzr/commands/folder/tree.rb +3 -3
- data/lib/gzr/commands/folder.rb +2 -0
- data/lib/gzr/commands/look/cat.rb +1 -0
- data/lib/gzr/commands/look/import.rb +2 -2
- data/lib/gzr/commands/look/mv.rb +1 -1
- data/lib/gzr/commands/look.rb +2 -0
- data/lib/gzr/commands/permissions/ls.rb +1 -1
- data/lib/gzr/commands/plan/disable.rb +2 -2
- data/lib/gzr/commands/plan/enable.rb +2 -2
- data/lib/gzr/commands/plan/failures.rb +1 -1
- data/lib/gzr/commands/plan/import.rb +3 -3
- data/lib/gzr/commands/plan/run.rb +2 -2
- data/lib/gzr/commands/query/runquery.rb +3 -3
- data/lib/gzr/commands/role/group_add.rb +1 -1
- data/lib/gzr/commands/role/group_rm.rb +1 -1
- data/lib/gzr/commands/role/user_add.rb +1 -1
- data/lib/gzr/commands/role/user_rm.rb +1 -1
- data/lib/gzr/modules/attribute.rb +8 -8
- data/lib/gzr/modules/connection.rb +2 -2
- data/lib/gzr/modules/dashboard.rb +87 -20
- data/lib/gzr/modules/filehelper.rb +1 -0
- data/lib/gzr/modules/folder.rb +8 -8
- data/lib/gzr/modules/group.rb +10 -10
- data/lib/gzr/modules/look.rb +25 -8
- data/lib/gzr/modules/model.rb +1 -1
- data/lib/gzr/modules/permissions.rb +1 -1
- data/lib/gzr/modules/plan.rb +17 -17
- data/lib/gzr/modules/role.rb +7 -7
- data/lib/gzr/modules/session.rb +5 -5
- data/lib/gzr/modules/user.rb +7 -7
- data/lib/gzr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aa31037c34f27e9ecbb6a167a6fa7b4ff0b7c6862ff5a677221f7a7e3cf6fed
|
4
|
+
data.tar.gz: 44baf0168715b3465d54da5d45d8a642d476a4a087d6970b978d81029ec8321d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 442f59d6d7f1654b423df189701f3061dea572cdf97e452197a45d29e65c61509aac47af22cb24b1510b82b52c7e37377dad3901eeb4480db13bef384781f5b2
|
7
|
+
data.tar.gz: 9adda3d7707fdbcf7beb6e488cf69ecfe32a3d4743aa4070c57b530f5ce4255c1cd6464d810b78deb95efc038c368ac75be472f273af75e5ac2f56113917ea95
|
@@ -88,7 +88,7 @@ jobs:
|
|
88
88
|
|
89
89
|
- name: Upload ts unit test results
|
90
90
|
if: ${{ always() }}
|
91
|
-
uses: actions/upload-artifact@
|
91
|
+
uses: actions/upload-artifact@v3
|
92
92
|
with:
|
93
93
|
name: ruby-ci-test-results-${{ matrix.looker }}
|
94
94
|
path: rspec.xml
|
@@ -100,7 +100,7 @@ jobs:
|
|
100
100
|
|
101
101
|
steps:
|
102
102
|
- name: Download Artifacts
|
103
|
-
uses: actions/download-artifact@
|
103
|
+
uses: actions/download-artifact@v3
|
104
104
|
with:
|
105
105
|
path: artifacts
|
106
106
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.3.1](https://github.com/looker-open-source/gzr/compare/v0.3.0...v0.3.1) (2023-04-20)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* Add --trim option for dashboard cat, look cat, and folder export commands ([#178](https://github.com/looker-open-source/gzr/issues/178)) ([3173796](https://github.com/looker-open-source/gzr/commit/317379600803cfb92d223980930c0831fe8c247d))
|
9
|
+
|
10
|
+
## [0.3.0](https://github.com/looker-open-source/gzr/compare/v0.2.60...v0.3.0) (2023-04-13)
|
11
|
+
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* Misc fixes ([#175](https://github.com/looker-open-source/gzr/issues/175)) ([20b334b](https://github.com/looker-open-source/gzr/commit/20b334b3e4d1a76ecef79d5c686f6cf428cdc47d))
|
16
|
+
|
17
|
+
|
18
|
+
### Miscellaneous Chores
|
19
|
+
|
20
|
+
* release 0.3.0 ([5ed2182](https://github.com/looker-open-source/gzr/commit/5ed2182b94c20126f59b0678671d7c9b81c1c794))
|
21
|
+
|
3
22
|
### [0.2.60](https://www.github.com/looker-open-source/gzr/compare/v0.2.59...v0.2.60) (2023-04-11)
|
4
23
|
|
5
24
|
|
data/Gemfile.lock
CHANGED
data/lib/gzr/command.rb
CHANGED
@@ -58,7 +58,7 @@ module Gzr
|
|
58
58
|
data = @sdk.query(query_id)
|
59
59
|
rescue LookerSDK::Error => e
|
60
60
|
say_error "Error querying query(#{query_id})"
|
61
|
-
say_error e
|
61
|
+
say_error e
|
62
62
|
raise
|
63
63
|
end
|
64
64
|
data
|
@@ -72,7 +72,7 @@ module Gzr
|
|
72
72
|
end
|
73
73
|
rescue LookerSDK::Error => e
|
74
74
|
say_error "Error creating query(#{JSON.pretty_generate(query)})"
|
75
|
-
say_error e
|
75
|
+
say_error e
|
76
76
|
raise
|
77
77
|
end
|
78
78
|
data
|
@@ -86,7 +86,7 @@ module Gzr
|
|
86
86
|
say_error "The api endpoint merge_query(#{merge_result_id}) is not implemented on this Looker instance"
|
87
87
|
rescue LookerSDK::Error => e
|
88
88
|
say_error "Error querying merge_query(#{merge_result_id})"
|
89
|
-
say_error e
|
89
|
+
say_error e
|
90
90
|
raise
|
91
91
|
end
|
92
92
|
data
|
@@ -100,7 +100,7 @@ module Gzr
|
|
100
100
|
raise
|
101
101
|
rescue LookerSDK::Error => e
|
102
102
|
say_error "Error creating merge_query(#{JSON.pretty_generate(merge_query)})"
|
103
|
-
say_error e
|
103
|
+
say_error e
|
104
104
|
raise
|
105
105
|
end
|
106
106
|
data
|
@@ -111,7 +111,7 @@ module Gzr
|
|
111
111
|
data = @sdk.run_inline_query("json",query)
|
112
112
|
rescue LookerSDK::Error => e
|
113
113
|
say_error "Error running inline_query(#{JSON.pretty_generate(query)})"
|
114
|
-
say_error e
|
114
|
+
say_error e
|
115
115
|
raise
|
116
116
|
end
|
117
117
|
data
|
@@ -127,7 +127,7 @@ module Gzr
|
|
127
127
|
say_warning "The current user can't query all color collections"
|
128
128
|
rescue LookerSDK::Error => e
|
129
129
|
say_error "Error querying all_color_collections()"
|
130
|
-
say_error e
|
130
|
+
say_error e
|
131
131
|
raise
|
132
132
|
end
|
133
133
|
data
|
@@ -145,7 +145,7 @@ module Gzr
|
|
145
145
|
say_warning "The current user can't query the default color collection"
|
146
146
|
rescue LookerSDK::Error => e
|
147
147
|
say_error "Error querying default_color_collection()"
|
148
|
-
say_error e
|
148
|
+
say_error e
|
149
149
|
raise
|
150
150
|
end
|
151
151
|
data
|
@@ -161,7 +161,7 @@ module Gzr
|
|
161
161
|
say_warning "The color_collection(#{collection_id}) is not found"
|
162
162
|
rescue LookerSDK::Error => e
|
163
163
|
say_error "Error querying color_collection(#{collection_id})"
|
164
|
-
say_error e
|
164
|
+
say_error e
|
165
165
|
raise
|
166
166
|
end
|
167
167
|
data
|
@@ -266,6 +266,7 @@ module Gzr
|
|
266
266
|
end
|
267
267
|
end
|
268
268
|
|
269
|
+
|
269
270
|
##
|
270
271
|
# This method accepts the name of an sdk operation, then finds the parameter for that
|
271
272
|
# operation in the data structures from the swagger.json file. The parameter is a
|
@@ -282,6 +283,11 @@ module Gzr
|
|
282
283
|
# end
|
283
284
|
|
284
285
|
def keys_to_keep(operation)
|
286
|
+
@keys_to_keep_cache ||= {}
|
287
|
+
@keys_to_keep_cache[operation] ||= keys_to_keep_internal(operation)
|
288
|
+
end
|
289
|
+
|
290
|
+
def keys_to_keep_internal(operation)
|
285
291
|
o = @sdk.operations[operation] || @sdk.operations[operation.to_sym]
|
286
292
|
begin
|
287
293
|
say_error "Operation #{operation} not found"
|
@@ -386,7 +392,7 @@ module Gzr
|
|
386
392
|
##
|
387
393
|
# This method will accept two arrays, a and b, and create a third array
|
388
394
|
# like [ [a[0],b[0]], [a[1],b[1]], [a[2],b[2]], ...].
|
389
|
-
# If either array is longer than the other, additional pairs
|
395
|
+
# If either array is longer than the other, additional pairs
|
390
396
|
# will be generated with the shorter array padded out with nil values.
|
391
397
|
#
|
392
398
|
# Any additional args will be added to each inner array.
|
@@ -44,11 +44,11 @@ module Gzr
|
|
44
44
|
source[:'value_is_hidden'] = true if @options[:'is-hidden']
|
45
45
|
source[:'user_can_view'] = true if @options[:'can-view']
|
46
46
|
source[:'user_can_edit'] = true if @options[:'can-edit']
|
47
|
-
source[:'
|
47
|
+
source[:'hidden_value_domain_allowlist'] = @options[:'domain-allowlist'] if @options[:'is-hidden'] && @options[:'domain-allowlist']
|
48
48
|
|
49
49
|
attr = upsert_user_attribute(source, @options[:force], output: $stdout)
|
50
|
-
output.puts "Imported attribute #{attr.name} #{attr.id}" unless @options[:plain]
|
51
|
-
output.puts attr.id if @options[:plain]
|
50
|
+
output.puts "Imported attribute #{attr.name} #{attr.id}" unless @options[:plain]
|
51
|
+
output.puts attr.id if @options[:plain]
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -42,8 +42,8 @@ module Gzr
|
|
42
42
|
with_session do
|
43
43
|
read_file(@file) do |source|
|
44
44
|
attr = upsert_user_attribute(source, @options[:force], output: $stdout)
|
45
|
-
output.puts "Imported attribute #{attr.name} #{attr.id}" unless @options[:plain]
|
46
|
-
output.puts attr.id if @options[:plain]
|
45
|
+
output.puts "Imported attribute #{attr.name} #{attr.id}" unless @options[:plain]
|
46
|
+
output.puts attr.id if @options[:plain]
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
@@ -52,8 +52,8 @@ module Gzr
|
|
52
52
|
|
53
53
|
delete_user_attribute(attr.id)
|
54
54
|
|
55
|
-
output.puts "Deleted attribute #{attr.name} #{attr.id}" unless @options[:plain]
|
56
|
-
output.puts attr.id if @options[:plain]
|
55
|
+
output.puts "Deleted attribute #{attr.name} #{attr.id}" unless @options[:plain]
|
56
|
+
output.puts attr.id if @options[:plain]
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
@@ -100,8 +100,8 @@ module Gzr
|
|
100
100
|
desc: 'can a non-admin user view the value'
|
101
101
|
method_option :'can-edit', type: :boolean, default: true,
|
102
102
|
desc: 'can a user change the value themself'
|
103
|
-
method_option :'domain-
|
104
|
-
desc: 'what domains can receive the value of a hidden attribute.'
|
103
|
+
method_option :'domain-allowlist', type: :string,
|
104
|
+
desc: 'what domains can receive the value of a hidden attribute.'
|
105
105
|
def create(attr_name, attr_label=nil)
|
106
106
|
if options[:help]
|
107
107
|
invoke :help, ['create']
|
@@ -61,7 +61,7 @@ module Gzr
|
|
61
61
|
if @options[:csv] then
|
62
62
|
output.puts render_csv(table)
|
63
63
|
else
|
64
|
-
output.puts table.render(if @options[:plain] then :basic else :ascii end, alignments: alignments, width:
|
64
|
+
output.puts table.render(if @options[:plain] then :basic else :ascii end, alignments: alignments, width: @options[:width] || TTY::Screen.width)
|
65
65
|
end
|
66
66
|
end if table
|
67
67
|
end
|
@@ -48,14 +48,14 @@ module Gzr
|
|
48
48
|
if matching_title.empty? || matching_title.first[:deleted]
|
49
49
|
matching_title = false
|
50
50
|
end
|
51
|
-
|
51
|
+
|
52
52
|
if matching_title
|
53
53
|
raise Gzr::CLI::Error, "Dashboard #{dash[:title]} already exists in folder #{@target_folder_id}\nUse --force if you want to overwrite it" unless @options[:force]
|
54
54
|
say_ok "Deleting existing dashboard #{matching_title.first[:id]} #{matching_title.first[:title]} in folder #{@target_folder_id}", output: output
|
55
55
|
update_dashboard(matching_title.first[:id],{:deleted=>true})
|
56
56
|
end
|
57
57
|
update_dashboard(dash[:id],{:folder_id=>@target_folder_id})
|
58
|
-
output.puts "Moved dashboard #{dash[:id]} to folder #{@target_folder_id}" unless @options[:plain]
|
58
|
+
output.puts "Moved dashboard #{dash[:id]} to folder #{@target_folder_id}" unless @options[:plain]
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
@@ -53,7 +53,9 @@ module Gzr
|
|
53
53
|
method_option :transform, type: :string,
|
54
54
|
desc: 'Fully-qualified path to a JSON file describing the transformations to apply'
|
55
55
|
method_option :simple_filename, type: :boolean,
|
56
|
-
|
56
|
+
desc: 'Use simple filename for output (Dashboard_<id>.json)'
|
57
|
+
method_option :trim, type: :boolean,
|
58
|
+
desc: 'Trim output to minimal set of fields for later import'
|
57
59
|
def cat(dashboard_id)
|
58
60
|
if options[:help]
|
59
61
|
invoke :help, ['cat']
|
@@ -40,8 +40,8 @@ module Gzr
|
|
40
40
|
folder = nil
|
41
41
|
with_session do
|
42
42
|
folder = create_folder(@name, @parent_folder)
|
43
|
-
output.puts "Created folder #{folder.id}" unless @options[:plain]
|
44
|
-
output.puts folder.id if @options[:plain]
|
43
|
+
output.puts "Created folder #{folder.id}" unless @options[:plain]
|
44
|
+
output.puts folder.id if @options[:plain]
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -99,12 +99,14 @@ module Gzr
|
|
99
99
|
end
|
100
100
|
folder[:looks].each do |l|
|
101
101
|
look = cat_look(l[:id])
|
102
|
+
look = trim_look(look) if @options[:trim]
|
102
103
|
write_file("Look_#{look[:id]}_#{look[:title]}.json", base, path) do |f|
|
103
104
|
f.write JSON.pretty_generate(look)
|
104
105
|
end
|
105
106
|
end
|
106
107
|
folder[:dashboards].each do |d|
|
107
108
|
data = cat_dashboard(d[:id])
|
109
|
+
data = trim_dashboard(data) if @options[:trim]
|
108
110
|
write_file("Dashboard_#{data[:id]}_#{data[:title]}.json", base, path) do |f|
|
109
111
|
f.write JSON.pretty_generate(data)
|
110
112
|
end
|
@@ -67,10 +67,10 @@ module Gzr
|
|
67
67
|
|
68
68
|
tree_data = Hash.new
|
69
69
|
|
70
|
-
folder_ids.each do |folder_id|
|
70
|
+
folder_ids.each do |folder_id|
|
71
71
|
s = query_folder(folder_id, "id,name,parent_id,looks(id,title),dashboards(id,title)")
|
72
72
|
folder_name = s.name
|
73
|
-
folder_name = "nil (#{s.id})" unless folder_name
|
73
|
+
folder_name = "nil (#{s.id})" unless folder_name
|
74
74
|
folder_name = "\"#{folder_name}\"" if ((folder_name != folder_name.strip) || (folder_name.length == 0))
|
75
75
|
folder_name += " (#{folder_id})" unless folder_ids.length == 1
|
76
76
|
tree_data[folder_name] =
|
@@ -88,7 +88,7 @@ module Gzr
|
|
88
88
|
tree_branch = Hash.new
|
89
89
|
data.each do |s|
|
90
90
|
folder_name = s.name
|
91
|
-
folder_name = "nil (#{s.id})" unless folder_name
|
91
|
+
folder_name = "nil (#{s.id})" unless folder_name
|
92
92
|
folder_name = "\"#{folder_name}\"" if ((folder_name != folder_name.strip) || (folder_name.length == 0))
|
93
93
|
tree_branch[folder_name] =
|
94
94
|
[ recurse_folders(s.id) ] +
|
data/lib/gzr/commands/folder.rb
CHANGED
@@ -66,6 +66,8 @@ module Gzr
|
|
66
66
|
desc: 'Display usage information'
|
67
67
|
method_option :plans, type: :boolean,
|
68
68
|
desc: 'Include scheduled plans'
|
69
|
+
method_option :trim, type: :boolean,
|
70
|
+
desc: 'Trim output to minimal set of fields for later import'
|
69
71
|
method_option :dir, type: :string, default: '.',
|
70
72
|
desc: 'Directory to store output tree'
|
71
73
|
method_option :tar, type: :string,
|
@@ -43,6 +43,7 @@ module Gzr
|
|
43
43
|
say_warning("options: #{@options.inspect}") if @options[:debug]
|
44
44
|
with_session do
|
45
45
|
data = cat_look(@look_id)
|
46
|
+
data = trim_look(data) if @options[:trim]
|
46
47
|
file_name = if @options[:dir]
|
47
48
|
@options[:simple_filename] ? "Look_#{data[:id]}.json" : "Look_#{data[:id]}_#{data[:title]}.json"
|
48
49
|
else
|
@@ -62,8 +62,8 @@ module Gzr
|
|
62
62
|
|
63
63
|
look = upsert_look(@me.id,create_fetch_query(data[:query]).id,@dest_folder_id,data,output: output)
|
64
64
|
upsert_plans_for_look(look.id,@me.id,data[:scheduled_plans]) if data[:scheduled_plans]
|
65
|
-
output.puts "Imported look #{look.id}" unless @options[:plain]
|
66
|
-
output.puts look.id if @options[:plain]
|
65
|
+
output.puts "Imported look #{look.id}" unless @options[:plain]
|
66
|
+
output.puts look.id if @options[:plain]
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
data/lib/gzr/commands/look/mv.rb
CHANGED
@@ -55,7 +55,7 @@ module Gzr
|
|
55
55
|
update_look(matching_title.first[:id],{:deleted=>true})
|
56
56
|
end
|
57
57
|
update_look(look[:id],{:folder_id=>@target_folder_id})
|
58
|
-
output.puts "Moved look #{look[:id]} to folder #{@target_folder_id}" unless @options[:plain]
|
58
|
+
output.puts "Moved look #{look[:id]} to folder #{@target_folder_id}" unless @options[:plain]
|
59
59
|
end
|
60
60
|
end
|
61
61
|
end
|
data/lib/gzr/commands/look.rb
CHANGED
@@ -84,6 +84,8 @@ module Gzr
|
|
84
84
|
desc: 'Include scheduled plans'
|
85
85
|
method_option :simple_filename, type: :boolean,
|
86
86
|
desc: 'Use simple filename for output (Look_<id>.json)'
|
87
|
+
method_option :trim, type: :boolean,
|
88
|
+
desc: 'Trim output to minimal set of fields for later import'
|
87
89
|
def cat(look_id)
|
88
90
|
if options[:help]
|
89
91
|
invoke :help, ['cat']
|
@@ -63,7 +63,7 @@ module Gzr
|
|
63
63
|
if @options[:csv] then
|
64
64
|
output.puts render_csv(table)
|
65
65
|
else
|
66
|
-
output.puts table.render(if @options[:plain] then :basic else :ascii end, alignments: alignments, width:
|
66
|
+
output.puts table.render(if @options[:plain] then :basic else :ascii end, alignments: alignments, width: @options[:width] || TTY::Screen.width)
|
67
67
|
end
|
68
68
|
end if table
|
69
69
|
end
|
@@ -39,8 +39,8 @@ module Gzr
|
|
39
39
|
say_warning("options: #{@options.inspect}") if @options[:debug]
|
40
40
|
with_session do
|
41
41
|
plan = update_scheduled_plan(@plan_id, { :enabled=>false })
|
42
|
-
output.puts "Disabled plan #{plan.id}" unless @options[:plain]
|
43
|
-
output.puts plan.id if @options[:plain]
|
42
|
+
output.puts "Disabled plan #{plan.id}" unless @options[:plain]
|
43
|
+
output.puts plan.id if @options[:plain]
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -39,8 +39,8 @@ module Gzr
|
|
39
39
|
say_warning("options: #{@options.inspect}") if @options[:debug]
|
40
40
|
with_session do
|
41
41
|
plan = update_scheduled_plan(@plan_id, { :enabled=>true })
|
42
|
-
output.puts "Enabled plan #{plan.id}" unless @options[:plain]
|
43
|
-
output.puts plan.id if @options[:plain]
|
42
|
+
output.puts "Enabled plan #{plan.id}" unless @options[:plain]
|
43
|
+
output.puts plan.id if @options[:plain]
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -87,7 +87,7 @@ module Gzr
|
|
87
87
|
if @options[:csv] then
|
88
88
|
output.puts render_csv(table)
|
89
89
|
else
|
90
|
-
output.puts table.render(if @options[:plain] then :basic else :ascii end, alignments: alignments, width: @options[:width] || TTY::Screen.width
|
90
|
+
output.puts table.render(if @options[:plain] then :basic else :ascii end, alignments: alignments, width: @options[:width] || TTY::Screen.width)
|
91
91
|
end
|
92
92
|
end if table
|
93
93
|
end
|
@@ -46,7 +46,7 @@ module Gzr
|
|
46
46
|
with_session do
|
47
47
|
|
48
48
|
@me ||= query_me("id")
|
49
|
-
|
49
|
+
|
50
50
|
|
51
51
|
read_file(@plan_file) do |data|
|
52
52
|
plan = nil
|
@@ -58,8 +58,8 @@ module Gzr
|
|
58
58
|
else
|
59
59
|
raise Gzr::CLI::Error, "Invalid type '#{obj_type}', valid types are look and dashboard"
|
60
60
|
end
|
61
|
-
output.puts "Imported plan #{plan.id}" unless @options[:plain]
|
62
|
-
output.puts plan.id if @options[:plain]
|
61
|
+
output.puts "Imported plan #{plan.id}" unless @options[:plain]
|
62
|
+
output.puts plan.id if @options[:plain]
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
@@ -42,14 +42,14 @@ module Gzr
|
|
42
42
|
# The api call scheduled_plan_run_once is an odd duck. It accepts
|
43
43
|
# the output of any of the calls to retrieve a scheduled plan
|
44
44
|
# even though many of the attributes passed are marked read-only.
|
45
|
-
# Furthermore, if there is a "secret" - like the password for
|
45
|
+
# Furthermore, if there is a "secret" - like the password for
|
46
46
|
# sftp or s3 - it will match the plan body up with the plan
|
47
47
|
# as known in the server and if they are identical apart from
|
48
48
|
# the secret, the api will effectively include to secret in order
|
49
49
|
# execute the plan.
|
50
50
|
plan.delete(:id)
|
51
51
|
run_scheduled_plan(plan)
|
52
|
-
output.puts "Executed plan #{@plan_id}" unless @options[:plain]
|
52
|
+
output.puts "Executed plan #{@plan_id}" unless @options[:plain]
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
@@ -80,15 +80,15 @@ module Gzr
|
|
80
80
|
@sdk.run_query(query_id,@options[:format]) { |data,progress| (f || output).write(data) }
|
81
81
|
rescue LookerSDK::Error => e
|
82
82
|
say_error "Error in run_query(#{query_id},#{@options[:format]})})"
|
83
|
-
say_error e
|
83
|
+
say_error e
|
84
84
|
raise
|
85
85
|
end
|
86
86
|
else
|
87
87
|
begin
|
88
|
-
@sdk.run_inline_query(@options[:format],query_hash) { |data,progress| (f || output).write(data) }
|
88
|
+
@sdk.run_inline_query(@options[:format],query_hash) { |data,progress| (f || output).write(data) }
|
89
89
|
rescue LookerSDK::Error => e
|
90
90
|
say_error "Error in run_inline_query(#{@options[:format]},#{JSON.pretty_generate(query_hash)})"
|
91
|
-
say_error e
|
91
|
+
say_error e
|
92
92
|
raise
|
93
93
|
end
|
94
94
|
end
|
@@ -33,7 +33,7 @@ module Gzr
|
|
33
33
|
# do nothing
|
34
34
|
rescue LookerSDK::Error => e
|
35
35
|
say_error "Error querying user_attribute(#{attr_id},#{JSON.pretty_generate(req)})"
|
36
|
-
say_error e
|
36
|
+
say_error e
|
37
37
|
raise
|
38
38
|
end
|
39
39
|
data
|
@@ -48,7 +48,7 @@ module Gzr
|
|
48
48
|
data = @sdk.all_user_attributes(req)
|
49
49
|
rescue LookerSDK::Error => e
|
50
50
|
say_error "Error querying all_user_attributes(#{JSON.pretty_generate(req)})"
|
51
|
-
say_error e
|
51
|
+
say_error e
|
52
52
|
raise
|
53
53
|
end
|
54
54
|
data
|
@@ -72,7 +72,7 @@ module Gzr
|
|
72
72
|
data = @sdk.create_user_attribute(attr)
|
73
73
|
rescue LookerSDK::Error => e
|
74
74
|
say_error "Error creating user_attribute(#{JSON.pretty_generate(attr)})"
|
75
|
-
say_error e
|
75
|
+
say_error e
|
76
76
|
raise
|
77
77
|
end
|
78
78
|
data
|
@@ -84,7 +84,7 @@ module Gzr
|
|
84
84
|
data = @sdk.update_user_attribute(id,attr)
|
85
85
|
rescue LookerSDK::Error => e
|
86
86
|
say_error "Error updating user_attribute(#{id},#{JSON.pretty_generate(attr)})"
|
87
|
-
say_error e
|
87
|
+
say_error e
|
88
88
|
raise
|
89
89
|
end
|
90
90
|
data
|
@@ -96,7 +96,7 @@ module Gzr
|
|
96
96
|
data = @sdk.delete_user_attribute(id)
|
97
97
|
rescue LookerSDK::Error => e
|
98
98
|
say_error "Error deleting user_attribute(#{id})"
|
99
|
-
say_error e
|
99
|
+
say_error e
|
100
100
|
raise
|
101
101
|
end
|
102
102
|
data
|
@@ -111,7 +111,7 @@ module Gzr
|
|
111
111
|
return nil
|
112
112
|
rescue LookerSDK::Error => e
|
113
113
|
say_error "Error querying all_user_attribute_group_values(#{attr_id},#{JSON.pretty_generate(req)})"
|
114
|
-
say_error e
|
114
|
+
say_error e
|
115
115
|
raise
|
116
116
|
end
|
117
117
|
end
|
@@ -146,10 +146,10 @@ module Gzr
|
|
146
146
|
new_attr = source.select do |k,v|
|
147
147
|
(keys_to_keep('create_user_attribute') - [:hidden_value_domain_whitelist]).include? k
|
148
148
|
end
|
149
|
-
new_attr[:hidden_value_domain_whitelist] = source[:
|
149
|
+
new_attr[:hidden_value_domain_whitelist] = source[:hidden_value_domain_allowlist] if source[:value_is_hidden] && source[:hidden_value_domain_allowlist]
|
150
150
|
|
151
151
|
return create_attribute(new_attr)
|
152
152
|
end
|
153
153
|
end
|
154
154
|
end
|
155
|
-
end
|
155
|
+
end
|
@@ -30,7 +30,7 @@ module Gzr
|
|
30
30
|
data = @sdk.all_connections(fields ? {:fields=>fields} : nil )
|
31
31
|
rescue LookerSDK::Error => e
|
32
32
|
say_error "Error querying all_connections({:fields=>\"#{fields}\"})"
|
33
|
-
say_error e
|
33
|
+
say_error e
|
34
34
|
raise
|
35
35
|
end
|
36
36
|
data
|
@@ -42,7 +42,7 @@ module Gzr
|
|
42
42
|
data = @sdk.all_dialect_infos(fields ? {:fields=>fields} : nil )
|
43
43
|
rescue LookerSDK::Error => e
|
44
44
|
say_error "Error querying all_dialect_infos({:fields=>\"#{fields}\"})"
|
45
|
-
say_error e
|
45
|
+
say_error e
|
46
46
|
raise
|
47
47
|
end
|
48
48
|
data
|