morpheus-cli 3.6.9 → 3.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/morpheus/api/api_client.rb +0 -4
- data/lib/morpheus/api/deploy_interface.rb +12 -8
- data/lib/morpheus/cli.rb +0 -1
- data/lib/morpheus/cli/access_token_command.rb +3 -4
- data/lib/morpheus/cli/account_groups_command.rb +8 -3
- data/lib/morpheus/cli/apps.rb +10 -5
- data/lib/morpheus/cli/archives_command.rb +20 -6
- data/lib/morpheus/cli/boot_scripts_command.rb +5 -2
- data/lib/morpheus/cli/change_password_command.rb +1 -1
- data/lib/morpheus/cli/cli_command.rb +2 -4
- data/lib/morpheus/cli/cloud_datastores_command.rb +3 -2
- data/lib/morpheus/cli/commands/standard/alias_command.rb +10 -14
- data/lib/morpheus/cli/commands/standard/history_command.rb +0 -20
- data/lib/morpheus/cli/commands/standard/man_command.rb +8 -8
- data/lib/morpheus/cli/containers_command.rb +9 -1
- data/lib/morpheus/cli/credentials.rb +2 -1
- data/lib/morpheus/cli/cypher_command.rb +10 -2
- data/lib/morpheus/cli/dashboard_command.rb +1 -0
- data/lib/morpheus/cli/deployments.rb +5 -1
- data/lib/morpheus/cli/deploys.rb +26 -9
- data/lib/morpheus/cli/execute_schedules_command.rb +9 -1
- data/lib/morpheus/cli/execution_request_command.rb +3 -2
- data/lib/morpheus/cli/file_copy_request_command.rb +3 -2
- data/lib/morpheus/cli/hosts.rb +8 -6
- data/lib/morpheus/cli/image_builder_command.rb +14 -10
- data/lib/morpheus/cli/instance_types.rb +2 -1
- data/lib/morpheus/cli/instances.rb +9 -4
- data/lib/morpheus/cli/key_pairs.rb +33 -21
- data/lib/morpheus/cli/library_container_scripts_command.rb +5 -2
- data/lib/morpheus/cli/library_container_templates_command.rb +5 -2
- data/lib/morpheus/cli/library_container_types_command.rb +5 -3
- data/lib/morpheus/cli/library_instance_types_command.rb +6 -2
- data/lib/morpheus/cli/library_layouts_command.rb +5 -3
- data/lib/morpheus/cli/library_option_lists_command.rb +5 -1
- data/lib/morpheus/cli/library_option_types_command.rb +5 -0
- data/lib/morpheus/cli/library_upgrades_command.rb +5 -3
- data/lib/morpheus/cli/license.rb +3 -0
- data/lib/morpheus/cli/load_balancers.rb +10 -1
- data/lib/morpheus/cli/mixins/processes_helper.rb +10 -4
- data/lib/morpheus/cli/monitoring_apps_command.rb +32 -26
- data/lib/morpheus/cli/monitoring_checks_command.rb +35 -27
- data/lib/morpheus/cli/monitoring_contacts_command.rb +19 -16
- data/lib/morpheus/cli/monitoring_groups_command.rb +32 -26
- data/lib/morpheus/cli/monitoring_incidents_command.rb +39 -30
- data/lib/morpheus/cli/network_domains_command.rb +5 -2
- data/lib/morpheus/cli/network_groups_command.rb +5 -2
- data/lib/morpheus/cli/network_pool_servers_command.rb +5 -2
- data/lib/morpheus/cli/network_pools_command.rb +5 -2
- data/lib/morpheus/cli/network_proxies_command.rb +5 -2
- data/lib/morpheus/cli/network_services_command.rb +1 -0
- data/lib/morpheus/cli/networks_command.rb +5 -2
- data/lib/morpheus/cli/packages_command.rb +6 -3
- data/lib/morpheus/cli/policies_command.rb +17 -3
- data/lib/morpheus/cli/power_schedules_command.rb +9 -1
- data/lib/morpheus/cli/preseed_scripts_command.rb +5 -2
- data/lib/morpheus/cli/processes_command.rb +17 -6
- data/lib/morpheus/cli/recent_activity_command.rb +1 -0
- data/lib/morpheus/cli/remote.rb +1 -0
- data/lib/morpheus/cli/roles.rb +14 -5
- data/lib/morpheus/cli/security_group_rules.rb +8 -4
- data/lib/morpheus/cli/security_groups.rb +4 -0
- data/lib/morpheus/cli/shell.rb +13 -23
- data/lib/morpheus/cli/storage_providers_command.rb +12 -6
- data/lib/morpheus/cli/tasks.rb +6 -0
- data/lib/morpheus/cli/tenants_command.rb +13 -9
- data/lib/morpheus/cli/user_groups_command.rb +7 -1
- data/lib/morpheus/cli/user_settings_command.rb +7 -1
- data/lib/morpheus/cli/user_sources_command.rb +10 -8
- data/lib/morpheus/cli/users.rb +7 -2
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli/virtual_images.rb +8 -1
- data/lib/morpheus/cli/whoami.rb +34 -15
- data/lib/morpheus/cli/workflows.rb +5 -0
- data/lib/morpheus/formatters.rb +4 -0
- data/lib/morpheus/rest_client.rb +6 -1
- metadata +2 -4
- data/lib/morpheus/api/app_templates_interface.rb +0 -64
- data/lib/morpheus/cli/app_templates.rb +0 -2019
data/lib/morpheus/cli/tasks.rb
CHANGED
@@ -37,6 +37,7 @@ class Morpheus::Cli::Tasks
|
|
37
37
|
connect(options)
|
38
38
|
begin
|
39
39
|
params.merge!(parse_list_options(options))
|
40
|
+
@tasks_interface.setopts(options)
|
40
41
|
if options[:dry_run]
|
41
42
|
print_dry_run @tasks_interface.dry.get(params)
|
42
43
|
return
|
@@ -94,6 +95,7 @@ class Morpheus::Cli::Tasks
|
|
94
95
|
def _get(id, options)
|
95
96
|
task_name = id
|
96
97
|
begin
|
98
|
+
@tasks_interface.setopts(options)
|
97
99
|
if options[:dry_run]
|
98
100
|
if task_name.to_s =~ /\A\d{1,}\Z/
|
99
101
|
print_dry_run @tasks_interface.dry.get(task_name.to_i)
|
@@ -196,6 +198,7 @@ class Morpheus::Cli::Tasks
|
|
196
198
|
end
|
197
199
|
|
198
200
|
payload = {task: task_payload}
|
201
|
+
@tasks_interface.setopts(options)
|
199
202
|
if options[:dry_run]
|
200
203
|
print_dry_run @tasks_interface.dry.update(task['id'], payload)
|
201
204
|
return
|
@@ -226,6 +229,7 @@ class Morpheus::Cli::Tasks
|
|
226
229
|
optparse.parse!(args)
|
227
230
|
connect(options)
|
228
231
|
begin
|
232
|
+
@tasks_interface.setopts(options)
|
229
233
|
if options[:dry_run]
|
230
234
|
print_dry_run @tasks_interface.dry.task_types()
|
231
235
|
return
|
@@ -312,6 +316,7 @@ class Morpheus::Cli::Tasks
|
|
312
316
|
input_options = Morpheus::Cli::OptionTypes.prompt(task_type['optionTypes'],options[:options],@api_client, options[:params])
|
313
317
|
payload = {task: {name: task_name, taskOptions: input_options['taskOptions'], taskType: {code: task_type['code'], id: task_type['id']}}}
|
314
318
|
end
|
319
|
+
@tasks_interface.setopts(options)
|
315
320
|
if options[:dry_run]
|
316
321
|
print_dry_run @tasks_interface.dry.create(payload)
|
317
322
|
return
|
@@ -354,6 +359,7 @@ class Morpheus::Cli::Tasks
|
|
354
359
|
unless options[:yes] || Morpheus::Cli::OptionTypes.confirm("Are you sure you want to delete the task #{task['name']}?")
|
355
360
|
exit
|
356
361
|
end
|
362
|
+
@tasks_interface.setopts(options)
|
357
363
|
if options[:dry_run]
|
358
364
|
print_dry_run @tasks_interface.dry.destroy(task['id'], params)
|
359
365
|
return
|
@@ -43,13 +43,14 @@ class Morpheus::Cli::TenantsCommand
|
|
43
43
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
44
44
|
opts.banner = subcommand_usage()
|
45
45
|
build_common_options(opts, options, [:list, :query, :json, :remote, :dry_run])
|
46
|
-
opts.footer = "List tenants."
|
46
|
+
opts.footer = "List tenants (accounts)."
|
47
47
|
end
|
48
48
|
optparse.parse!(args)
|
49
49
|
connect(options)
|
50
50
|
begin
|
51
51
|
params = {}
|
52
52
|
params.merge!(parse_list_options(options))
|
53
|
+
@accounts_interface.setopts(options)
|
53
54
|
if options[:dry_run]
|
54
55
|
print_dry_run @accounts_interface.dry.list(params)
|
55
56
|
return
|
@@ -90,6 +91,7 @@ class Morpheus::Cli::TenantsCommand
|
|
90
91
|
begin
|
91
92
|
params = {}
|
92
93
|
params.merge!(parse_list_options(options))
|
94
|
+
@accounts_interface.setopts(options)
|
93
95
|
if options[:dry_run]
|
94
96
|
print_dry_run @accounts_interface.dry.list(params)
|
95
97
|
return
|
@@ -114,12 +116,12 @@ class Morpheus::Cli::TenantsCommand
|
|
114
116
|
build_common_options(opts, options, [:json, :remote, :dry_run])
|
115
117
|
end
|
116
118
|
optparse.parse!(args)
|
117
|
-
if args.count
|
118
|
-
|
119
|
-
exit 1
|
119
|
+
if args.count != 1
|
120
|
+
raise_command_error "wrong number of arguments, expected 1 and got (#{args.count}) #{args.join(', ')}\n#{optparse}"
|
120
121
|
end
|
121
122
|
connect(options)
|
122
123
|
begin
|
124
|
+
@accounts_interface.setopts(options)
|
123
125
|
if options[:dry_run]
|
124
126
|
if args[0].to_s =~ /\A\d{1,}\Z/
|
125
127
|
print_dry_run @accounts_interface.dry.get(args[0].to_i)
|
@@ -130,12 +132,11 @@ class Morpheus::Cli::TenantsCommand
|
|
130
132
|
end
|
131
133
|
account = find_account_by_name_or_id(args[0])
|
132
134
|
exit 1 if account.nil?
|
133
|
-
|
134
135
|
if options[:json]
|
135
136
|
print JSON.pretty_generate({account: account})
|
136
137
|
print "\n"
|
137
138
|
else
|
138
|
-
print_h1 "
|
139
|
+
print_h1 "Tenant Details"
|
139
140
|
print cyan
|
140
141
|
puts "ID: #{account['id']}"
|
141
142
|
puts "Name: #{account['name']}"
|
@@ -206,6 +207,7 @@ class Morpheus::Cli::TenantsCommand
|
|
206
207
|
puts as_json(payload, options)
|
207
208
|
return 0
|
208
209
|
end
|
210
|
+
@accounts_interface.setopts(options)
|
209
211
|
if options[:dry_run]
|
210
212
|
print_dry_run @accounts_interface.dry.create(payload)
|
211
213
|
return
|
@@ -215,7 +217,7 @@ class Morpheus::Cli::TenantsCommand
|
|
215
217
|
print JSON.pretty_generate(json_response)
|
216
218
|
print "\n"
|
217
219
|
else
|
218
|
-
print_green_success "
|
220
|
+
print_green_success "Tenant #{account_payload['name']} added"
|
219
221
|
get([account_payload["name"]])
|
220
222
|
end
|
221
223
|
|
@@ -271,6 +273,7 @@ class Morpheus::Cli::TenantsCommand
|
|
271
273
|
puts as_json(payload, options)
|
272
274
|
return 0
|
273
275
|
end
|
276
|
+
@accounts_interface.setopts(options)
|
274
277
|
if options[:dry_run]
|
275
278
|
print_dry_run @accounts_interface.dry.update(account['id'], payload)
|
276
279
|
return
|
@@ -282,7 +285,7 @@ class Morpheus::Cli::TenantsCommand
|
|
282
285
|
print "\n"
|
283
286
|
else
|
284
287
|
account_name = account_payload['name'] || account['name']
|
285
|
-
print_green_success "
|
288
|
+
print_green_success "Tenant #{account_name} updated"
|
286
289
|
get([account_name])
|
287
290
|
end
|
288
291
|
rescue RestClient::Exception => e
|
@@ -314,6 +317,7 @@ class Morpheus::Cli::TenantsCommand
|
|
314
317
|
puts as_json(payload, options)
|
315
318
|
return 0
|
316
319
|
end
|
320
|
+
@accounts_interface.setopts(options)
|
317
321
|
if options[:dry_run]
|
318
322
|
print_dry_run @accounts_interface.dry.destroy(account['id'])
|
319
323
|
return
|
@@ -323,7 +327,7 @@ class Morpheus::Cli::TenantsCommand
|
|
323
327
|
print JSON.pretty_generate(json_response)
|
324
328
|
print "\n"
|
325
329
|
else
|
326
|
-
print_green_success "
|
330
|
+
print_green_success "Tenant #{account['name']} removed"
|
327
331
|
end
|
328
332
|
|
329
333
|
rescue RestClient::Exception => e
|
@@ -32,6 +32,7 @@ class Morpheus::Cli::UserGroupsCommand
|
|
32
32
|
connect(options)
|
33
33
|
begin
|
34
34
|
params.merge!(parse_list_options(options))
|
35
|
+
@user_groups_interface.setopts(options)
|
35
36
|
if options[:dry_run]
|
36
37
|
print_dry_run @user_groups_interface.dry.list(nil, params)
|
37
38
|
return
|
@@ -91,6 +92,7 @@ class Morpheus::Cli::UserGroupsCommand
|
|
91
92
|
if user_group.nil?
|
92
93
|
return 1
|
93
94
|
end
|
95
|
+
@user_groups_interface.setopts(options)
|
94
96
|
if options[:dry_run]
|
95
97
|
print_dry_run @user_groups_interface.dry.get(nil, user_group['id'])
|
96
98
|
return
|
@@ -209,6 +211,7 @@ class Morpheus::Cli::UserGroupsCommand
|
|
209
211
|
# todo: prompt?
|
210
212
|
payload = {'userGroup' => params}
|
211
213
|
end
|
214
|
+
@user_groups_interface.setopts(options)
|
212
215
|
if options[:dry_run]
|
213
216
|
print_dry_run @user_groups_interface.dry.create(nil, payload)
|
214
217
|
return
|
@@ -289,6 +292,7 @@ class Morpheus::Cli::UserGroupsCommand
|
|
289
292
|
# todo: prompt?
|
290
293
|
payload = {'userGroup' => params}
|
291
294
|
end
|
295
|
+
@user_groups_interface.setopts(options)
|
292
296
|
if options[:dry_run]
|
293
297
|
print_dry_run @user_groups_interface.dry.update(nil, user_group["id"], payload)
|
294
298
|
return
|
@@ -350,6 +354,7 @@ class Morpheus::Cli::UserGroupsCommand
|
|
350
354
|
user_group_payload['users'] = new_user_ids
|
351
355
|
payload = {'userGroup' => user_group_payload}
|
352
356
|
end
|
357
|
+
@user_groups_interface.setopts(options)
|
353
358
|
if options[:dry_run]
|
354
359
|
print_dry_run @user_groups_interface.dry.update(nil, user_group["id"], payload)
|
355
360
|
return 0
|
@@ -414,6 +419,7 @@ class Morpheus::Cli::UserGroupsCommand
|
|
414
419
|
user_group_payload['users'] = new_user_ids
|
415
420
|
payload = {'userGroup' => user_group_payload}
|
416
421
|
end
|
422
|
+
@user_groups_interface.setopts(options)
|
417
423
|
if options[:dry_run]
|
418
424
|
print_dry_run @user_groups_interface.dry.update(nil, user_group["id"], payload)
|
419
425
|
return 0
|
@@ -465,7 +471,7 @@ class Morpheus::Cli::UserGroupsCommand
|
|
465
471
|
# }
|
466
472
|
# payload['userGroup'].merge!(user_group)
|
467
473
|
payload = params
|
468
|
-
|
474
|
+
@user_groups_interface.setopts(options)
|
469
475
|
if options[:dry_run]
|
470
476
|
print_dry_run @user_groups_interface.dry.destroy(nil, user_group["id"])
|
471
477
|
return
|
@@ -41,6 +41,7 @@ class Morpheus::Cli::UserSettingsCommand
|
|
41
41
|
|
42
42
|
begin
|
43
43
|
params.merge!(parse_list_options(options))
|
44
|
+
@user_settings_interface.setopts(options)
|
44
45
|
if options[:dry_run]
|
45
46
|
print_dry_run @user_settings_interface.dry.get(params)
|
46
47
|
return
|
@@ -129,7 +130,7 @@ class Morpheus::Cli::UserSettingsCommand
|
|
129
130
|
payload['user'] ||= {}
|
130
131
|
payload['user'].deep_merge!(options[:options].reject {|k,v| k.is_a?(Symbol) })
|
131
132
|
end
|
132
|
-
|
133
|
+
@user_settings_interface.setopts(options)
|
133
134
|
if options[:dry_run]
|
134
135
|
print_dry_run @user_settings_interface.dry.update(params, payload)
|
135
136
|
return
|
@@ -179,6 +180,7 @@ class Morpheus::Cli::UserSettingsCommand
|
|
179
180
|
end
|
180
181
|
|
181
182
|
begin
|
183
|
+
@user_settings_interface.setopts(options)
|
182
184
|
if options[:dry_run]
|
183
185
|
print_dry_run @user_settings_interface.dry.update_avatar(image_file, params)
|
184
186
|
return
|
@@ -217,6 +219,7 @@ class Morpheus::Cli::UserSettingsCommand
|
|
217
219
|
end
|
218
220
|
|
219
221
|
begin
|
222
|
+
@user_settings_interface.setopts(options)
|
220
223
|
if options[:dry_run]
|
221
224
|
print_dry_run @user_settings_interface.dry.remove_avatar(params)
|
222
225
|
return
|
@@ -302,6 +305,7 @@ class Morpheus::Cli::UserSettingsCommand
|
|
302
305
|
params['clientId'] = args[0]
|
303
306
|
begin
|
304
307
|
payload = {}
|
308
|
+
@user_settings_interface.setopts(options)
|
305
309
|
if options[:dry_run]
|
306
310
|
print_dry_run @user_settings_interface.dry.regenerate_access_token(params, payload)
|
307
311
|
return
|
@@ -350,6 +354,7 @@ class Morpheus::Cli::UserSettingsCommand
|
|
350
354
|
params['clientId'] = args[0]
|
351
355
|
begin
|
352
356
|
payload = {}
|
357
|
+
@user_settings_interface.setopts(options)
|
353
358
|
if options[:dry_run]
|
354
359
|
print_dry_run @user_settings_interface.dry.clear_access_token(params, payload)
|
355
360
|
return
|
@@ -397,6 +402,7 @@ class Morpheus::Cli::UserSettingsCommand
|
|
397
402
|
|
398
403
|
begin
|
399
404
|
params.merge!(parse_list_options(options))
|
405
|
+
@user_settings_interface.setopts(options)
|
400
406
|
if options[:dry_run]
|
401
407
|
print_dry_run @user_settings_interface.dry.available_clients(params)
|
402
408
|
return
|
@@ -63,7 +63,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
63
63
|
end
|
64
64
|
|
65
65
|
params.merge!(parse_list_options(options))
|
66
|
-
|
66
|
+
@user_sources_interface.setopts(options)
|
67
67
|
if options[:dry_run]
|
68
68
|
print_dry_run @user_sources_interface.dry.list(account_id, params)
|
69
69
|
return
|
@@ -130,6 +130,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
130
130
|
# account_id = account['id']
|
131
131
|
# user_source_id = args[1]
|
132
132
|
begin
|
133
|
+
@user_sources_interface.setopts(options)
|
133
134
|
if options[:dry_run]
|
134
135
|
if user_source_id.to_s =~ /\A\d{1,}\Z/
|
135
136
|
print_dry_run @user_sources_interface.dry.get(account_id, user_source_id.to_i)
|
@@ -352,7 +353,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
352
353
|
|
353
354
|
|
354
355
|
end
|
355
|
-
|
356
|
+
@user_sources_interface.setopts(options)
|
356
357
|
if options[:dry_run]
|
357
358
|
print_dry_run @user_sources_interface.dry.create(account_id, payload)
|
358
359
|
return
|
@@ -447,7 +448,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
447
448
|
payload['userSource'].deep_merge!(options[:options].reject {|k,v| k.is_a?(Symbol) }) if options[:options]
|
448
449
|
|
449
450
|
end
|
450
|
-
|
451
|
+
@user_sources_interface.setopts(options)
|
451
452
|
if options[:dry_run]
|
452
453
|
print_dry_run @user_sources_interface.dry.update(nil, user_source['id'], payload)
|
453
454
|
return
|
@@ -497,7 +498,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
497
498
|
# support old -O options
|
498
499
|
payload.deep_merge!(options[:options].reject {|k,v| k.is_a?(Symbol) }) if options[:options]
|
499
500
|
end
|
500
|
-
|
501
|
+
@user_sources_interface.setopts(options)
|
501
502
|
if options[:dry_run]
|
502
503
|
print_dry_run @user_sources_interface.dry.activate(nil, user_source['id'], payload)
|
503
504
|
return
|
@@ -547,7 +548,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
547
548
|
# support old -O options
|
548
549
|
payload.deep_merge!(options[:options].reject {|k,v| k.is_a?(Symbol) }) if options[:options]
|
549
550
|
end
|
550
|
-
|
551
|
+
@user_sources_interface.setopts(options)
|
551
552
|
if options[:dry_run]
|
552
553
|
print_dry_run @user_sources_interface.dry.deactivate(nil, user_source['id'], payload)
|
553
554
|
return
|
@@ -599,7 +600,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
599
600
|
# support old -O options
|
600
601
|
payload.deep_merge!(options[:options].reject {|k,v| k.is_a?(Symbol) }) if options[:options]
|
601
602
|
end
|
602
|
-
|
603
|
+
@user_sources_interface.setopts(options)
|
603
604
|
if options[:dry_run]
|
604
605
|
print_dry_run @user_sources_interface.dry.update_subdomain(nil, user_source['id'], payload)
|
605
606
|
return
|
@@ -641,6 +642,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
641
642
|
unless Morpheus::Cli::OptionTypes.confirm("Are you sure you want to delete the user source #{user_source['name']}?", options)
|
642
643
|
exit
|
643
644
|
end
|
645
|
+
@user_sources_interface.setopts(options)
|
644
646
|
if options[:dry_run]
|
645
647
|
print_dry_run @user_sources_interface.dry.destroy(nil, user_source['id'])
|
646
648
|
return
|
@@ -682,7 +684,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
682
684
|
begin
|
683
685
|
# construct payload
|
684
686
|
params.merge!(parse_list_options(options))
|
685
|
-
|
687
|
+
@user_sources_interface.setopts(options)
|
686
688
|
if options[:dry_run]
|
687
689
|
print_dry_run @user_sources_interface.dry.list_types(params)
|
688
690
|
return
|
@@ -749,7 +751,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
749
751
|
# end
|
750
752
|
|
751
753
|
# construct payload
|
752
|
-
|
754
|
+
@user_sources_interface.setopts(options)
|
753
755
|
if options[:dry_run]
|
754
756
|
print_dry_run @user_sources_interface.dry.list_types(user_source_type_id, params)
|
755
757
|
return
|
data/lib/morpheus/cli/users.rb
CHANGED
@@ -47,6 +47,7 @@ class Morpheus::Cli::Users
|
|
47
47
|
|
48
48
|
params = {}
|
49
49
|
params.merge!(parse_list_options(options))
|
50
|
+
@users_interface.setopts(options)
|
50
51
|
if options[:dry_run]
|
51
52
|
print_dry_run @users_interface.dry.list(account_id, params)
|
52
53
|
return
|
@@ -98,6 +99,7 @@ class Morpheus::Cli::Users
|
|
98
99
|
account_id = account ? account['id'] : nil
|
99
100
|
params = {}
|
100
101
|
params.merge!(parse_list_options(options))
|
102
|
+
@users_interface.setopts(options)
|
101
103
|
if options[:dry_run]
|
102
104
|
print_dry_run @users_interface.dry.list(account_id, params)
|
103
105
|
return
|
@@ -152,6 +154,7 @@ class Morpheus::Cli::Users
|
|
152
154
|
begin
|
153
155
|
account = find_account_from_options(options)
|
154
156
|
account_id = account ? account['id'] : nil
|
157
|
+
@users_interface.setopts(options)
|
155
158
|
if options[:dry_run]
|
156
159
|
if args[0].to_s =~ /\A\d{1,}\Z/
|
157
160
|
print_dry_run @users_interface.dry.get(account_id, args[0].to_i)
|
@@ -280,6 +283,7 @@ class Morpheus::Cli::Users
|
|
280
283
|
puts as_json(payload, options)
|
281
284
|
return 0
|
282
285
|
end
|
286
|
+
@users_interface.setopts(options)
|
283
287
|
if options[:dry_run]
|
284
288
|
print_dry_run @users_interface.dry.create(account_id, payload)
|
285
289
|
return
|
@@ -370,7 +374,7 @@ class Morpheus::Cli::Users
|
|
370
374
|
|
371
375
|
payload = {'user' => params}
|
372
376
|
end
|
373
|
-
|
377
|
+
@users_interface.setopts(options)
|
374
378
|
if options[:dry_run]
|
375
379
|
print_dry_run @users_interface.dry.update(account_id, user['id'], payload)
|
376
380
|
return
|
@@ -452,7 +456,7 @@ class Morpheus::Cli::Users
|
|
452
456
|
'password' => new_password
|
453
457
|
}
|
454
458
|
}
|
455
|
-
|
459
|
+
@users_interface.setopts(options)
|
456
460
|
if options[:dry_run]
|
457
461
|
print_dry_run @users_interface.dry.update(account_id, user['id'], payload)
|
458
462
|
return
|
@@ -496,6 +500,7 @@ class Morpheus::Cli::Users
|
|
496
500
|
unless options[:yes] || Morpheus::Cli::OptionTypes.confirm("Are you sure you want to delete the user #{user['username']}?")
|
497
501
|
exit
|
498
502
|
end
|
503
|
+
@users_interface.setopts(options)
|
499
504
|
if options[:dry_run]
|
500
505
|
print_dry_run @users_interface.dry.destroy(account_id, user['id'])
|
501
506
|
return
|
data/lib/morpheus/cli/version.rb
CHANGED
@@ -57,6 +57,7 @@ class Morpheus::Cli::VirtualImages
|
|
57
57
|
if options[:filterType]
|
58
58
|
params[:filterType] = options[:filterType]
|
59
59
|
end
|
60
|
+
@virtual_images_interface.setopts(options)
|
60
61
|
if options[:dry_run]
|
61
62
|
print_dry_run @virtual_images_interface.dry.get(params)
|
62
63
|
return
|
@@ -131,6 +132,7 @@ class Morpheus::Cli::VirtualImages
|
|
131
132
|
image_name = args[0]
|
132
133
|
connect(options)
|
133
134
|
begin
|
135
|
+
@virtual_images_interface.setopts(options)
|
134
136
|
if options[:dry_run]
|
135
137
|
if args[0].to_s =~ /\A\d{1,}\Z/
|
136
138
|
print_dry_run @virtual_images_interface.dry.get(args[0].to_i)
|
@@ -264,6 +266,7 @@ class Morpheus::Cli::VirtualImages
|
|
264
266
|
end
|
265
267
|
payload = {'virtualImage' => params}
|
266
268
|
end
|
269
|
+
@virtual_images_interface.setopts(options)
|
267
270
|
if options[:dry_run]
|
268
271
|
print_dry_run @virtual_images_interface.dry.update(image['id'], payload)
|
269
272
|
return
|
@@ -293,6 +296,7 @@ class Morpheus::Cli::VirtualImages
|
|
293
296
|
connect(options)
|
294
297
|
begin
|
295
298
|
params = {}
|
299
|
+
@virtual_images_interface.setopts(options)
|
296
300
|
if options[:dry_run]
|
297
301
|
print_dry_run @virtual_images_interface.dry.virtual_image_types(params)
|
298
302
|
return
|
@@ -399,7 +403,7 @@ class Morpheus::Cli::VirtualImages
|
|
399
403
|
virtual_image_payload['accounts'] = tenants_list
|
400
404
|
end
|
401
405
|
payload = {virtualImage: virtual_image_payload}
|
402
|
-
|
406
|
+
@virtual_images_interface.setopts(options)
|
403
407
|
if options[:dry_run]
|
404
408
|
print_dry_run @virtual_images_interface.dry.create(payload)
|
405
409
|
if file_url
|
@@ -497,6 +501,7 @@ class Morpheus::Cli::VirtualImages
|
|
497
501
|
begin
|
498
502
|
image = find_virtual_image_by_name_or_id(image_name)
|
499
503
|
return 1 if image.nil?
|
504
|
+
@virtual_images_interface.setopts(options)
|
500
505
|
if file_url
|
501
506
|
if options[:dry_run]
|
502
507
|
print_dry_run @virtual_images_interface.dry.upload_by_url(image['id'], file_url, file_name)
|
@@ -556,6 +561,7 @@ class Morpheus::Cli::VirtualImages
|
|
556
561
|
unless options[:yes] || Morpheus::Cli::OptionTypes.confirm("Are you sure you want to delete the virtual image filename #{filename}?")
|
557
562
|
exit
|
558
563
|
end
|
564
|
+
@virtual_images_interface.setopts(options)
|
559
565
|
if options[:dry_run]
|
560
566
|
print_dry_run @virtual_images_interface.dry.destroy_file(image['id'], filename)
|
561
567
|
return
|
@@ -591,6 +597,7 @@ class Morpheus::Cli::VirtualImages
|
|
591
597
|
unless options[:yes] || Morpheus::Cli::OptionTypes.confirm("Are you sure you want to delete the virtual image #{image['name']}?")
|
592
598
|
exit
|
593
599
|
end
|
600
|
+
@virtual_images_interface.setopts(options)
|
594
601
|
if options[:dry_run]
|
595
602
|
print_dry_run @virtual_images_interface.dry.destroy(image['id'])
|
596
603
|
return
|