morpheus-cli 5.4.2 → 5.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +1 -1
- data/lib/morpheus/api/api_client.rb +12 -1
- data/lib/morpheus/api/catalog_item_types_interface.rb +17 -0
- data/lib/morpheus/api/clusters_interface.rb +12 -0
- data/lib/morpheus/api/credential_types_interface.rb +9 -0
- data/lib/morpheus/api/credentials_interface.rb +9 -0
- data/lib/morpheus/api/instances_interface.rb +28 -0
- data/lib/morpheus/api/monitoring_apps_interface.rb +12 -4
- data/lib/morpheus/api/monitoring_checks_interface.rb +12 -4
- data/lib/morpheus/api/monitoring_groups_interface.rb +13 -5
- data/lib/morpheus/api/monitoring_incidents_interface.rb +12 -4
- data/lib/morpheus/api/options_interface.rb +8 -1
- data/lib/morpheus/api/ping_interface.rb +2 -0
- data/lib/morpheus/api/power_schedules_interface.rb +2 -2
- data/lib/morpheus/api/service_plans_interface.rb +6 -0
- data/lib/morpheus/api/setup_interface.rb +4 -0
- data/lib/morpheus/api/snapshots_interface.rb +19 -0
- data/lib/morpheus/cli/cli_command.rb +10 -17
- data/lib/morpheus/cli/commands/catalog_item_types_command.rb +156 -1
- data/lib/morpheus/cli/commands/clusters.rb +177 -50
- data/lib/morpheus/cli/commands/credential_types_command.rb +36 -0
- data/lib/morpheus/cli/commands/credentials_command.rb +124 -0
- data/lib/morpheus/cli/commands/hosts.rb +32 -2
- data/lib/morpheus/cli/commands/instances.rb +255 -2
- data/lib/morpheus/cli/commands/library_instance_types_command.rb +3 -0
- data/lib/morpheus/cli/commands/monitoring_apps_command.rb +8 -8
- data/lib/morpheus/cli/commands/monitoring_checks_command.rb +8 -8
- data/lib/morpheus/cli/commands/monitoring_groups_command.rb +8 -8
- data/lib/morpheus/cli/commands/monitoring_incidents_command.rb +8 -8
- data/lib/morpheus/cli/commands/network_static_routes_command.rb +5 -0
- data/lib/morpheus/cli/commands/networks_command.rb +2 -2
- data/lib/morpheus/cli/commands/ping.rb +3 -5
- data/lib/morpheus/cli/commands/policies_command.rb +1 -1
- data/lib/morpheus/cli/commands/power_schedules_command.rb +189 -258
- data/lib/morpheus/cli/commands/provisioning_settings_command.rb +1 -0
- data/lib/morpheus/cli/commands/remote.rb +16 -10
- data/lib/morpheus/cli/commands/security_groups.rb +2 -2
- data/lib/morpheus/cli/commands/service_plans_command.rb +52 -5
- data/lib/morpheus/cli/commands/setup.rb +1 -1
- data/lib/morpheus/cli/commands/snapshots.rb +139 -0
- data/lib/morpheus/cli/commands/storage_server_types.rb +0 -5
- data/lib/morpheus/cli/commands/storage_servers.rb +0 -6
- data/lib/morpheus/cli/commands/storage_volume_types.rb +0 -5
- data/lib/morpheus/cli/commands/storage_volumes.rb +0 -6
- data/lib/morpheus/cli/commands/tasks.rb +5 -5
- data/lib/morpheus/cli/commands/user_settings_command.rb +1 -1
- data/lib/morpheus/cli/commands/virtual_images.rb +4 -1
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +117 -27
- data/lib/morpheus/cli/mixins/rest_command.rb +20 -4
- data/lib/morpheus/cli/mixins/storage_servers_helper.rb +0 -63
- data/lib/morpheus/cli/mixins/storage_volumes_helper.rb +0 -43
- data/lib/morpheus/cli/option_types.rb +27 -11
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/routes.rb +13 -3
- metadata +13 -7
@@ -69,6 +69,7 @@ class Morpheus::Cli::ProvisioningSettingsCommand
|
|
69
69
|
"Hide Datastore Stats On Selection" => lambda {|it| format_boolean(it['hideDatastoreStats'])},
|
70
70
|
"Cross-Tenant Naming Policies" => lambda {|it| format_boolean(it['crossTenantNamingPolicies'])},
|
71
71
|
"Reuse Naming Sequence Numbers" => lambda {|it| format_boolean(it['reuseSequence'])},
|
72
|
+
"Show Console Keyboard Layout Settings" => lambda {|it| format_boolean(it['showConsoleKeyboardSettings'])},
|
72
73
|
"Deployment Archive Store" => lambda {|it| it['deployStorageProvider'] ? it['deployStorageProvider']['name'] : nil},
|
73
74
|
# Cloud-Init Settings
|
74
75
|
"Cloud-Init Username" => lambda {|it| it['cloudInitUsername']},
|
@@ -102,7 +102,7 @@ EOT
|
|
102
102
|
"URL" => lambda {|it| it[:url] || it[:host] },
|
103
103
|
"Status" => lambda {|it| format_appliance_status(it, cyan) },
|
104
104
|
"Version" => lambda {|it| it[:build_version] ? "#{it[:build_version]}" : '' },
|
105
|
-
"Appliance URL" => lambda {|it| it[:appliance_url] ? "#{it[:appliance_url]}" : '' },
|
105
|
+
#"Appliance URL" => lambda {|it| it[:appliance_url] ? "#{it[:appliance_url]}" : '' },
|
106
106
|
"Secure" => lambda {|it| format_boolean(it[:insecure] != true && (it[:url] || it[:host]).to_s.include?("https")) },
|
107
107
|
"Active" => lambda {|it| it[:active] ? "Yes " + format_is_current() : "No" },
|
108
108
|
#"Authenticated" => lambda {|it| format_boolean it[:authenticated] },
|
@@ -336,7 +336,7 @@ EOT
|
|
336
336
|
print cyan,"Added remote #{new_appliance_name}, status is #{format_appliance_status(appliance)}",reset,"\n"
|
337
337
|
end
|
338
338
|
|
339
|
-
appliance, json_response = ::Morpheus::Cli::Remote.refresh_remote(new_appliance_name.to_sym)
|
339
|
+
#appliance, json_response = ::Morpheus::Cli::Remote.refresh_remote(new_appliance_name.to_sym)
|
340
340
|
# if !options[:quiet]
|
341
341
|
# print cyan
|
342
342
|
# puts "Status: #{format_appliance_status(appliance)}"
|
@@ -390,7 +390,8 @@ EOT
|
|
390
390
|
end
|
391
391
|
|
392
392
|
end
|
393
|
-
|
393
|
+
# refresh to get buildVersion now that we are logged in
|
394
|
+
appliance, json_response = ::Morpheus::Cli::Remote.refresh_remote(new_appliance_name.to_sym)
|
394
395
|
else
|
395
396
|
#puts "Status is #{format_appliance_status(appliance)}"
|
396
397
|
end
|
@@ -1278,7 +1279,7 @@ EOT
|
|
1278
1279
|
"URL" => lambda {|it| it[:url] || it[:host] },
|
1279
1280
|
#"Status" => lambda {|it| format_appliance_status(it, cyan) },
|
1280
1281
|
"Version" => lambda {|it| it[:build_version] ? "#{it[:build_version]}" : '' },
|
1281
|
-
"Appliance URL" => lambda {|it| it[:appliance_url] ? "#{it[:appliance_url]}" : '' },
|
1282
|
+
#"Appliance URL" => lambda {|it| it[:appliance_url] ? "#{it[:appliance_url]}" : '' },
|
1282
1283
|
"Secure" => lambda {|it| format_appliance_secure(it) },
|
1283
1284
|
"Active" => lambda {|it| it[:active] ? "Yes " + format_is_current() : "No" },
|
1284
1285
|
# "Active" => lambda {|it| format_boolean(it[:active]) },
|
@@ -1696,7 +1697,10 @@ EOT
|
|
1696
1697
|
# wtf, no url...
|
1697
1698
|
return appliance, json_response
|
1698
1699
|
else
|
1699
|
-
|
1700
|
+
# access token is needed for buildVersion
|
1701
|
+
wallet = Morpheus::Cli::Credentials.new(app_name, appliance_url).load_saved_credentials()
|
1702
|
+
setup_interface = Morpheus::SetupInterface.new({url:appliance_url, verify_ssl: !appliance[:insecure], timeout: timeout,
|
1703
|
+
access_token: (wallet && wallet['access_token']) ? wallet['access_token'] : nil})
|
1700
1704
|
start_time = Time.now
|
1701
1705
|
begin
|
1702
1706
|
json_response = setup_interface.check(params)
|
@@ -1734,17 +1738,19 @@ EOT
|
|
1734
1738
|
appliance[:last_check][:took] = (took_sec.to_f*1000).round
|
1735
1739
|
end
|
1736
1740
|
if json_response
|
1737
|
-
if json_response.key?('applianceUrl')
|
1738
|
-
|
1739
|
-
end
|
1740
|
-
if json_response
|
1741
|
-
appliance[:build_version] = json_response['buildVersion']
|
1741
|
+
# if json_response.key?('applianceUrl')
|
1742
|
+
# appliance[:appliance_url] = json_response['applianceUrl']
|
1743
|
+
# end
|
1744
|
+
if json_response['success'] == true
|
1742
1745
|
appliance[:status] = 'ready'
|
1743
1746
|
appliance[:last_check][:success] = true
|
1744
1747
|
# consider bumping this after every successful api command
|
1745
1748
|
appliance[:last_success_at] = Time.now.to_i
|
1746
1749
|
appliance.delete(:error)
|
1747
1750
|
end
|
1751
|
+
if !json_response['buildVersion'].to_s.empty?
|
1752
|
+
appliance[:build_version] = json_response['buildVersion']
|
1753
|
+
end
|
1748
1754
|
if json_response.key?('setupNeeded')
|
1749
1755
|
if json_response['setupNeeded'] == true
|
1750
1756
|
appliance[:setup_needed] = true
|
@@ -855,7 +855,7 @@ class Morpheus::Cli::SecurityGroups
|
|
855
855
|
|
856
856
|
end
|
857
857
|
|
858
|
-
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'sourceType', 'fieldLabel' => 'Source Type', 'type' => 'select', 'optionSource' => 'securityGroupSourceType', 'required' => true, 'defaultValue' => 'cidr'}], options[:options], @api_client)
|
858
|
+
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'sourceType', 'fieldLabel' => 'Source Type', 'type' => 'select', 'optionSource' => 'securityGroupSourceType', 'required' => true, 'defaultValue' => 'cidr'}], options[:options], @api_client, {'rule.securityGroupId': security_group['id'], 'securityGroupRule.direction': payload['rule']['direction']})
|
859
859
|
payload['rule']['sourceType'] = v_prompt['sourceType'] unless v_prompt['sourceType'].nil?
|
860
860
|
|
861
861
|
if payload['rule']['sourceType'] == 'cidr'
|
@@ -869,7 +869,7 @@ class Morpheus::Cli::SecurityGroups
|
|
869
869
|
payload['rule']['sourceTier'] = {"id" => v_prompt['sourceTier']} unless v_prompt['sourceTier'].nil?
|
870
870
|
end
|
871
871
|
|
872
|
-
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'destinationType', 'fieldLabel' => 'Destination Type', 'type' => 'select', 'optionSource' => 'securityGroupDestinationType', 'required' => true, 'defaultValue' => 'instance'}], options[:options], @api_client)
|
872
|
+
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'destinationType', 'fieldLabel' => 'Destination Type', 'type' => 'select', 'optionSource' => 'securityGroupDestinationType', 'required' => true, 'defaultValue' => 'instance'}], options[:options], @api_client, {'rule.securityGroupId': security_group['id'], 'securityGroupRule.direction': payload['rule']['direction']})
|
873
873
|
payload['rule']['destinationType'] = v_prompt['destinationType'] unless v_prompt['destinationType'].nil?
|
874
874
|
|
875
875
|
if payload['rule']['destinationType'] == 'cidr'
|
@@ -7,7 +7,7 @@ class Morpheus::Cli::ServicePlanCommand
|
|
7
7
|
|
8
8
|
set_command_name :'service-plans'
|
9
9
|
|
10
|
-
register_subcommands :list, :get, :add, :update, :activate, :deactivate
|
10
|
+
register_subcommands :list, :get, :add, :update, :activate, :deactivate, :remove
|
11
11
|
set_default_subcommand :list
|
12
12
|
|
13
13
|
def connect(opts)
|
@@ -119,8 +119,6 @@ class Morpheus::Cli::ServicePlanCommand
|
|
119
119
|
def _get(plan_id, options = {})
|
120
120
|
params = {}
|
121
121
|
begin
|
122
|
-
@service_plans_interface.setopts(options)
|
123
|
-
|
124
122
|
if !(plan_id.to_s =~ /\A\d{1,}\Z/)
|
125
123
|
plan = find_service_plan(plan_id)
|
126
124
|
|
@@ -130,7 +128,7 @@ class Morpheus::Cli::ServicePlanCommand
|
|
130
128
|
end
|
131
129
|
plan_id = plan['id']
|
132
130
|
end
|
133
|
-
|
131
|
+
@service_plans_interface.setopts(options)
|
134
132
|
if options[:dry_run]
|
135
133
|
print_dry_run @service_plans_interface.dry.get(plan_id)
|
136
134
|
return
|
@@ -575,7 +573,7 @@ class Morpheus::Cli::ServicePlanCommand
|
|
575
573
|
options[:provisionType] = options[:provisionType] || (args.count > 1 ? args[1] : nil)
|
576
574
|
|
577
575
|
if !options[:provisionType].nil?
|
578
|
-
provision_types = @service_plans_interface.provision_types()['provisionTypes']
|
576
|
+
provision_types = @service_plans_interface.provision_types({max: 10000})['provisionTypes']
|
579
577
|
provision_type = provision_types.find {|it| it['name'] == options[:provisionType] || it['code'] == options[:provisionType] || it['id'] == options[:provisionType].to_i}
|
580
578
|
|
581
579
|
if provision_type.nil?
|
@@ -740,6 +738,55 @@ class Morpheus::Cli::ServicePlanCommand
|
|
740
738
|
end
|
741
739
|
end
|
742
740
|
|
741
|
+
def remove(args)
|
742
|
+
options = {}
|
743
|
+
params = {}
|
744
|
+
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
745
|
+
opts.banner = subcommand_usage( "[plan]")
|
746
|
+
build_common_options(opts, options, [:json, :dry_run, :remote, :auto_confirm])
|
747
|
+
opts.footer = "Delete a service plan.\n" +
|
748
|
+
"[plan] is required. Service plan ID, name or code"
|
749
|
+
end
|
750
|
+
optparse.parse!(args)
|
751
|
+
connect(options)
|
752
|
+
if args.count != 1
|
753
|
+
raise_command_error "wrong number of arguments, expected 1 and got (#{args.count}) #{args}\n#{optparse}"
|
754
|
+
return 1
|
755
|
+
end
|
756
|
+
|
757
|
+
begin
|
758
|
+
plan = find_service_plan(args[0])
|
759
|
+
|
760
|
+
if !plan
|
761
|
+
print_red_alert "Service plan #{args[0]} not found"
|
762
|
+
return 1
|
763
|
+
end
|
764
|
+
|
765
|
+
unless options[:yes] || ::Morpheus::Cli::OptionTypes::confirm("Are you sure you would like to delete the service plan '#{plan['name']}'?", options)
|
766
|
+
return 9, "aborted command"
|
767
|
+
end
|
768
|
+
|
769
|
+
@service_plans_interface.setopts(options)
|
770
|
+
if options[:dry_run]
|
771
|
+
print_dry_run @service_plans_interface.dry.destroy(plan['id'], params)
|
772
|
+
return
|
773
|
+
end
|
774
|
+
|
775
|
+
json_response = @service_plans_interface.destroy(plan['id'], params)
|
776
|
+
|
777
|
+
if options[:json]
|
778
|
+
print JSON.pretty_generate(json_response)
|
779
|
+
print "\n"
|
780
|
+
elsif !options[:quiet]
|
781
|
+
print_green_success "Service plan #{plan['name']} deleted"
|
782
|
+
end
|
783
|
+
return 0
|
784
|
+
rescue RestClient::Exception => e
|
785
|
+
print_rest_exception(e, options)
|
786
|
+
exit 1
|
787
|
+
end
|
788
|
+
end
|
789
|
+
|
743
790
|
private
|
744
791
|
|
745
792
|
def find_service_plan(val)
|
@@ -95,7 +95,7 @@ EOT
|
|
95
95
|
# my_terminal.execute("setup needed?")
|
96
96
|
# theres a bug here with --remote-url :status == "unknown"
|
97
97
|
# but hey, we got json back, so set status to "ready"
|
98
|
-
if appliance_status_json
|
98
|
+
if appliance_status_json
|
99
99
|
@remote_appliance[:status] == 'ready'
|
100
100
|
end
|
101
101
|
remote_status_string = format_appliance_status(@remote_appliance, cyan)
|
@@ -0,0 +1,139 @@
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
2
|
+
|
3
|
+
class Morpheus::Cli::Snapshots
|
4
|
+
include Morpheus::Cli::CliCommand
|
5
|
+
|
6
|
+
set_command_name :snapshots
|
7
|
+
set_command_description "View or remove snapshot"
|
8
|
+
register_subcommands :get, :remove
|
9
|
+
|
10
|
+
alias_subcommand :details, :get
|
11
|
+
set_default_subcommand :get
|
12
|
+
|
13
|
+
def connect(opts)
|
14
|
+
@api_client = establish_remote_appliance_connection(opts)
|
15
|
+
@snapshots_interface = @api_client.snapshots
|
16
|
+
end
|
17
|
+
|
18
|
+
def handle(args)
|
19
|
+
handle_subcommand(args)
|
20
|
+
end
|
21
|
+
|
22
|
+
def get(args)
|
23
|
+
options = {}
|
24
|
+
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
25
|
+
opts.banner = subcommand_usage("[id]")
|
26
|
+
opts.footer = "Get Snapshot details." + "\n" +
|
27
|
+
"[snapshotId] is required. This is the id of the snapshot."
|
28
|
+
build_common_options(opts, options, [:json, :yaml, :csv, :fields, :dry_run, :remote])
|
29
|
+
end
|
30
|
+
optparse.parse!(args)
|
31
|
+
if args.count < 1
|
32
|
+
puts_error "[id] argument is required"
|
33
|
+
puts_error optparse
|
34
|
+
return 1
|
35
|
+
end
|
36
|
+
|
37
|
+
connect(options)
|
38
|
+
id_list = parse_id_list(args)
|
39
|
+
|
40
|
+
return run_command_for_each_arg(id_list) do |arg|
|
41
|
+
_get(arg, options)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def _get(arg, options)
|
46
|
+
begin
|
47
|
+
|
48
|
+
@snapshots_interface.setopts(options)
|
49
|
+
if options[:dry_run]
|
50
|
+
print_dry_run @snapshots_interface.dry.get(arg.to_i)
|
51
|
+
return
|
52
|
+
end
|
53
|
+
|
54
|
+
json_response = @snapshots_interface.get(arg.to_i)
|
55
|
+
if options[:json]
|
56
|
+
puts as_json(json_response, options, "snapshot")
|
57
|
+
return 0
|
58
|
+
elsif options[:yaml]
|
59
|
+
puts as_yaml(json_response, options, "snapshot")
|
60
|
+
return 0
|
61
|
+
end
|
62
|
+
|
63
|
+
if options[:csv]
|
64
|
+
puts records_as_csv([json_response['snapshot']], options)
|
65
|
+
return 0
|
66
|
+
end
|
67
|
+
snapshot = json_response['snapshot']
|
68
|
+
|
69
|
+
print_h1 "Snapshot Details"
|
70
|
+
print cyan
|
71
|
+
description_cols = {
|
72
|
+
"ID" => 'id',
|
73
|
+
"Name" => 'name',
|
74
|
+
"Description" => 'description',
|
75
|
+
"External Id" => 'externalId',
|
76
|
+
"Status" => 'status',
|
77
|
+
"State" => 'state',
|
78
|
+
"Snapshot Type" => 'snapshotType',
|
79
|
+
"Snapshot Created" => 'snapshotCreated',
|
80
|
+
"Cloud" => 'zone.name',
|
81
|
+
"Datastore" => 'datastore',
|
82
|
+
"Parent Snapshot" => 'parentSnapshot',
|
83
|
+
"Active" => 'currentlyActive',
|
84
|
+
"Date Created" => 'dateCreated'
|
85
|
+
}
|
86
|
+
print_description_list(description_cols, snapshot)
|
87
|
+
|
88
|
+
print reset, "\n"
|
89
|
+
|
90
|
+
return 0
|
91
|
+
rescue RestClient::Exception => e
|
92
|
+
print_rest_exception(e, options)
|
93
|
+
return 1
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
def remove(args)
|
98
|
+
options = {}
|
99
|
+
instance = nil
|
100
|
+
snapshot_id = nil
|
101
|
+
|
102
|
+
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
103
|
+
opts.banner = subcommand_usage("[instance]")
|
104
|
+
build_common_options(opts, options, [:auto_confirm, :json, :dry_run, :remote])
|
105
|
+
opts.footer = "Remove/Delete a snapshot." + "\n" +
|
106
|
+
"[snapshotId] is required. This is the id of the snapshot to delete."
|
107
|
+
end
|
108
|
+
|
109
|
+
optparse.parse!(args)
|
110
|
+
if args.count != 1
|
111
|
+
raise_command_error "wrong number of arguments, expected 1 and got (#{args.count}) #{args.join(' ')}\n#{optparse}"
|
112
|
+
end
|
113
|
+
snapshot_id = args[0].to_i
|
114
|
+
connect(options)
|
115
|
+
begin
|
116
|
+
unless options[:yes] || ::Morpheus::Cli::OptionTypes::confirm("Are you sure you would like to remove a snapshot?", options)
|
117
|
+
exit 1
|
118
|
+
end
|
119
|
+
|
120
|
+
payload = {}
|
121
|
+
if options[:dry_run]
|
122
|
+
print_dry_run @snapshots_interface.dry.remove(snapshot_id, payload)
|
123
|
+
return
|
124
|
+
end
|
125
|
+
|
126
|
+
json_response = @snapshots_interface.remove(snapshot_id, payload)
|
127
|
+
if options[:json]
|
128
|
+
puts as_json(json_response, options)
|
129
|
+
else
|
130
|
+
print_green_success "Snapshot delete initiated."
|
131
|
+
end
|
132
|
+
return 0
|
133
|
+
|
134
|
+
rescue RestClient::Exception => e
|
135
|
+
print_rest_exception(e, options)
|
136
|
+
exit 1
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
@@ -66,12 +66,6 @@ class Morpheus::Cli::StorageServers
|
|
66
66
|
}
|
67
67
|
end
|
68
68
|
|
69
|
-
# overridden to work with name or code
|
70
|
-
# nope, api works with name=code now too
|
71
|
-
# def find_storage_server_type_by_name_or_id(name)
|
72
|
-
# storage_server_type_for_name_or_id(name)
|
73
|
-
# end
|
74
|
-
|
75
69
|
def add_storage_server_option_types()
|
76
70
|
[
|
77
71
|
{'fieldName' => 'name', 'fieldLabel' => 'Name', 'type' => 'text', 'required' => true},
|
@@ -65,12 +65,6 @@ class Morpheus::Cli::StorageVolumes
|
|
65
65
|
}
|
66
66
|
end
|
67
67
|
|
68
|
-
# overridden to work with name or code
|
69
|
-
# nope, api works with name=code now too
|
70
|
-
# def find_storage_volume_type_by_name_or_id(name)
|
71
|
-
# storage_volume_type_for_name_or_id(name)
|
72
|
-
# end
|
73
|
-
|
74
68
|
def add_storage_volume_option_types()
|
75
69
|
[
|
76
70
|
{'fieldContext' => 'storageServer', 'fieldName' => 'id', 'fieldLabel' => 'Storage Server', 'type' => 'select', 'optionSource' => 'storageServers', 'optionParams' => {'createType' => 'block'}, 'required' => true},
|
@@ -179,7 +179,7 @@ class Morpheus::Cli::Tasks
|
|
179
179
|
task_option_config = {}
|
180
180
|
task_option_columns = []
|
181
181
|
task_type['optionTypes'].sort { |x,y| x['displayOrder'].to_i <=> y['displayOrder'].to_i }.each do |optionType|
|
182
|
-
if optionType['
|
182
|
+
if optionType['code'] == 'script'
|
183
183
|
script_content = task['taskOptions'][optionType['fieldName']]
|
184
184
|
elsif optionType['fieldName'] == 'httpHeaders' || optionType['fieldName'] == 'webHeaders'
|
185
185
|
http_headers = task['taskOptions']['httpHeaders'] || task['taskOptions']['webHeaders']
|
@@ -553,11 +553,11 @@ class Morpheus::Cli::Tasks
|
|
553
553
|
payload['task']['retryCount'] = v_prompt['retryCount'].to_i unless v_prompt['retryCount'].nil?
|
554
554
|
end
|
555
555
|
# Retry Delay
|
556
|
-
if options[:options]['
|
557
|
-
payload['task']['
|
556
|
+
if options[:options]['retryDelaySeconds']
|
557
|
+
payload['task']['retryDelaySeconds'] = options[:options]['retryDelaySeconds'].to_i
|
558
558
|
else
|
559
|
-
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => '
|
560
|
-
payload['task']['
|
559
|
+
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => 'retryDelaySeconds', 'fieldLabel' => 'Retry Delay', 'type' => 'number', 'defaultValue' => 10}], options[:options], @api_client)
|
560
|
+
payload['task']['retryDelaySeconds'] = v_prompt['retryDelaySeconds'].to_i unless v_prompt['retryDelaySeconds'].nil?
|
561
561
|
end
|
562
562
|
end
|
563
563
|
|
@@ -803,7 +803,7 @@ EOT
|
|
803
803
|
{'fieldName' => 'windowsPassword', 'fieldLabel' => 'Windows Password', 'type' => 'password'},
|
804
804
|
{'fieldName' => 'defaultGroup', 'fieldLabel' => 'Default Group ID', 'type' => 'text'},
|
805
805
|
{'fieldName' => 'defaultCloud', 'fieldLabel' => 'Default Cloud ID', 'type' => 'text'},
|
806
|
-
{'fieldName' => 'defaultPersona', 'fieldLabel' => 'Default Persona Name or Code or ID', 'type' => 'text'},
|
806
|
+
{'fieldName' => 'defaultPersona', 'fieldLabel' => 'Default Persona Name or Code or ID eg. standard, serviceCatalog or vdi', 'type' => 'text'},
|
807
807
|
{'switch' => 'change-password', 'fieldName' => 'password', 'fieldLabel' => 'Password', 'type' => 'password', 'description' => 'Change user credentials to use a new password'},
|
808
808
|
{'fieldName' => 'avatar', 'fieldLabel' => 'Avatar', 'type' => 'file', 'description' => 'Local filepath of image file to upload as user avatar'},
|
809
809
|
{'fieldName' => 'desktopBackground', 'fieldLabel' => 'Desktop Background', 'type' => 'file', 'description' => 'Local filepath of image file to upload as user desktop background'},
|
@@ -38,6 +38,9 @@ class Morpheus::Cli::VirtualImages
|
|
38
38
|
end
|
39
39
|
opts.on('--system', "System Images" ) do
|
40
40
|
options[:filterType] = 'System'
|
41
|
+
end
|
42
|
+
opts.on('--synced', "Synced Images" ) do
|
43
|
+
options[:filterType] = 'Synced'
|
41
44
|
end
|
42
45
|
opts.on('--tags Name=Value',String, "Filter by tags (metadata name value pairs).") do |val|
|
43
46
|
val.split(",").each do |value_pair|
|
@@ -51,7 +54,7 @@ class Morpheus::Cli::VirtualImages
|
|
51
54
|
options[:details] = true
|
52
55
|
end
|
53
56
|
build_standard_list_options(opts, options)
|
54
|
-
opts.footer = "List virtual images."
|
57
|
+
opts.footer = "List virtual images. Default list applies User filter"
|
55
58
|
end
|
56
59
|
optparse.parse!(args)
|
57
60
|
connect(options)
|