morpheus-cli 5.3.4 → 5.4.3
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/Dockerfile +1 -1
- data/lib/morpheus/api/account_users_interface.rb +68 -0
- data/lib/morpheus/api/api_client.rb +69 -11
- data/lib/morpheus/api/audit_interface.rb +9 -0
- data/lib/morpheus/api/catalog_item_types_interface.rb +20 -0
- data/lib/morpheus/api/health_interface.rb +37 -3
- data/lib/morpheus/api/instances_interface.rb +49 -0
- data/lib/morpheus/api/load_balancer_monitors_interface.rb +9 -0
- data/lib/morpheus/api/load_balancer_pools_interface.rb +4 -4
- data/lib/morpheus/api/load_balancer_profiles_interface.rb +4 -5
- data/lib/morpheus/api/load_balancer_virtual_servers_interface.rb +13 -4
- data/lib/morpheus/api/load_balancers_interface.rb +5 -0
- data/lib/morpheus/api/network_dhcp_relays_interface.rb +36 -0
- data/lib/morpheus/api/network_dhcp_servers_interface.rb +36 -0
- data/lib/morpheus/api/network_edge_clusters_interface.rb +26 -0
- data/lib/morpheus/api/network_routers_interface.rb +9 -0
- data/lib/morpheus/api/network_servers_interface.rb +68 -12
- data/lib/morpheus/api/network_static_routes_interface.rb +36 -0
- data/lib/morpheus/api/ping_interface.rb +2 -0
- data/lib/morpheus/api/read_interface.rb +4 -3
- data/lib/morpheus/api/rest_interface.rb +3 -3
- data/lib/morpheus/api/roles_interface.rb +7 -0
- data/lib/morpheus/api/secondary_read_interface.rb +1 -1
- data/lib/morpheus/api/secondary_rest_interface.rb +19 -19
- data/lib/morpheus/api/setup_interface.rb +4 -0
- data/lib/morpheus/api/snapshots_interface.rb +19 -0
- data/lib/morpheus/api/storage_server_types_interface.rb +14 -0
- data/lib/morpheus/api/storage_servers_interface.rb +9 -0
- data/lib/morpheus/api/storage_volume_types_interface.rb +9 -0
- data/lib/morpheus/api/storage_volumes_interface.rb +9 -0
- data/lib/morpheus/api/users_interface.rb +16 -63
- data/lib/morpheus/cli/cli_command.rb +260 -13
- data/lib/morpheus/cli/cli_registry.rb +2 -1
- data/lib/morpheus/cli/{access_token_command.rb → commands/access_token_command.rb} +1 -1
- data/lib/morpheus/cli/{account_groups_command.rb → commands/account_groups_command.rb} +0 -8
- data/lib/morpheus/cli/{activity_command.rb → commands/activity_command.rb} +0 -0
- data/lib/morpheus/cli/commands/{standard/alias_command.rb → alias_command.rb} +1 -4
- data/lib/morpheus/cli/{appliance_settings_command.rb → commands/appliance_settings_command.rb} +0 -0
- data/lib/morpheus/cli/{approvals_command.rb → commands/approvals_command.rb} +0 -0
- data/lib/morpheus/cli/{apps.rb → commands/apps.rb} +14 -87
- data/lib/morpheus/cli/{archives_command.rb → commands/archives_command.rb} +0 -6
- data/lib/morpheus/cli/commands/audit.rb +188 -0
- data/lib/morpheus/cli/{backup_jobs_command.rb → commands/backup_jobs_command.rb} +0 -0
- data/lib/morpheus/cli/{backup_settings_command.rb → commands/backup_settings_command.rb} +0 -0
- data/lib/morpheus/cli/{backups_command.rb → commands/backups_command.rb} +0 -0
- data/lib/morpheus/cli/commands/{standard/benchmark_command.rb → benchmark_command.rb} +0 -3
- data/lib/morpheus/cli/{blueprints_command.rb → commands/blueprints_command.rb} +1 -1
- data/lib/morpheus/cli/{boot_scripts_command.rb → commands/boot_scripts_command.rb} +0 -3
- data/lib/morpheus/cli/{budgets_command.rb → commands/budgets_command.rb} +0 -0
- data/lib/morpheus/cli/commands/{standard/cat_command.rb → cat_command.rb} +0 -0
- data/lib/morpheus/cli/{catalog_item_types_command.rb → commands/catalog_item_types_command.rb} +88 -0
- data/lib/morpheus/cli/{certificates_command.rb → commands/certificates_command.rb} +0 -0
- data/lib/morpheus/cli/commands/change_password_command.rb +132 -0
- data/lib/morpheus/cli/{cloud_datastores_command.rb → commands/cloud_datastores_command.rb} +0 -4
- data/lib/morpheus/cli/{cloud_folders_command.rb → commands/cloud_folders_command.rb} +0 -4
- data/lib/morpheus/cli/{cloud_resource_pools_command.rb → commands/cloud_resource_pools_command.rb} +0 -4
- data/lib/morpheus/cli/{clouds.rb → commands/clouds.rb} +0 -7
- data/lib/morpheus/cli/{clusters.rb → commands/clusters.rb} +96 -64
- data/lib/morpheus/cli/commands/{standard/coloring_command.rb → coloring_command.rb} +0 -2
- data/lib/morpheus/cli/{containers_command.rb → commands/containers_command.rb} +0 -7
- data/lib/morpheus/cli/commands/{standard/curl_command.rb → curl_command.rb} +0 -3
- data/lib/morpheus/cli/{cypher_command.rb → commands/cypher_command.rb} +0 -1
- data/lib/morpheus/cli/{dashboard_command.rb → commands/dashboard_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/debug_command.rb → debug_command.rb} +0 -1
- data/lib/morpheus/cli/{deploy.rb → commands/deploy.rb} +0 -1
- data/lib/morpheus/cli/{deployments.rb → commands/deployments.rb} +0 -0
- data/lib/morpheus/cli/{deploys.rb → commands/deploys.rb} +0 -1
- data/lib/morpheus/cli/{doc.rb → commands/doc.rb} +1 -1
- data/lib/morpheus/cli/commands/{standard/echo_command.rb → echo_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/edit_profile_command.rb → edit_profile_command.rb} +15 -4
- data/lib/morpheus/cli/commands/{standard/edit_rc_command.rb → edit_rc_command.rb} +19 -3
- data/lib/morpheus/cli/{environments_command.rb → commands/environments_command.rb} +0 -5
- data/lib/morpheus/cli/{execute_schedules_command.rb → commands/execute_schedules_command.rb} +0 -0
- data/lib/morpheus/cli/{execution_request_command.rb → commands/execution_request_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/exit_command.rb → exit_command.rb} +0 -2
- data/lib/morpheus/cli/{file_copy_request_command.rb → commands/file_copy_request_command.rb} +0 -4
- data/lib/morpheus/cli/{forgot_password.rb → commands/forgot_password.rb} +0 -0
- data/lib/morpheus/cli/commands/{standard/get_prompt_command.rb → get_prompt_command.rb} +0 -3
- data/lib/morpheus/cli/{groups.rb → commands/groups.rb} +0 -7
- data/lib/morpheus/cli/{guidance_command.rb → commands/guidance_command.rb} +1 -1
- data/lib/morpheus/cli/{health_command.rb → commands/health_command.rb} +104 -19
- data/lib/morpheus/cli/commands/{standard/history_command.rb → history_command.rb} +0 -3
- data/lib/morpheus/cli/{hosts.rb → commands/hosts.rb} +27 -24
- data/lib/morpheus/cli/{image_builder_command.rb → commands/image_builder_command.rb} +6 -16
- data/lib/morpheus/cli/{instance_types.rb → commands/instance_types.rb} +0 -3
- data/lib/morpheus/cli/{instances.rb → commands/instances.rb} +359 -7
- data/lib/morpheus/cli/{integrations_command.rb → commands/integrations_command.rb} +1 -12
- data/lib/morpheus/cli/{invoices_command.rb → commands/invoices_command.rb} +1 -1
- data/lib/morpheus/cli/{jobs_command.rb → commands/jobs_command.rb} +0 -0
- data/lib/morpheus/cli/{key_pairs.rb → commands/key_pairs.rb} +0 -6
- data/lib/morpheus/cli/{library_cluster_layouts_command.rb → commands/library_cluster_layouts_command.rb} +0 -4
- data/lib/morpheus/cli/{library_container_scripts_command.rb → commands/library_container_scripts_command.rb} +0 -0
- data/lib/morpheus/cli/{library_container_templates_command.rb → commands/library_container_templates_command.rb} +0 -1
- data/lib/morpheus/cli/{library_container_types_command.rb → commands/library_container_types_command.rb} +0 -4
- data/lib/morpheus/cli/{library_instance_types_command.rb → commands/library_instance_types_command.rb} +3 -4
- data/lib/morpheus/cli/{library_layouts_command.rb → commands/library_layouts_command.rb} +0 -4
- data/lib/morpheus/cli/{library_option_lists_command.rb → commands/library_option_lists_command.rb} +0 -4
- data/lib/morpheus/cli/{library_option_types_command.rb → commands/library_option_types_command.rb} +0 -4
- data/lib/morpheus/cli/{library_spec_templates_command.rb → commands/library_spec_templates_command.rb} +0 -1
- data/lib/morpheus/cli/{library_upgrades_command.rb → commands/library_upgrades_command.rb} +0 -4
- data/lib/morpheus/cli/{license.rb → commands/license.rb} +0 -3
- data/lib/morpheus/cli/commands/load_balancer_monitors.rb +70 -0
- data/lib/morpheus/cli/commands/load_balancer_pools.rb +90 -0
- data/lib/morpheus/cli/commands/load_balancer_profiles.rb +64 -0
- data/lib/morpheus/cli/{load_balancer_types.rb → commands/load_balancer_types.rb} +9 -8
- data/lib/morpheus/cli/{load_balancer_virtual_servers.rb → commands/load_balancer_virtual_servers.rb} +69 -58
- data/lib/morpheus/cli/commands/load_balancers.rb +192 -0
- data/lib/morpheus/cli/commands/{standard/log_level_command.rb → log_level_command.rb} +0 -3
- data/lib/morpheus/cli/{log_settings_command.rb → commands/log_settings_command.rb} +0 -0
- data/lib/morpheus/cli/{login.rb → commands/login.rb} +0 -5
- data/lib/morpheus/cli/commands/logout.rb +63 -0
- data/lib/morpheus/cli/{logs_command.rb → commands/logs_command.rb} +0 -3
- data/lib/morpheus/cli/commands/{standard/man_command.rb → man_command.rb} +0 -2
- data/lib/morpheus/cli/{monitoring_alerts_command.rb → commands/monitoring_alerts_command.rb} +0 -7
- data/lib/morpheus/cli/{monitoring_apps_command.rb → commands/monitoring_apps_command.rb} +0 -1
- data/lib/morpheus/cli/{monitoring_checks_command.rb → commands/monitoring_checks_command.rb} +0 -1
- data/lib/morpheus/cli/{monitoring_contacts_command.rb → commands/monitoring_contacts_command.rb} +0 -7
- data/lib/morpheus/cli/{monitoring_groups_command.rb → commands/monitoring_groups_command.rb} +0 -1
- data/lib/morpheus/cli/{monitoring_incidents_command.rb → commands/monitoring_incidents_command.rb} +0 -1
- data/lib/morpheus/cli/commands/network_dhcp_relays_command.rb +416 -0
- data/lib/morpheus/cli/commands/network_dhcp_servers_command.rb +407 -0
- data/lib/morpheus/cli/{network_domains_command.rb → commands/network_domains_command.rb} +0 -4
- data/lib/morpheus/cli/commands/network_edge_clusters_command.rb +329 -0
- data/lib/morpheus/cli/commands/network_firewalls_command.rb +823 -0
- data/lib/morpheus/cli/{network_groups_command.rb → commands/network_groups_command.rb} +0 -4
- data/lib/morpheus/cli/{network_pool_servers_command.rb → commands/network_pool_servers_command.rb} +0 -4
- data/lib/morpheus/cli/{network_pools_command.rb → commands/network_pools_command.rb} +0 -4
- data/lib/morpheus/cli/{network_proxies_command.rb → commands/network_proxies_command.rb} +0 -4
- data/lib/morpheus/cli/{network_routers_command.rb → commands/network_routers_command.rb} +96 -50
- data/lib/morpheus/cli/{network_services_command.rb → commands/network_services_command.rb} +0 -4
- data/lib/morpheus/cli/commands/network_static_routes_command.rb +451 -0
- data/lib/morpheus/cli/{network_scopes_command.rb → commands/network_transport_zones_command.rb} +102 -92
- data/lib/morpheus/cli/{networks_command.rb → commands/networks_command.rb} +20 -20
- data/lib/morpheus/cli/commands/open_command.rb +30 -0
- data/lib/morpheus/cli/commands/options.rb +98 -0
- data/lib/morpheus/cli/{packages_command.rb → commands/packages_command.rb} +0 -2
- data/lib/morpheus/cli/{ping.rb → commands/ping.rb} +3 -12
- data/lib/morpheus/cli/{policies_command.rb → commands/policies_command.rb} +2 -9
- data/lib/morpheus/cli/{power_schedules_command.rb → commands/power_schedules_command.rb} +0 -0
- data/lib/morpheus/cli/{preseed_scripts_command.rb → commands/preseed_scripts_command.rb} +0 -3
- data/lib/morpheus/cli/{price_sets_command.rb → commands/price_sets_command.rb} +0 -0
- data/lib/morpheus/cli/{prices_command.rb → commands/prices_command.rb} +7 -7
- data/lib/morpheus/cli/{processes_command.rb → commands/processes_command.rb} +0 -1
- data/lib/morpheus/cli/{projects_command.rb → commands/projects_command.rb} +0 -0
- data/lib/morpheus/cli/{provisioning_licenses_command.rb → commands/provisioning_licenses_command.rb} +0 -0
- data/lib/morpheus/cli/{provisioning_settings_command.rb → commands/provisioning_settings_command.rb} +1 -0
- data/lib/morpheus/cli/{recent_activity_command.rb → commands/recent_activity_command.rb} +0 -0
- data/lib/morpheus/cli/{remote.rb → commands/remote.rb} +21 -19
- data/lib/morpheus/cli/{reports_command.rb → commands/reports_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/rm_command.rb → rm_command.rb} +0 -0
- data/lib/morpheus/cli/{roles.rb → commands/roles.rb} +245 -40
- data/lib/morpheus/cli/{search_command.rb → commands/search_command.rb} +0 -0
- data/lib/morpheus/cli/{security_group_rules.rb → commands/security_group_rules.rb} +0 -5
- data/lib/morpheus/cli/{security_groups.rb → commands/security_groups.rb} +2 -8
- data/lib/morpheus/cli/{service_catalog_command.rb → commands/service_catalog_command.rb} +0 -0
- data/lib/morpheus/cli/{service_plans_command.rb → commands/service_plans_command.rb} +1 -1
- data/lib/morpheus/cli/commands/{standard/set_prompt_command.rb → set_prompt_command.rb} +0 -3
- data/lib/morpheus/cli/{setup.rb → commands/setup.rb} +1 -1
- data/lib/morpheus/cli/{shell.rb → commands/shell.rb} +4 -105
- data/lib/morpheus/cli/commands/{standard/sleep_command.rb → sleep_command.rb} +0 -2
- data/lib/morpheus/cli/commands/snapshots.rb +139 -0
- data/lib/morpheus/cli/commands/{standard/source_command.rb → source_command.rb} +0 -2
- data/lib/morpheus/cli/commands/{standard/ssl_verification_command.rb → ssl_verification_command.rb} +0 -3
- data/lib/morpheus/cli/{storage_providers_command.rb → commands/storage_providers_command.rb} +0 -4
- data/lib/morpheus/cli/commands/storage_server_types.rb +50 -0
- data/lib/morpheus/cli/commands/storage_servers.rb +122 -0
- data/lib/morpheus/cli/commands/storage_volume_types.rb +50 -0
- data/lib/morpheus/cli/commands/storage_volumes.rb +103 -0
- data/lib/morpheus/cli/{subnets_command.rb → commands/subnets_command.rb} +0 -4
- data/lib/morpheus/cli/{tasks.rb → commands/tasks.rb} +5 -9
- data/lib/morpheus/cli/commands/{standard/tee_command.rb → tee_command.rb} +0 -0
- data/lib/morpheus/cli/{tenants_command.rb → commands/tenants_command.rb} +1 -8
- data/lib/morpheus/cli/commands/{standard/update_command.rb → update_command.rb} +0 -1
- data/lib/morpheus/cli/{usage_command.rb → commands/usage_command.rb} +0 -0
- data/lib/morpheus/cli/{user_groups_command.rb → commands/user_groups_command.rb} +1 -2
- data/lib/morpheus/cli/{user_settings_command.rb → commands/user_settings_command.rb} +3 -2
- data/lib/morpheus/cli/{user_sources_command.rb → commands/user_sources_command.rb} +1 -2
- data/lib/morpheus/cli/{users.rb → commands/users.rb} +28 -35
- data/lib/morpheus/cli/{vdi_allocations_command.rb → commands/vdi_allocations_command.rb} +0 -0
- data/lib/morpheus/cli/{vdi_apps_command.rb → commands/vdi_apps_command.rb} +0 -0
- data/lib/morpheus/cli/{vdi_command.rb → commands/vdi_command.rb} +0 -0
- data/lib/morpheus/cli/{vdi_gateways_command.rb → commands/vdi_gateways_command.rb} +0 -0
- data/lib/morpheus/cli/{vdi_pools_command.rb → commands/vdi_pools_command.rb} +0 -0
- data/lib/morpheus/cli/commands/{standard/version_command.rb → version_command.rb} +0 -0
- data/lib/morpheus/cli/commands/view.rb +102 -0
- data/lib/morpheus/cli/{virtual_images.rb → commands/virtual_images.rb} +4 -5
- data/lib/morpheus/cli/{whitelabel_settings_command.rb → commands/whitelabel_settings_command.rb} +0 -1
- data/lib/morpheus/cli/{whoami.rb → commands/whoami.rb} +0 -4
- data/lib/morpheus/cli/{wiki_command.rb → commands/wiki_command.rb} +0 -5
- data/lib/morpheus/cli/{workflows.rb → commands/workflows.rb} +0 -3
- data/lib/morpheus/cli/mixins/accounts_helper.rb +5 -5
- data/lib/morpheus/cli/mixins/load_balancers_helper.rb +24 -4
- data/lib/morpheus/cli/mixins/logs_helper.rb +1 -1
- data/lib/morpheus/cli/mixins/print_helper.rb +51 -18
- data/lib/morpheus/cli/mixins/processes_helper.rb +1 -2
- data/lib/morpheus/cli/mixins/provisioning_helper.rb +96 -6
- data/lib/morpheus/cli/mixins/rest_command.rb +222 -62
- data/lib/morpheus/cli/mixins/secondary_rest_command.rb +249 -70
- data/lib/morpheus/cli/mixins/storage_servers_helper.rb +156 -0
- data/lib/morpheus/cli/mixins/storage_volumes_helper.rb +119 -0
- data/lib/morpheus/cli/option_types.rb +150 -46
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli.rb +5 -135
- data/lib/morpheus/ext/string.rb +29 -6
- data/lib/morpheus/routes.rb +238 -0
- data/lib/morpheus/terminal.rb +5 -6
- data/lib/morpheus/util.rb +6 -1
- metadata +174 -144
- data/lib/morpheus/cli/change_password_command.rb +0 -147
- data/lib/morpheus/cli/library.rb +0 -1
- data/lib/morpheus/cli/load_balancer_pools.rb +0 -111
- data/lib/morpheus/cli/load_balancers.rb +0 -90
- data/lib/morpheus/cli/logout.rb +0 -81
|
@@ -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
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
|
2
|
+
|
|
3
|
+
class Morpheus::Cli::StorageServerTypes
|
|
4
|
+
include Morpheus::Cli::CliCommand
|
|
5
|
+
include Morpheus::Cli::RestCommand
|
|
6
|
+
include Morpheus::Cli::StorageServersHelper
|
|
7
|
+
|
|
8
|
+
set_command_description "View storage server types"
|
|
9
|
+
set_command_name :'storage-server-types'
|
|
10
|
+
register_subcommands :list, :get
|
|
11
|
+
|
|
12
|
+
# register_interfaces :storage_server_types
|
|
13
|
+
|
|
14
|
+
protected
|
|
15
|
+
|
|
16
|
+
def storage_server_type_list_column_definitions(options)
|
|
17
|
+
{
|
|
18
|
+
"ID" => 'id',
|
|
19
|
+
"Name" => 'name',
|
|
20
|
+
"Code" => 'code',
|
|
21
|
+
"Description" => 'description',
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def storage_server_type_column_definitions(options)
|
|
26
|
+
{
|
|
27
|
+
"ID" => 'id',
|
|
28
|
+
"Name" => 'name',
|
|
29
|
+
"Code" => 'code',
|
|
30
|
+
"Description" => 'description',
|
|
31
|
+
"Creatable" => lambda {|it| format_boolean(it['creatable']) },
|
|
32
|
+
"Create Namespaces" => lambda {|it| format_boolean(it['createNamespaces']) },
|
|
33
|
+
"Create Groups" => lambda {|it| format_boolean(it['createGroups']) },
|
|
34
|
+
"Create Hosts" => lambda {|it| format_boolean(it['createHosts']) },
|
|
35
|
+
"Create Disks" => lambda {|it| format_boolean(it['createDisks']) },
|
|
36
|
+
"Has Namespaces" => lambda {|it| format_boolean(it['hasNamespaces']) },
|
|
37
|
+
"Has Groups" => lambda {|it| format_boolean(it['hasGroups']) },
|
|
38
|
+
"Has Hosts" => lambda {|it| format_boolean(it['hasHosts']) },
|
|
39
|
+
"Has Disks" => lambda {|it| format_boolean(it['hasDisks']) },
|
|
40
|
+
"Has File Browser" => lambda {|it| format_boolean(it['hasFileBrowser']) },
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# overridden to support name or code
|
|
45
|
+
def find_storage_server_type_by_name_or_id(name)
|
|
46
|
+
storage_server_type_for_name_or_id(name)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
|
2
|
+
|
|
3
|
+
class Morpheus::Cli::StorageServers
|
|
4
|
+
include Morpheus::Cli::CliCommand
|
|
5
|
+
include Morpheus::Cli::RestCommand
|
|
6
|
+
include Morpheus::Cli::StorageServersHelper
|
|
7
|
+
|
|
8
|
+
set_command_name :'storage-servers'
|
|
9
|
+
set_command_description "View and manage storage servers."
|
|
10
|
+
register_subcommands :list, :get, :add, :update, :remove
|
|
11
|
+
|
|
12
|
+
# RestCommand settings
|
|
13
|
+
register_interfaces :storage_servers, :storage_server_types
|
|
14
|
+
set_rest_has_type true
|
|
15
|
+
# set_rest_type :storage_server_types
|
|
16
|
+
|
|
17
|
+
def render_response_for_get(json_response, options)
|
|
18
|
+
render_response(json_response, options, rest_object_key) do
|
|
19
|
+
record = json_response[rest_object_key]
|
|
20
|
+
print_h1 rest_label, [], options
|
|
21
|
+
print cyan
|
|
22
|
+
print_description_list(rest_column_definitions(options), record, options)
|
|
23
|
+
# show Storage Server Configuration
|
|
24
|
+
config = record['config']
|
|
25
|
+
if config && !config.empty?
|
|
26
|
+
print_h2 "Configuration"
|
|
27
|
+
print_description_list(config.keys, config)
|
|
28
|
+
end
|
|
29
|
+
print reset,"\n"
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
protected
|
|
34
|
+
|
|
35
|
+
def storage_server_list_column_definitions(options)
|
|
36
|
+
{
|
|
37
|
+
"ID" => 'id',
|
|
38
|
+
"Name" => 'name',
|
|
39
|
+
"Type" => lambda {|it| it['type'] ? it['type']['name'] : '' },
|
|
40
|
+
"Service URL" => lambda {|it| it['serviceUrl'] },
|
|
41
|
+
"Tenants" => lambda {|it|
|
|
42
|
+
if it['tenants'] && !it['tenants'].empty?
|
|
43
|
+
it['tenants'].collect {|account| account['name'] }.join(', ')
|
|
44
|
+
else
|
|
45
|
+
it['owner'] ? it['owner']['name'] : (it['account'] ? it['account']['name'] : nil)
|
|
46
|
+
end
|
|
47
|
+
},
|
|
48
|
+
"Status" => lambda {|it| format_storage_server_status(it) },
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def storage_server_column_definitions(options)
|
|
53
|
+
{
|
|
54
|
+
"ID" => 'id',
|
|
55
|
+
"Name" => 'name',
|
|
56
|
+
"Description" => 'description',
|
|
57
|
+
"Type" => lambda {|it| it['type'] ? it['type']['name'] : '' },
|
|
58
|
+
"Service URL" => lambda {|it| it['serviceUrl'] },
|
|
59
|
+
"Service Username" => lambda {|it| it['serviceUsername'] },
|
|
60
|
+
"Tenants" => lambda {|it| it['tenants'].collect {|account| account['name'] }.join(', ') },
|
|
61
|
+
"Owner" => lambda {|it| it['owner'] ? it['owner']['name'] : (it['account'] ? it['account']['name'] : nil) },
|
|
62
|
+
"Enabled" => lambda {|it| format_boolean(it['enabled']) },
|
|
63
|
+
"Status" => lambda {|it| format_storage_server_status(it) },
|
|
64
|
+
"Created" => lambda {|it| format_local_dt(it['dateCreated']) },
|
|
65
|
+
"Updated" => lambda {|it| format_local_dt(it['lastUpdated']) }
|
|
66
|
+
}
|
|
67
|
+
end
|
|
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
|
+
def add_storage_server_option_types()
|
|
76
|
+
[
|
|
77
|
+
{'fieldName' => 'name', 'fieldLabel' => 'Name', 'type' => 'text', 'required' => true},
|
|
78
|
+
{'fieldName' => 'description', 'fieldLabel' => 'Description', 'type' => 'text', 'required' => false},
|
|
79
|
+
{'fieldName' => 'enabled', 'fieldLabel' => 'Enabled', 'type' => 'checkbox', 'required' => false, 'defaultValue' => true},
|
|
80
|
+
# {'fieldName' => 'type', 'fieldLabel' => 'Storage Server Type', 'type' => 'select', 'optionSource' => 'storageServerTypes', 'required' => true},
|
|
81
|
+
]
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def add_storage_server_advanced_option_types()
|
|
85
|
+
[
|
|
86
|
+
{'fieldName' => 'visibility', 'fieldLabel' => 'Visibility', 'fieldGroup' => 'Advanced', 'type' => 'select', 'selectOptions' => [{'name' => 'Private', 'value' => 'private'},{'name' => 'Public', 'value' => 'public'}], 'required' => false, 'description' => 'Visibility', 'category' => 'permissions'},
|
|
87
|
+
{'fieldName' => 'tenants', 'fieldLabel' => 'Tenants', 'fieldGroup' => 'Advanced', 'type' => 'multiSelect', 'optionSource' => lambda { |api_client, api_params|
|
|
88
|
+
api_client.options.options_for_source("allTenants", {})['data']
|
|
89
|
+
}},
|
|
90
|
+
]
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def update_storage_server_option_types()
|
|
94
|
+
[
|
|
95
|
+
{'fieldName' => 'name', 'fieldLabel' => 'Name', 'type' => 'text'},
|
|
96
|
+
{'fieldName' => 'description', 'fieldLabel' => 'Description', 'type' => 'text'},
|
|
97
|
+
{'fieldName' => 'enabled', 'fieldLabel' => 'Enabled', 'type' => 'checkbox'},
|
|
98
|
+
]
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def update_storage_server_advanced_option_types()
|
|
102
|
+
add_storage_server_advanced_option_types()
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def format_storage_server_status(storage_server, return_color=cyan)
|
|
106
|
+
out = ""
|
|
107
|
+
status_string = storage_server['status']
|
|
108
|
+
if storage_server['enabled'] == false
|
|
109
|
+
out << "#{red}DISABLED#{return_color}"
|
|
110
|
+
elsif status_string.nil? || status_string.empty? || status_string == "unknown"
|
|
111
|
+
out << "#{white}UNKNOWN#{return_color}"
|
|
112
|
+
elsif status_string == 'ok'
|
|
113
|
+
out << "#{green}#{status_string.upcase}#{return_color}"
|
|
114
|
+
elsif status_string == 'syncing'
|
|
115
|
+
out << "#{yellow}#{status_string.upcase}#{return_color}"
|
|
116
|
+
else
|
|
117
|
+
out << "#{red}#{status_string ? status_string.upcase : 'N/A'}#{storage_server['statusMessage'] ? "#{return_color} - #{storage_server['statusMessage']}" : ''}#{return_color}"
|
|
118
|
+
end
|
|
119
|
+
out
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
|
2
|
+
|
|
3
|
+
class Morpheus::Cli::StorageVolumeTypes
|
|
4
|
+
include Morpheus::Cli::CliCommand
|
|
5
|
+
include Morpheus::Cli::RestCommand
|
|
6
|
+
include Morpheus::Cli::StorageVolumesHelper
|
|
7
|
+
|
|
8
|
+
set_command_name :'storage-volume-types'
|
|
9
|
+
register_subcommands :list, :get
|
|
10
|
+
|
|
11
|
+
# register_interfaces :storage_volume_types
|
|
12
|
+
|
|
13
|
+
protected
|
|
14
|
+
|
|
15
|
+
def build_list_options(opts, options, params)
|
|
16
|
+
opts.on('--name VALUE', String, "Filter by name") do |val|
|
|
17
|
+
params['name'] = val
|
|
18
|
+
end
|
|
19
|
+
opts.on('--category VALUE', String, "Filter by category") do |val|
|
|
20
|
+
params['category'] = val
|
|
21
|
+
end
|
|
22
|
+
# build_standard_list_options(opts, options)
|
|
23
|
+
super
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def storage_volume_type_list_column_definitions(options)
|
|
27
|
+
{
|
|
28
|
+
"ID" => 'id',
|
|
29
|
+
"Name" => 'name',
|
|
30
|
+
"Code" => 'code',
|
|
31
|
+
"Description" => 'description',
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def storage_volume_type_column_definitions(options)
|
|
36
|
+
{
|
|
37
|
+
"ID" => 'id',
|
|
38
|
+
"Name" => 'name',
|
|
39
|
+
"Code" => 'code',
|
|
40
|
+
"Description" => 'description',
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# overridden to support name or code
|
|
45
|
+
def find_storage_volume_type_by_name_or_id(name)
|
|
46
|
+
storage_volume_type_for_name_or_id(name)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
|
2
|
+
|
|
3
|
+
class Morpheus::Cli::StorageVolumes
|
|
4
|
+
include Morpheus::Cli::CliCommand
|
|
5
|
+
include Morpheus::Cli::RestCommand
|
|
6
|
+
include Morpheus::Cli::StorageVolumesHelper
|
|
7
|
+
|
|
8
|
+
set_command_name :'storage-volumes'
|
|
9
|
+
set_command_description "View and manage storage volumes."
|
|
10
|
+
register_subcommands %w{list get add remove}
|
|
11
|
+
|
|
12
|
+
# RestCommand settings
|
|
13
|
+
register_interfaces :storage_volumes, :storage_volume_types
|
|
14
|
+
set_rest_has_type true
|
|
15
|
+
|
|
16
|
+
protected
|
|
17
|
+
|
|
18
|
+
def build_list_options(opts, options, params)
|
|
19
|
+
opts.on('--storage-server VALUE', String, "Storage Server Name or ID") do |val|
|
|
20
|
+
options[:storage_server] = val
|
|
21
|
+
end
|
|
22
|
+
opts.on('-t', '--type TYPE', "Filter by type") do |val|
|
|
23
|
+
params['type'] = val
|
|
24
|
+
end
|
|
25
|
+
opts.on('--name VALUE', String, "Filter by name") do |val|
|
|
26
|
+
params['name'] = val
|
|
27
|
+
end
|
|
28
|
+
opts.on('--category VALUE', String, "Filter by category") do |val|
|
|
29
|
+
params['category'] = val
|
|
30
|
+
end
|
|
31
|
+
# build_standard_list_options(opts, options)
|
|
32
|
+
super
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def parse_list_options!(args, options, params)
|
|
36
|
+
parse_parameter_as_resource_id!(:storage_server, options, params)
|
|
37
|
+
super
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def storage_volume_list_column_definitions(options)
|
|
41
|
+
{
|
|
42
|
+
"ID" => 'id',
|
|
43
|
+
"Name" => 'name',
|
|
44
|
+
"Type" => lambda {|it| it['type'] ? it['type']['name'] : '' },
|
|
45
|
+
"Source" => lambda {|it| format_storage_volume_source(it) },
|
|
46
|
+
"Storage" => lambda {|it| format_bytes(it['maxStorage']) },
|
|
47
|
+
"Status" => lambda {|it| format_storage_volume_status(it) },
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def storage_volume_column_definitions(options)
|
|
52
|
+
{
|
|
53
|
+
"ID" => 'id',
|
|
54
|
+
"Name" => 'name',
|
|
55
|
+
"Description" => 'description',
|
|
56
|
+
"Type" => lambda {|it| it['type'] ? it['type']['name'] : '' },
|
|
57
|
+
"Owner" => lambda {|it| it['owner'] ? it['owner']['name'] : (it['account'] ? it['account']['name'] : nil) },
|
|
58
|
+
"Cloud" => lambda {|it| it['zone']['name'] rescue '' },
|
|
59
|
+
"Datastore" => lambda {|it| it['datastore']['name'] rescue '' },
|
|
60
|
+
"Storage Group" => lambda {|it| it['storageGroup']['name'] rescue '' },
|
|
61
|
+
"Storage Server" => lambda {|it| it['storageServer']['name'] rescue '' },
|
|
62
|
+
"Source" => lambda {|it| format_storage_volume_source(it) },
|
|
63
|
+
"Storage" => lambda {|it| format_bytes(it['maxStorage']) },
|
|
64
|
+
"Status" => lambda {|it| format_storage_volume_status(it) },
|
|
65
|
+
}
|
|
66
|
+
end
|
|
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
|
+
def add_storage_volume_option_types()
|
|
75
|
+
[
|
|
76
|
+
{'fieldContext' => 'storageServer', 'fieldName' => 'id', 'fieldLabel' => 'Storage Server', 'type' => 'select', 'optionSource' => 'storageServers', 'optionParams' => {'createType' => 'block'}, 'required' => true},
|
|
77
|
+
{'fieldContext' => 'storageGroup', 'fieldName' => 'id', 'fieldLabel' => 'Storage Group', 'type' => 'select', 'optionSource' => 'storageGroups', 'required' => true},
|
|
78
|
+
{'shorthand' => '-t', 'fieldName' => 'type', 'fieldLabel' => 'Storage Volume Type', 'type' => 'select', 'optionSource' => 'storageVolumeTypes', 'required' => true},
|
|
79
|
+
{'fieldName' => 'name', 'fieldLabel' => 'Name', 'type' => 'text', 'required' => true},
|
|
80
|
+
]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def update_storage_volume_option_types()
|
|
84
|
+
[
|
|
85
|
+
{'fieldName' => 'name', 'fieldLabel' => 'Name', 'type' => 'text'},
|
|
86
|
+
]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def load_option_types_for_storage_volume(type_record, parent_record)
|
|
90
|
+
storage_volume_type = type_record
|
|
91
|
+
option_types = storage_volume_type['optionTypes']
|
|
92
|
+
# ughhh, all this to change a label for API which uses bytes and not MB
|
|
93
|
+
if option_types
|
|
94
|
+
size_option_type = option_types.find {|it| it['fieldName'] == 'maxStorage' }
|
|
95
|
+
if size_option_type
|
|
96
|
+
#size_option_type['fieldLabel'] = "Volume Size (bytes)"
|
|
97
|
+
size_option_type['fieldAddOn'] = "bytes"
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
return option_types
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
end
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
# require 'yaml'
|
|
2
|
-
require 'io/console'
|
|
3
|
-
require 'rest_client'
|
|
4
|
-
require 'optparse'
|
|
5
1
|
require 'morpheus/cli/cli_command'
|
|
6
2
|
|
|
7
3
|
class Morpheus::Cli::Tasks
|
|
@@ -183,7 +179,7 @@ class Morpheus::Cli::Tasks
|
|
|
183
179
|
task_option_config = {}
|
|
184
180
|
task_option_columns = []
|
|
185
181
|
task_type['optionTypes'].sort { |x,y| x['displayOrder'].to_i <=> y['displayOrder'].to_i }.each do |optionType|
|
|
186
|
-
if optionType['
|
|
182
|
+
if optionType['code'] == 'script'
|
|
187
183
|
script_content = task['taskOptions'][optionType['fieldName']]
|
|
188
184
|
elsif optionType['fieldName'] == 'httpHeaders' || optionType['fieldName'] == 'webHeaders'
|
|
189
185
|
http_headers = task['taskOptions']['httpHeaders'] || task['taskOptions']['webHeaders']
|
|
@@ -557,11 +553,11 @@ class Morpheus::Cli::Tasks
|
|
|
557
553
|
payload['task']['retryCount'] = v_prompt['retryCount'].to_i unless v_prompt['retryCount'].nil?
|
|
558
554
|
end
|
|
559
555
|
# Retry Delay
|
|
560
|
-
if options[:options]['
|
|
561
|
-
payload['task']['
|
|
556
|
+
if options[:options]['retryDelaySeconds']
|
|
557
|
+
payload['task']['retryDelaySeconds'] = options[:options]['retryDelaySeconds'].to_i
|
|
562
558
|
else
|
|
563
|
-
v_prompt = Morpheus::Cli::OptionTypes.prompt([{'fieldName' => '
|
|
564
|
-
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?
|
|
565
561
|
end
|
|
566
562
|
end
|
|
567
563
|
|
|
File without changes
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
# require 'yaml'
|
|
2
|
-
require 'io/console'
|
|
3
|
-
require 'rest_client'
|
|
4
|
-
require 'optparse'
|
|
5
1
|
require 'morpheus/cli/cli_command'
|
|
6
|
-
require 'morpheus/cli/option_types'
|
|
7
|
-
require 'morpheus/cli/mixins/accounts_helper'
|
|
8
|
-
require 'json'
|
|
9
2
|
|
|
10
3
|
class Morpheus::Cli::TenantsCommand
|
|
11
4
|
include Morpheus::Cli::CliCommand
|
|
@@ -25,7 +18,7 @@ class Morpheus::Cli::TenantsCommand
|
|
|
25
18
|
|
|
26
19
|
def connect(opts)
|
|
27
20
|
@api_client = establish_remote_appliance_connection(opts)
|
|
28
|
-
@
|
|
21
|
+
@account_users_interface = @api_client.account_users
|
|
29
22
|
@accounts_interface = @api_client.accounts
|
|
30
23
|
@roles_interface = @api_client.roles
|
|
31
24
|
end
|
|
File without changes
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
require 'morpheus/cli/cli_command'
|
|
2
|
-
require 'morpheus/cli/mixins/accounts_helper'
|
|
3
2
|
|
|
4
3
|
class Morpheus::Cli::UserGroupsCommand
|
|
5
4
|
include Morpheus::Cli::CliCommand
|
|
@@ -13,7 +12,7 @@ class Morpheus::Cli::UserGroupsCommand
|
|
|
13
12
|
def connect(opts)
|
|
14
13
|
@api_client = establish_remote_appliance_connection(opts)
|
|
15
14
|
@user_groups_interface = @api_client.user_groups
|
|
16
|
-
@
|
|
15
|
+
@account_users_interface = @api_client.account_users
|
|
17
16
|
@accounts_interface = @api_client.accounts
|
|
18
17
|
end
|
|
19
18
|
|
|
@@ -17,7 +17,8 @@ class Morpheus::Cli::UserSettingsCommand
|
|
|
17
17
|
def connect(opts)
|
|
18
18
|
@api_client = establish_remote_appliance_connection(opts)
|
|
19
19
|
@user_settings_interface = @api_client.user_settings
|
|
20
|
-
@
|
|
20
|
+
@accounts_interface = @api_client.accounts
|
|
21
|
+
@account_users_interface = @api_client.account_users
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
def handle(args)
|
|
@@ -802,7 +803,7 @@ EOT
|
|
|
802
803
|
{'fieldName' => 'windowsPassword', 'fieldLabel' => 'Windows Password', 'type' => 'password'},
|
|
803
804
|
{'fieldName' => 'defaultGroup', 'fieldLabel' => 'Default Group ID', 'type' => 'text'},
|
|
804
805
|
{'fieldName' => 'defaultCloud', 'fieldLabel' => 'Default Cloud ID', 'type' => 'text'},
|
|
805
|
-
{'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'},
|
|
806
807
|
{'switch' => 'change-password', 'fieldName' => 'password', 'fieldLabel' => 'Password', 'type' => 'password', 'description' => 'Change user credentials to use a new password'},
|
|
807
808
|
{'fieldName' => 'avatar', 'fieldLabel' => 'Avatar', 'type' => 'file', 'description' => 'Local filepath of image file to upload as user avatar'},
|
|
808
809
|
{'fieldName' => 'desktopBackground', 'fieldLabel' => 'Desktop Background', 'type' => 'file', 'description' => 'Local filepath of image file to upload as user desktop background'},
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
require 'morpheus/cli/cli_command'
|
|
2
|
-
require 'morpheus/cli/mixins/accounts_helper'
|
|
3
2
|
|
|
4
3
|
class Morpheus::Cli::UserSourcesCommand
|
|
5
4
|
include Morpheus::Cli::CliCommand
|
|
@@ -22,7 +21,7 @@ class Morpheus::Cli::UserSourcesCommand
|
|
|
22
21
|
@api_client = establish_remote_appliance_connection(opts)
|
|
23
22
|
@user_sources_interface = @api_client.user_sources
|
|
24
23
|
@accounts_interface = @api_client.accounts
|
|
25
|
-
@
|
|
24
|
+
@account_users_interface = @api_client.account_users
|
|
26
25
|
end
|
|
27
26
|
|
|
28
27
|
def handle(args)
|