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
@@ -59,7 +59,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
59
59
|
options = {}
|
60
60
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
61
61
|
opts.banner = subcommand_usage()
|
62
|
-
build_common_options(opts, options, [:list, :json, :dry_run])
|
62
|
+
build_common_options(opts, options, [:list, :json, :dry_run, :remote])
|
63
63
|
end
|
64
64
|
optparse.parse!(args)
|
65
65
|
connect(options)
|
@@ -68,7 +68,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
68
68
|
[:phrase, :offset, :max, :sort, :direction].each do |k|
|
69
69
|
params[k] = options[k] unless options[k].nil?
|
70
70
|
end
|
71
|
-
|
71
|
+
@image_builds_interface.setopts(options)
|
72
72
|
if options[:dry_run]
|
73
73
|
print_dry_run @image_builds_interface.dry.list(params)
|
74
74
|
return
|
@@ -140,7 +140,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
140
140
|
options = {}
|
141
141
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
142
142
|
opts.banner = subcommand_usage("[image-build]")
|
143
|
-
build_common_options(opts, options, [:json, :dry_run])
|
143
|
+
build_common_options(opts, options, [:json, :dry_run, :remote])
|
144
144
|
end
|
145
145
|
optparse.parse!(args)
|
146
146
|
if args.count < 1
|
@@ -150,6 +150,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
150
150
|
end
|
151
151
|
connect(options)
|
152
152
|
begin
|
153
|
+
@image_builds_interface.setopts(options)
|
153
154
|
if options[:dry_run]
|
154
155
|
if args[0].to_s =~ /\A\d{1,}\Z/
|
155
156
|
print_dry_run @image_builds_interface.dry.get(args[0].to_i)
|
@@ -342,7 +343,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
342
343
|
opts.on('--keepResults VALUE', String, "Keep only the most recent builds. Older executions will be deleted along with their associated Virtual Images. The value 0 disables this functionality.") do |val|
|
343
344
|
options['keepResults'] = val.to_i
|
344
345
|
end
|
345
|
-
build_common_options(opts, options, [:options, :payload, :json, :dry_run, :quiet])
|
346
|
+
build_common_options(opts, options, [:options, :payload, :json, :dry_run, :remote, :quiet])
|
346
347
|
end
|
347
348
|
optparse.parse!(args)
|
348
349
|
if args.count > 1
|
@@ -373,7 +374,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
373
374
|
return 1 if !image_build_payload
|
374
375
|
payload = {'imageBuild' => image_build_payload}
|
375
376
|
end
|
376
|
-
|
377
|
+
@image_builds_interface.setopts(options)
|
377
378
|
if options[:dry_run]
|
378
379
|
print_dry_run @image_builds_interface.dry.create(payload)
|
379
380
|
return
|
@@ -470,7 +471,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
470
471
|
# 0 disables it
|
471
472
|
# options['deleteOldResults'] = (options['keepResults'] > 0)
|
472
473
|
end
|
473
|
-
build_common_options(opts, options, [:options, :payload, :json, :dry_run, :quiet])
|
474
|
+
build_common_options(opts, options, [:options, :payload, :json, :dry_run, :remote, :quiet])
|
474
475
|
end
|
475
476
|
optparse.parse!(args)
|
476
477
|
if args.count != 1
|
@@ -494,7 +495,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
494
495
|
return 1 if !image_build_payload
|
495
496
|
payload = {'imageBuild' => image_build_payload}
|
496
497
|
end
|
497
|
-
|
498
|
+
@image_builds_interface.setopts(options)
|
498
499
|
if options[:dry_run]
|
499
500
|
print_dry_run @image_builds_interface.dry.update(image_build["id"], payload)
|
500
501
|
return
|
@@ -522,7 +523,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
522
523
|
opts.on( '-K', '--keep-virtual-images', "Preserve associated virtual images" ) do
|
523
524
|
query_params['keepVirtualImages'] = 'on'
|
524
525
|
end
|
525
|
-
build_common_options(opts, options, [:account, :auto_confirm, :json, :dry_run])
|
526
|
+
build_common_options(opts, options, [:account, :auto_confirm, :json, :dry_run, :remote])
|
526
527
|
end
|
527
528
|
optparse.parse!(args)
|
528
529
|
|
@@ -544,6 +545,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
544
545
|
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'keepVirtualImages', 'type' => 'checkbox', 'fieldLabel' => 'Keep Virtual Images?', 'required' => false, 'defaultValue' => false, 'description' => 'Preserve associated virtual images. By default, they are deleted as well.'}],options,@api_client,{})
|
545
546
|
query_params['keepVirtualImages'] = v_prompt['keepVirtualImages']
|
546
547
|
end
|
548
|
+
@image_builds_interface.setopts(options)
|
547
549
|
if options[:dry_run]
|
548
550
|
print_dry_run @image_builds_interface.dry.destroy(image_build['id'], query_params)
|
549
551
|
return 0
|
@@ -568,7 +570,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
568
570
|
query_params = {}
|
569
571
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
570
572
|
opts.banner = subcommand_usage("[image-build]")
|
571
|
-
build_common_options(opts, options, [:account, :auto_confirm, :json, :dry_run])
|
573
|
+
build_common_options(opts, options, [:account, :auto_confirm, :json, :dry_run, :remote])
|
572
574
|
end
|
573
575
|
optparse.parse!(args)
|
574
576
|
|
@@ -586,6 +588,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
586
588
|
unless options[:yes] || Morpheus::Cli::OptionTypes.confirm("Are you sure you want to run the image build: #{image_build['name']}?")
|
587
589
|
return 9, "aborted command"
|
588
590
|
end
|
591
|
+
@image_builds_interface.setopts(options)
|
589
592
|
if options[:dry_run]
|
590
593
|
print_dry_run @image_builds_interface.dry.run(image_build['id'], query_params)
|
591
594
|
return 0
|
@@ -609,7 +612,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
609
612
|
options = {}
|
610
613
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
611
614
|
opts.banner = subcommand_usage("[image-build]")
|
612
|
-
build_common_options(opts, options, [:list, :json, :dry_run])
|
615
|
+
build_common_options(opts, options, [:list, :json, :dry_run, :remote])
|
613
616
|
opts.footer = "List executions for an image build."
|
614
617
|
opts.footer = "Display a list of executions for an image build.\n"
|
615
618
|
"[image-build] is the name or id of an image build."
|
@@ -629,6 +632,7 @@ class Morpheus::Cli::ImageBuilderCommand
|
|
629
632
|
[:phrase, :offset, :max, :sort, :direction].each do |k|
|
630
633
|
params[k] = options[k] unless options[k].nil?
|
631
634
|
end
|
635
|
+
@image_builds_interface.setopts(options)
|
632
636
|
if options[:dry_run]
|
633
637
|
print_dry_run @image_builds_interface.dry.list_executions(image_build['id'], params)
|
634
638
|
return 0
|
@@ -52,7 +52,7 @@ class Morpheus::Cli::InstanceTypes
|
|
52
52
|
begin
|
53
53
|
# construct payload
|
54
54
|
params.merge!(parse_list_options(options))
|
55
|
-
|
55
|
+
@instance_types_interface.setopts(options)
|
56
56
|
if options[:dry_run]
|
57
57
|
print_dry_run @instance_types_interface.dry.list(params)
|
58
58
|
return
|
@@ -119,6 +119,7 @@ class Morpheus::Cli::InstanceTypes
|
|
119
119
|
if instance_type.nil?
|
120
120
|
return 1
|
121
121
|
end
|
122
|
+
@instance_types_interface.setopts(options)
|
122
123
|
if options[:dry_run]
|
123
124
|
print_dry_run @instance_types_interface.dry.get(instance_type['id'])
|
124
125
|
return
|
@@ -2776,6 +2776,11 @@ class Morpheus::Cli::Instances
|
|
2776
2776
|
opts.on( nil, '--output', "Display process output." ) do
|
2777
2777
|
options[:show_output] = true
|
2778
2778
|
end
|
2779
|
+
opts.on(nil, '--details', "Display more details. Shows everything, untruncated." ) do
|
2780
|
+
options[:show_events] = true
|
2781
|
+
options[:show_output] = true
|
2782
|
+
options[:details] = true
|
2783
|
+
end
|
2779
2784
|
opts.on('--process-id ID', String, "Display details about a specfic process only." ) do |val|
|
2780
2785
|
options[:process_id] = val
|
2781
2786
|
end
|
@@ -2849,8 +2854,8 @@ class Morpheus::Cli::Instances
|
|
2849
2854
|
startDate: format_local_dt(process['startDate']),
|
2850
2855
|
duration: format_process_duration(process),
|
2851
2856
|
status: format_process_status(process),
|
2852
|
-
error: format_process_error(process),
|
2853
|
-
output: format_process_output(process)
|
2857
|
+
error: format_process_error(process, options[:details] ? nil : 20),
|
2858
|
+
output: format_process_output(process, options[:details] ? nil : 20)
|
2854
2859
|
}
|
2855
2860
|
history_records << row
|
2856
2861
|
process_events = process['events'] || process['processEvents']
|
@@ -2868,8 +2873,8 @@ class Morpheus::Cli::Instances
|
|
2868
2873
|
startDate: format_local_dt(process_event['startDate']),
|
2869
2874
|
duration: format_process_duration(process_event),
|
2870
2875
|
status: format_process_status(process_event),
|
2871
|
-
error: format_process_error(process_event),
|
2872
|
-
output: format_process_output(process_event)
|
2876
|
+
error: format_process_error(process_event, options[:details] ? nil : 20),
|
2877
|
+
output: format_process_output(process_event, options[:details] ? nil : 20)
|
2873
2878
|
}
|
2874
2879
|
history_records << event_row
|
2875
2880
|
end
|
@@ -31,7 +31,7 @@ class Morpheus::Cli::KeyPairs
|
|
31
31
|
params = {}
|
32
32
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
33
33
|
opts.banner = subcommand_usage()
|
34
|
-
build_common_options(opts, options, [:account, :list, :json])
|
34
|
+
build_common_options(opts, options, [:account, :list, :query, :json, :yaml, :csv, :fields, :dry_run, :remote])
|
35
35
|
end
|
36
36
|
optparse.parse!(args)
|
37
37
|
connect(options)
|
@@ -40,24 +40,23 @@ class Morpheus::Cli::KeyPairs
|
|
40
40
|
account = find_account_from_options(options)
|
41
41
|
account_id = account ? account['id'] : nil
|
42
42
|
|
43
|
-
|
44
|
-
|
43
|
+
params.merge!(parse_list_options(options))
|
44
|
+
@key_pairs_interface.setopts(options)
|
45
|
+
if options[:dry_run]
|
46
|
+
print_dry_run @key_pairs_interface.dry.list(account_id, params)
|
47
|
+
return 0
|
45
48
|
end
|
46
|
-
|
47
49
|
json_response = @key_pairs_interface.list(account_id, params)
|
50
|
+
render_result = render_with_format(json_response, options, 'keyPairs')
|
51
|
+
return 0 if render_result
|
48
52
|
key_pairs = json_response['keyPairs']
|
49
|
-
|
50
|
-
print JSON.pretty_generate(json_response)
|
51
|
-
print "\n"
|
52
|
-
else
|
53
|
+
unless options[:quiet]
|
53
54
|
title = "Morpheus Key Pairs"
|
54
55
|
subtitles = []
|
55
56
|
if account
|
56
57
|
subtitles << "Account: #{account['name']}".strip
|
57
58
|
end
|
58
|
-
|
59
|
-
subtitles << "Search: #{params[:phrase]}".strip
|
60
|
-
end
|
59
|
+
subtitles += parse_list_subtitles(options)
|
61
60
|
print_h1 title, subtitles
|
62
61
|
if key_pairs.empty?
|
63
62
|
puts yellow,"No key pairs found.",reset
|
@@ -67,6 +66,7 @@ class Morpheus::Cli::KeyPairs
|
|
67
66
|
end
|
68
67
|
print reset,"\n"
|
69
68
|
end
|
69
|
+
return 0
|
70
70
|
rescue RestClient::Exception => e
|
71
71
|
print_rest_exception(e, options)
|
72
72
|
exit 1
|
@@ -78,7 +78,7 @@ class Morpheus::Cli::KeyPairs
|
|
78
78
|
params = {}
|
79
79
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
80
80
|
opts.banner = subcommand_usage("[name]")
|
81
|
-
build_common_options(opts, options, [:account, :json])
|
81
|
+
build_common_options(opts, options, [:account, :query, :json, :yaml, :csv, :fields, :dry_run, :remote])
|
82
82
|
end
|
83
83
|
optparse.parse!(args)
|
84
84
|
|
@@ -92,13 +92,22 @@ class Morpheus::Cli::KeyPairs
|
|
92
92
|
account = find_account_from_options(options)
|
93
93
|
account_id = account ? account['id'] : nil
|
94
94
|
|
95
|
+
@key_pairs_interface.setopts(options)
|
96
|
+
if options[:dry_run]
|
97
|
+
if val.to_s =~ /\A\d{1,}\Z/
|
98
|
+
print_dry_run @key_pairs_interface.dry.get(account_id, id.to_i)
|
99
|
+
else
|
100
|
+
print_dry_run @key_pairs_interface.dry.list(account_id, {name: name.to_s})
|
101
|
+
end
|
102
|
+
return 0
|
103
|
+
end
|
95
104
|
key_pair = find_key_pair_by_name_or_id(account_id, args[0])
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
105
|
+
return 1 if key_pair.nil?
|
106
|
+
json_response = {'keyPair' => key_pair}
|
107
|
+
render_result = render_with_format(json_response, options, 'keyPair')
|
108
|
+
return 0 if render_result
|
109
|
+
|
110
|
+
unless options[:quiet]
|
102
111
|
print_h1 "Key Pair Details"
|
103
112
|
print cyan
|
104
113
|
if account
|
@@ -176,7 +185,7 @@ class Morpheus::Cli::KeyPairs
|
|
176
185
|
options[:options]['privateKey'] = options['privateKey']
|
177
186
|
end
|
178
187
|
|
179
|
-
build_common_options(opts, options, [:account, :options, :json, :dry_run])
|
188
|
+
build_common_options(opts, options, [:account, :options, :json, :dry_run, :remote])
|
180
189
|
end
|
181
190
|
optparse.parse!(args)
|
182
191
|
# if args.count < 1
|
@@ -209,6 +218,7 @@ class Morpheus::Cli::KeyPairs
|
|
209
218
|
|
210
219
|
key_pair_payload = params.select {|k,v| ['name','publicKey', 'privateKey', 'passphrase'].include?(k) }
|
211
220
|
payload = {keyPair: key_pair_payload}
|
221
|
+
@key_pairs_interface.setopts(options)
|
212
222
|
if options[:dry_run]
|
213
223
|
print_dry_run @key_pairs_interface.dry.create(account_id, payload)
|
214
224
|
return
|
@@ -232,7 +242,7 @@ class Morpheus::Cli::KeyPairs
|
|
232
242
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
233
243
|
opts.banner = subcommand_usage("[name] [options]")
|
234
244
|
build_option_type_options(opts, options, update_key_pair_option_types)
|
235
|
-
build_common_options(opts, options, [:account, :options, :json, :dry_run])
|
245
|
+
build_common_options(opts, options, [:account, :options, :json, :dry_run, :remote])
|
236
246
|
end
|
237
247
|
optparse.parse!(args)
|
238
248
|
|
@@ -262,6 +272,7 @@ class Morpheus::Cli::KeyPairs
|
|
262
272
|
|
263
273
|
key_pair_payload = params.select {|k,v| ['name'].include?(k) }
|
264
274
|
payload = {keyPair: key_pair_payload}
|
275
|
+
@key_pairs_interface.setopts(options)
|
265
276
|
if options[:dry_run]
|
266
277
|
print_dry_run @key_pairs_interface.dry.update(account_id, key_pair['id'], payload)
|
267
278
|
return
|
@@ -284,7 +295,7 @@ class Morpheus::Cli::KeyPairs
|
|
284
295
|
options = {}
|
285
296
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
286
297
|
opts.banner = subcommand_usage("[name]")
|
287
|
-
build_common_options(opts, options, [:account, :auto_confirm, :json, :dry_run])
|
298
|
+
build_common_options(opts, options, [:account, :auto_confirm, :json, :dry_run, :remote])
|
288
299
|
end
|
289
300
|
optparse.parse!(args)
|
290
301
|
|
@@ -305,6 +316,7 @@ class Morpheus::Cli::KeyPairs
|
|
305
316
|
unless options[:yes] || Morpheus::Cli::OptionTypes.confirm("Are you sure you want to delete the key pair #{key_pair['name']}?")
|
306
317
|
exit
|
307
318
|
end
|
319
|
+
@key_pairs_interface.setopts(options)
|
308
320
|
if options[:dry_run]
|
309
321
|
print_dry_run @key_pairs_interface.dry.destroy(account_id, key_pair['id'])
|
310
322
|
return
|
@@ -34,7 +34,7 @@ class Morpheus::Cli::LibraryContainerScriptsCommand
|
|
34
34
|
begin
|
35
35
|
# construct payload
|
36
36
|
params.merge!(parse_list_options(options))
|
37
|
-
|
37
|
+
@container_scripts_interface.setopts(options)
|
38
38
|
if options[:dry_run]
|
39
39
|
print_dry_run @container_scripts_interface.dry.list(params)
|
40
40
|
return
|
@@ -95,6 +95,7 @@ class Morpheus::Cli::LibraryContainerScriptsCommand
|
|
95
95
|
if container_script.nil?
|
96
96
|
return 1
|
97
97
|
end
|
98
|
+
@container_scripts_interface.setopts(options)
|
98
99
|
if options[:dry_run]
|
99
100
|
print_dry_run @container_scripts_interface.dry.get(container_script['id'])
|
100
101
|
return
|
@@ -204,6 +205,7 @@ class Morpheus::Cli::LibraryContainerScriptsCommand
|
|
204
205
|
# todo: prompt?
|
205
206
|
payload = {'containerScript' => params}
|
206
207
|
end
|
208
|
+
@container_scripts_interface.setopts(options)
|
207
209
|
if options[:dry_run]
|
208
210
|
print_dry_run @container_scripts_interface.dry.create(payload)
|
209
211
|
return
|
@@ -287,6 +289,7 @@ class Morpheus::Cli::LibraryContainerScriptsCommand
|
|
287
289
|
params.deep_merge!(options[:options].reject {|k,v| k.is_a?(Symbol) }) if options[:options]
|
288
290
|
payload = {'containerScript' => params}
|
289
291
|
end
|
292
|
+
@container_scripts_interface.setopts(options)
|
290
293
|
if options[:dry_run]
|
291
294
|
print_dry_run @container_scripts_interface.dry.update(container_script["id"], payload)
|
292
295
|
return
|
@@ -334,7 +337,7 @@ class Morpheus::Cli::LibraryContainerScriptsCommand
|
|
334
337
|
# }
|
335
338
|
# payload['containerScript'].merge!(container_script)
|
336
339
|
payload = params
|
337
|
-
|
340
|
+
@container_scripts_interface.setopts(options)
|
338
341
|
if options[:dry_run]
|
339
342
|
print_dry_run @container_scripts_interface.dry.destroy(container_script["id"])
|
340
343
|
return
|
@@ -31,7 +31,7 @@ class Morpheus::Cli::LibraryContainerTemplatesCommand
|
|
31
31
|
[:phrase, :offset, :max, :sort, :direction, :lastUpdated].each do |k|
|
32
32
|
params[k] = options[k] unless options[k].nil?
|
33
33
|
end
|
34
|
-
|
34
|
+
@container_templates_interface.setopts(options)
|
35
35
|
if options[:dry_run]
|
36
36
|
print_dry_run @container_templates_interface.dry.list(params)
|
37
37
|
return
|
@@ -100,6 +100,7 @@ class Morpheus::Cli::LibraryContainerTemplatesCommand
|
|
100
100
|
if container_template.nil?
|
101
101
|
return 1
|
102
102
|
end
|
103
|
+
@container_templates_interface.setopts(options)
|
103
104
|
if options[:dry_run]
|
104
105
|
print_dry_run @container_templates_interface.dry.get(container_template['id'])
|
105
106
|
return
|
@@ -227,6 +228,7 @@ class Morpheus::Cli::LibraryContainerTemplatesCommand
|
|
227
228
|
# todo: prompt?
|
228
229
|
payload = {'containerTemplate' => params}
|
229
230
|
end
|
231
|
+
@container_templates_interface.setopts(options)
|
230
232
|
if options[:dry_run]
|
231
233
|
print_dry_run @container_templates_interface.dry.create(payload)
|
232
234
|
return
|
@@ -311,6 +313,7 @@ class Morpheus::Cli::LibraryContainerTemplatesCommand
|
|
311
313
|
params.deep_merge!(options[:options].reject {|k,v| k.is_a?(Symbol) }) if options[:options]
|
312
314
|
payload = {'containerTemplate' => params}
|
313
315
|
end
|
316
|
+
@container_templates_interface.setopts(options)
|
314
317
|
if options[:dry_run]
|
315
318
|
print_dry_run @container_templates_interface.dry.update(container_template["id"], payload)
|
316
319
|
return
|
@@ -358,7 +361,7 @@ class Morpheus::Cli::LibraryContainerTemplatesCommand
|
|
358
361
|
# }
|
359
362
|
# payload['containerTemplate'].merge!(container_template)
|
360
363
|
payload = params
|
361
|
-
|
364
|
+
@container_templates_interface.setopts(options)
|
362
365
|
if options[:dry_run]
|
363
366
|
print_dry_run @container_templates_interface.dry.destroy(container_template["id"])
|
364
367
|
return
|
@@ -58,7 +58,7 @@ class Morpheus::Cli::LibraryContainerTypesCommand
|
|
58
58
|
begin
|
59
59
|
# construct payload
|
60
60
|
params.merge!(parse_list_options(options))
|
61
|
-
|
61
|
+
@library_container_types_interface.setopts(options)
|
62
62
|
if options[:dry_run]
|
63
63
|
print_dry_run @library_container_types_interface.dry.list(layout_id, params)
|
64
64
|
return
|
@@ -121,6 +121,7 @@ class Morpheus::Cli::LibraryContainerTypesCommand
|
|
121
121
|
def _get(id, options)
|
122
122
|
layout_id = nil
|
123
123
|
begin
|
124
|
+
@library_container_types_interface.setopts(options)
|
124
125
|
if options[:dry_run]
|
125
126
|
if arg.to_s =~ /\A\d{1,}\Z/
|
126
127
|
print_dry_run @library_container_types_interface.dry.get(layout_id, arg.to_i)
|
@@ -375,7 +376,7 @@ class Morpheus::Cli::LibraryContainerTypesCommand
|
|
375
376
|
|
376
377
|
|
377
378
|
end
|
378
|
-
|
379
|
+
@library_container_types_interface.setopts(options)
|
379
380
|
if options[:dry_run]
|
380
381
|
print_dry_run @library_container_types_interface.dry.create(layout_id, payload)
|
381
382
|
return
|
@@ -480,7 +481,7 @@ class Morpheus::Cli::LibraryContainerTypesCommand
|
|
480
481
|
payload['containerType'].deep_merge!(params)
|
481
482
|
|
482
483
|
end
|
483
|
-
|
484
|
+
@library_container_types_interface.setopts(options)
|
484
485
|
if options[:dry_run]
|
485
486
|
print_dry_run @library_container_types_interface.dry.update(layout_id, container_type['id'], payload)
|
486
487
|
return
|
@@ -523,6 +524,7 @@ class Morpheus::Cli::LibraryContainerTypesCommand
|
|
523
524
|
unless Morpheus::Cli::OptionTypes.confirm("Are you sure you want to delete the node type #{container_type['name']}?", options)
|
524
525
|
exit
|
525
526
|
end
|
527
|
+
@library_container_types_interface.setopts(options)
|
526
528
|
if options[:dry_run]
|
527
529
|
print_dry_run @library_container_types_interface.dry.destroy(nil, container_type['id'])
|
528
530
|
return
|
@@ -55,7 +55,7 @@ class Morpheus::Cli::LibraryInstanceTypesCommand
|
|
55
55
|
begin
|
56
56
|
# construct payload
|
57
57
|
params.merge!(parse_list_options(options))
|
58
|
-
|
58
|
+
@library_instance_types_interface.setopts(options)
|
59
59
|
if options[:dry_run]
|
60
60
|
print_dry_run @library_instance_types_interface.dry.list(params)
|
61
61
|
return
|
@@ -116,6 +116,7 @@ class Morpheus::Cli::LibraryInstanceTypesCommand
|
|
116
116
|
if instance_type.nil?
|
117
117
|
return 1
|
118
118
|
end
|
119
|
+
@library_instance_types_interface.setopts(options)
|
119
120
|
if options[:dry_run]
|
120
121
|
print_dry_run @library_instance_types_interface.dry.get(instance_type['id'])
|
121
122
|
return
|
@@ -270,6 +271,7 @@ class Morpheus::Cli::LibraryInstanceTypesCommand
|
|
270
271
|
params['hasAutoScale'] = ['on','true','1'].include?(params['hasAutoScale'].to_s) if params.key?('hasAutoScale')
|
271
272
|
params['hasDeployment'] = ['on','true','1'].include?(params['hasDeployment'].to_s) if params.key?('hasDeployment')
|
272
273
|
payload = {instanceType: params}
|
274
|
+
@library_instance_types_interface.setopts(options)
|
273
275
|
if options[:dry_run]
|
274
276
|
print_dry_run @library_instance_types_interface.dry.create(payload)
|
275
277
|
if logo_file
|
@@ -344,7 +346,7 @@ class Morpheus::Cli::LibraryInstanceTypesCommand
|
|
344
346
|
end
|
345
347
|
payload = {'instanceType' => params}
|
346
348
|
end
|
347
|
-
|
349
|
+
@library_instance_types_interface.setopts(options)
|
348
350
|
if options[:dry_run]
|
349
351
|
print_dry_run @library_instance_types_interface.dry.update(instance_type['id'], payload)
|
350
352
|
return
|
@@ -398,6 +400,7 @@ class Morpheus::Cli::LibraryInstanceTypesCommand
|
|
398
400
|
end
|
399
401
|
logo_file = File.new(filename, 'rb')
|
400
402
|
end
|
403
|
+
@library_instance_types_interface.setopts(options)
|
401
404
|
if options[:dry_run]
|
402
405
|
print_dry_run @library_instance_types_interface.dry.update_logo(instance_type['id'], logo_file)
|
403
406
|
return
|
@@ -436,6 +439,7 @@ class Morpheus::Cli::LibraryInstanceTypesCommand
|
|
436
439
|
unless Morpheus::Cli::OptionTypes.confirm("Are you sure you want to delete the instance type #{instance_type['name']}?", options)
|
437
440
|
exit
|
438
441
|
end
|
442
|
+
@library_instance_types_interface.setopts(options)
|
439
443
|
if options[:dry_run]
|
440
444
|
print_dry_run @library_instance_types_interface.dry.destroy(instance_type['id'])
|
441
445
|
return
|