morpheus-cli 3.6.32 → 3.6.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/morpheus/cli/credentials.rb +1 -1
- data/lib/morpheus/cli/environments_command.rb +3 -3
- data/lib/morpheus/cli/instances.rb +12 -12
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +1 -1
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli/wiki_command.rb +14 -10
- 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: d794a4ae333246f0e3207b26be0374cddc7a524be9ab4351798c19acb33dd065
|
4
|
+
data.tar.gz: db7694d619ace42e93872b63212d019555e790232ed173196b276d42c8ebb9bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cdd00e0cd5ed3810ae3aa1620deae76b8c6f5a48b622a50095f6849e19ee71ff41f2c116556cc122eb2682055b390280fa3301c04f4859bd16f4b03e866f29d
|
7
|
+
data.tar.gz: 8ad4f8f73d76d164089a33cd64811efa3ddcac72d79c339cb7a1629a6371440fbf1882774309bae2a21a37fac5704d08a9b6af6086142d269e8d100e89b31be9
|
@@ -270,8 +270,8 @@ module Morpheus
|
|
270
270
|
username = wallet['username']
|
271
271
|
|
272
272
|
begin
|
273
|
-
auth_interface.setopts(options)
|
274
273
|
auth_interface = Morpheus::AuthInterface.new(@appliance_url)
|
274
|
+
auth_interface.setopts(options)
|
275
275
|
if options[:dry_run]
|
276
276
|
print_dry_run auth_interface.dry.use_refresh_token(wallet['refresh_token'])
|
277
277
|
return nil
|
@@ -167,7 +167,7 @@ class Morpheus::Cli::EnvironmentsCommand
|
|
167
167
|
else
|
168
168
|
display_name = json_response['environment'] ? json_response['environment']['name'] : ''
|
169
169
|
print_green_success "Environment #{display_name} added"
|
170
|
-
get([json_response['environment']['id']])
|
170
|
+
get([json_response['environment']['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
171
171
|
end
|
172
172
|
return 0
|
173
173
|
rescue RestClient::Exception => e
|
@@ -230,7 +230,7 @@ class Morpheus::Cli::EnvironmentsCommand
|
|
230
230
|
else
|
231
231
|
display_name = json_response['environment'] ? json_response['environment']['name'] : ''
|
232
232
|
print_green_success "Environment #{display_name} updated"
|
233
|
-
get([json_response['environment']['id']])
|
233
|
+
get([json_response['environment']['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
234
234
|
end
|
235
235
|
return 0
|
236
236
|
rescue RestClient::Exception => e
|
@@ -312,7 +312,7 @@ class Morpheus::Cli::EnvironmentsCommand
|
|
312
312
|
else
|
313
313
|
display_name = json_response['environment'] ? json_response['environment']['name'] : ''
|
314
314
|
print_green_success "Environment #{display_name} updated"
|
315
|
-
get([json_response['environment']['id']])
|
315
|
+
get([json_response['environment']['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
316
316
|
end
|
317
317
|
return 0
|
318
318
|
rescue RestClient::Exception => e
|
@@ -427,8 +427,7 @@ class Morpheus::Cli::Instances
|
|
427
427
|
instance_id = json_response["instance"]["id"]
|
428
428
|
instance_name = json_response["instance"]["name"]
|
429
429
|
print_green_success "Provisioning instance [#{instance_id}] #{instance_name}"
|
430
|
-
get([instance_id])
|
431
|
-
#list([])
|
430
|
+
get([instance_id] + (options[:remote] ? ["-r",options[:remote]] : []))
|
432
431
|
end
|
433
432
|
return 0
|
434
433
|
rescue RestClient::Exception => e
|
@@ -538,7 +537,7 @@ class Morpheus::Cli::Instances
|
|
538
537
|
else
|
539
538
|
print_green_success "Updated instance #{instance['name']}"
|
540
539
|
#list([])
|
541
|
-
get([instance['id']])
|
540
|
+
get([instance['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
542
541
|
end
|
543
542
|
return 0
|
544
543
|
rescue RestClient::Exception => e
|
@@ -615,7 +614,7 @@ class Morpheus::Cli::Instances
|
|
615
614
|
else
|
616
615
|
print_green_success "Updated notes for instance #{instance['name']}"
|
617
616
|
#list([])
|
618
|
-
get([instance['id']])
|
617
|
+
get([instance['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
619
618
|
end
|
620
619
|
return 0
|
621
620
|
rescue RestClient::Exception => e
|
@@ -692,7 +691,7 @@ class Morpheus::Cli::Instances
|
|
692
691
|
print reset,"\n"
|
693
692
|
|
694
693
|
if open_wiki_link
|
695
|
-
return view_wiki([
|
694
|
+
return view_wiki([instance['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
696
695
|
end
|
697
696
|
|
698
697
|
return 0
|
@@ -814,7 +813,8 @@ class Morpheus::Cli::Instances
|
|
814
813
|
puts as_json(json_response, options)
|
815
814
|
else
|
816
815
|
print_green_success "Updated wiki page for instance #{instance['name']}"
|
817
|
-
|
816
|
+
|
817
|
+
wiki([instance['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
818
818
|
end
|
819
819
|
return 0
|
820
820
|
rescue RestClient::Exception => e
|
@@ -1695,7 +1695,7 @@ class Morpheus::Cli::Instances
|
|
1695
1695
|
return
|
1696
1696
|
end
|
1697
1697
|
if !options[:quiet]
|
1698
|
-
envs([args[0]])
|
1698
|
+
envs([args[0]] + (options[:remote] ? ["-r",options[:remote]] : []))
|
1699
1699
|
end
|
1700
1700
|
rescue RestClient::Exception => e
|
1701
1701
|
print_rest_exception(e, options)
|
@@ -1728,7 +1728,7 @@ class Morpheus::Cli::Instances
|
|
1728
1728
|
return
|
1729
1729
|
end
|
1730
1730
|
if !options[:quiet]
|
1731
|
-
envs([args[0]])
|
1731
|
+
envs([args[0]] + (options[:remote] ? ["-r",options[:remote]] : []))
|
1732
1732
|
end
|
1733
1733
|
rescue RestClient::Exception => e
|
1734
1734
|
print_rest_exception(e, options)
|
@@ -2540,7 +2540,7 @@ class Morpheus::Cli::Instances
|
|
2540
2540
|
return
|
2541
2541
|
elsif !options[:quiet]
|
2542
2542
|
print_green_success "Removing instance #{instance['name']}"
|
2543
|
-
#list([])
|
2543
|
+
#list([] + (options[:remote] ? ["-r",options[:remote]] : []))
|
2544
2544
|
end
|
2545
2545
|
rescue RestClient::Exception => e
|
2546
2546
|
print_rest_exception(e, options)
|
@@ -2572,7 +2572,7 @@ class Morpheus::Cli::Instances
|
|
2572
2572
|
print as_json(json_response, options), "\n"
|
2573
2573
|
return
|
2574
2574
|
elsif !options[:quiet]
|
2575
|
-
security_groups([args[0]])
|
2575
|
+
security_groups([args[0]] + (options[:remote] ? ["-r",options[:remote]] : []))
|
2576
2576
|
end
|
2577
2577
|
rescue RestClient::Exception => e
|
2578
2578
|
print_rest_exception(e, options)
|
@@ -2604,7 +2604,7 @@ class Morpheus::Cli::Instances
|
|
2604
2604
|
print as_json(json_response, options), "\n"
|
2605
2605
|
return
|
2606
2606
|
elsif !options[:quiet]
|
2607
|
-
security_groups([args[0]])
|
2607
|
+
security_groups([args[0]] + (options[:remote] ? ["-r",options[:remote]] : []))
|
2608
2608
|
end
|
2609
2609
|
rescue RestClient::Exception => e
|
2610
2610
|
print_rest_exception(e, options)
|
@@ -2698,7 +2698,7 @@ class Morpheus::Cli::Instances
|
|
2698
2698
|
return
|
2699
2699
|
end
|
2700
2700
|
if !options[:quiet]
|
2701
|
-
security_groups([args[0]])
|
2701
|
+
security_groups([args[0]] + (options[:remote] ? ["-r",options[:remote]] : []))
|
2702
2702
|
end
|
2703
2703
|
rescue RestClient::Exception => e
|
2704
2704
|
print_rest_exception(e, options)
|
@@ -313,7 +313,7 @@ module Morpheus::Cli::ProvisioningHelper
|
|
313
313
|
options[:options]['environment'] = options[:options]['instanceContext']
|
314
314
|
end
|
315
315
|
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'environment', 'fieldLabel' => 'Environment', 'type' => 'select', 'required' => false, 'selectOptions' => get_available_environments()}], options[:options])
|
316
|
-
payload['instance']['instanceContext'] = v_prompt['
|
316
|
+
payload['instance']['instanceContext'] = v_prompt['environment'] if !v_prompt['environment'].empty?
|
317
317
|
|
318
318
|
# Tags
|
319
319
|
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'tags', 'fieldLabel' => 'Tags', 'type' => 'text', 'required' => false}], options[:options])
|
data/lib/morpheus/cli/version.rb
CHANGED
@@ -58,7 +58,7 @@ class Morpheus::Cli::WikiCommand
|
|
58
58
|
subtitles += parse_list_subtitles(options)
|
59
59
|
print_h1 title, subtitles
|
60
60
|
if pages.empty?
|
61
|
-
print yellow,"No wiki pages found.",reset
|
61
|
+
print yellow,"No wiki pages found.",reset,"\n"
|
62
62
|
else
|
63
63
|
columns = [
|
64
64
|
{"ID" => lambda {|page| page['id'] } },
|
@@ -120,19 +120,23 @@ class Morpheus::Cli::WikiCommand
|
|
120
120
|
unless options[:quiet]
|
121
121
|
print_h1 "Wiki Page Details"
|
122
122
|
print cyan
|
123
|
-
|
124
|
-
print_description_list({
|
123
|
+
wiki_columns = {
|
125
124
|
"ID" => 'id',
|
126
125
|
"Name" => 'name',
|
127
126
|
"Category" => 'category',
|
128
|
-
"Ref Type" => 'refType',
|
129
|
-
"Ref ID" => 'refId',
|
127
|
+
# "Ref Type" => 'refType',
|
128
|
+
# "Ref ID" => 'refId',
|
129
|
+
"Reference" => lambda {|it| it['refType'] ? "#{it['refType']} (#{it['refId']})" : '' },
|
130
130
|
#"Owner" => lambda {|it| it['account'] ? it['account']['name'] : '' },
|
131
131
|
"Created" => lambda {|it| format_local_dt(it['dateCreated']) },
|
132
132
|
"Created By" => lambda {|it| it['createdBy'] ? it['createdBy']['username'] : '' },
|
133
133
|
"Updated" => lambda {|it| format_local_dt(it['lastUpdated']) },
|
134
134
|
"Updated By" => lambda {|it| it['updatedBy'] ? it['updatedBy']['username'] : '' }
|
135
|
-
}
|
135
|
+
}
|
136
|
+
if page['refType'].nil?
|
137
|
+
wiki_columns.delete("Reference")
|
138
|
+
end
|
139
|
+
print_description_list(wiki_columns, page)
|
136
140
|
print reset,"\n"
|
137
141
|
|
138
142
|
print_h2 "Page Content"
|
@@ -141,7 +145,7 @@ class Morpheus::Cli::WikiCommand
|
|
141
145
|
end
|
142
146
|
print reset,"\n"
|
143
147
|
if open_wiki_link
|
144
|
-
return view([page['id']])
|
148
|
+
return view([page['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
145
149
|
end
|
146
150
|
return 0
|
147
151
|
rescue RestClient::Exception => e
|
@@ -239,7 +243,7 @@ class Morpheus::Cli::WikiCommand
|
|
239
243
|
else
|
240
244
|
display_name = json_response['page'] ? json_response['page']['name'] : ''
|
241
245
|
print_green_success "Wiki page #{display_name} added"
|
242
|
-
get([json_response['page']['id']])
|
246
|
+
get([json_response['page']['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
243
247
|
end
|
244
248
|
return 0
|
245
249
|
rescue RestClient::Exception => e
|
@@ -304,7 +308,7 @@ class Morpheus::Cli::WikiCommand
|
|
304
308
|
else
|
305
309
|
display_name = json_response['page'] ? json_response['page']['name'] : ''
|
306
310
|
print_green_success "Wiki page #{display_name} updated"
|
307
|
-
get([json_response['page']['id']])
|
311
|
+
get([json_response['page']['id']] + (options[:remote] ? ["-r",options[:remote]] : []))
|
308
312
|
end
|
309
313
|
return 0
|
310
314
|
rescue RestClient::Exception => e
|
@@ -344,7 +348,7 @@ class Morpheus::Cli::WikiCommand
|
|
344
348
|
print "\n"
|
345
349
|
else
|
346
350
|
print_green_success "Wiki page #{page['name']} removed"
|
347
|
-
# list([])
|
351
|
+
# list([] + (options[:remote] ? ["-r",options[:remote]] : []))
|
348
352
|
end
|
349
353
|
return 0
|
350
354
|
rescue RestClient::Exception => e
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: morpheus-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Estes
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2019-
|
14
|
+
date: 2019-07-02 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|