morpheus-cli 5.3.3 → 5.4.2
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 +75 -8
- data/lib/morpheus/api/audit_interface.rb +9 -0
- data/lib/morpheus/api/clouds_interface.rb +4 -11
- data/lib/morpheus/api/health_interface.rb +37 -3
- data/lib/morpheus/api/instances_interface.rb +21 -0
- data/lib/morpheus/api/load_balancer_monitors_interface.rb +9 -0
- data/lib/morpheus/api/load_balancer_profiles_interface.rb +9 -0
- data/lib/morpheus/api/load_balancer_virtual_servers_interface.rb +9 -0
- 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 +30 -0
- data/lib/morpheus/api/network_servers_interface.rb +98 -0
- data/lib/morpheus/api/network_static_routes_interface.rb +36 -0
- data/lib/morpheus/api/read_interface.rb +4 -3
- data/lib/morpheus/api/rest_interface.rb +5 -4
- 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/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/api/virtual_servers_interface.rb +9 -0
- data/lib/morpheus/cli/cli_command.rb +262 -14
- 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} +0 -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} +1 -5
- data/lib/morpheus/cli/{clouds.rb → commands/clouds.rb} +22 -47
- data/lib/morpheus/cli/{clusters.rb → commands/clusters.rb} +38 -19
- 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} +15 -25
- 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} +220 -13
- data/lib/morpheus/cli/{integrations_command.rb → commands/integrations_command.rb} +1 -12
- data/lib/morpheus/cli/{invoices_command.rb → commands/invoices_command.rb} +43 -39
- 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} +0 -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} +3 -7
- 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/commands/load_balancer_virtual_servers.rb +147 -0
- 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} +387 -57
- 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 +446 -0
- data/lib/morpheus/cli/commands/network_transport_zones_command.rb +452 -0
- 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} +0 -7
- data/lib/morpheus/cli/{policies_command.rb → commands/policies_command.rb} +1 -8
- 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} +0 -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} +5 -9
- 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} +0 -6
- 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} +0 -0
- 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} +0 -0
- 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/{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} +7 -6
- data/lib/morpheus/cli/{tasks.rb → commands/tasks.rb} +25 -6
- 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} +2 -1
- 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} +2 -4
- 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 +26 -6
- 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 +48 -17
- data/lib/morpheus/cli/mixins/rest_command.rb +270 -94
- data/lib/morpheus/cli/mixins/secondary_rest_command.rb +667 -0
- 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 +149 -40
- data/lib/morpheus/cli/version.rb +1 -1
- data/lib/morpheus/cli.rb +6 -128
- 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 +176 -141
- data/lib/morpheus/cli/change_password_command.rb +0 -147
- data/lib/morpheus/cli/library.rb +0 -1
- data/lib/morpheus/cli/load_balancers.rb +0 -245
- data/lib/morpheus/cli/logout.rb +0 -81
|
@@ -1122,19 +1122,8 @@ EOT
|
|
|
1122
1122
|
|
|
1123
1123
|
def add_integration_object_option_types
|
|
1124
1124
|
[
|
|
1125
|
-
{'code' => 'integrationObject.type', 'shorthand' => '-t', 'switch' => 'type', 'fieldName' => 'type', 'fieldLabel' => 'Type', 'type' => 'select', 'optionSource' => 'integrationObjectTypes', 'required' => true, 'description' => "Integration Object Type eg.
|
|
1125
|
+
{'code' => 'integrationObject.type', 'shorthand' => '-t', 'switch' => 'type', 'fieldName' => 'type', 'fieldLabel' => 'Type', 'type' => 'select', 'optionSource' => 'integrationObjectTypes', 'required' => true, 'description' => "Integration Object Type eg. catalog", 'displayOrder' => 1},
|
|
1126
1126
|
# {'fieldName' => 'name', 'fieldLabel' => 'Name', 'type' => 'text', 'required' => false, 'description' => 'Display Name of the integration object, default is the name of the referenced object', 'displayOrder' => 2},
|
|
1127
|
-
{'dependsOnCode' => 'integrationObject.type:cloud', 'switch' => 'group', 'fieldName' => 'group', 'fieldLabel' => 'Group', 'type' => 'select', 'optionSource' => 'groups', 'required' => true, 'description' => 'Group', 'displayOrder' => 3},
|
|
1128
|
-
{'dependsOnCode' => 'integrationObject.type:cloud', 'switch' => 'cloud', 'fieldName' => 'cloud', 'fieldLabel' => 'Cloud', 'type' => 'select', 'optionSource' => 'clouds', 'required' => true, 'description' => 'Cloud', 'displayOrder' => 4},
|
|
1129
|
-
{'dependsOnCode' => 'integrationObject.type:layout', 'switch' => 'instance-type', 'fieldName' => 'instanceType', 'fieldLabel' => 'Instance Type', 'type' => 'select', 'optionSource' => 'instanceTypes', 'required' => true, 'description' => 'Instance Type', 'displayOrder' => 5},
|
|
1130
|
-
{'dependsOnCode' => 'integrationObject.type:layout', 'switch' => 'technology', 'fieldName' => 'zoneType', 'fieldLabel' => 'Cloud Type', 'type' => 'select', 'optionSource' => 'zoneTypes', 'required' => true, 'description' => 'Cloud Type (Technology)', 'displayOrder' => 5},
|
|
1131
|
-
{'dependsOnCode' => 'integrationObject.type:layout', 'switch' => 'layout', 'fieldName' => 'layout', 'fieldLabel' => 'Layout', 'type' => 'select', 'optionSource' => 'layouts', 'required' => true, 'description' => 'Layout', 'displayOrder' => 6},
|
|
1132
|
-
{'dependsOnCode' => 'integrationObject.type:blueprint', 'fieldName' => 'name', 'fieldLabel' => 'Catalog Item Name', 'type' => 'text', 'required' => true, 'description' => 'Display Name of the integration object', 'displayOrder' => 7},
|
|
1133
|
-
{'dependsOnCode' => 'integrationObject.type:blueprint', 'switch' => 'blueprint', 'fieldName' => 'blueprint', 'fieldLabel' => 'Blueprint', 'type' => 'select', 'optionSource' => 'blueprints', 'required' => true, 'description' => 'Blueprint', 'displayOrder' => 8, 'noParams' => true},
|
|
1134
|
-
{'dependsOnCode' => 'integrationObject.type:blueprint', 'switch' => 'group', 'fieldName' => 'group', 'fieldLabel' => 'Group', 'type' => 'select', 'optionSource' => 'groups', 'required' => true, 'description' => 'Group', 'displayOrder' => 9},
|
|
1135
|
-
{'dependsOnCode' => 'integrationObject.type:blueprint', 'switch' => 'default-cloud', 'fieldName' => 'defaultCloud', 'fieldLabel' => 'Default Cloud', 'type' => 'select', 'optionSource' => 'clouds', 'required' => false, 'description' => 'Default Cloud', 'displayOrder' => 10},
|
|
1136
|
-
{'dependsOnCode' => 'integrationObject.type:blueprint', 'switch' => 'environment', 'fieldName' => 'environment', 'fieldLabel' => 'Environment', 'type' => 'select', 'optionSource' => 'environments', 'required' => false, 'description' => 'Environment', 'displayOrder' => 11},
|
|
1137
|
-
{'dependsOnCode' => 'integrationObject.type:blueprint', 'switch' => 'config', 'fieldName' => 'config', 'fieldLabel' => 'Config', 'type' => 'code-editor', 'required' => true, 'description' => 'Config JSON', 'displayOrder' => 12},
|
|
1138
1127
|
{'dependsOnCode' => 'integrationObject.type:catalog', 'switch' => 'catalog', 'fieldName' => 'catalog', 'fieldLabel' => 'Catalog Item', 'type' => 'select', 'optionSource' => 'catalogItemTypes', 'required' => true, 'description' => 'Catalog Item', 'displayOrder' => 13},
|
|
1139
1128
|
]
|
|
1140
1129
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require 'morpheus/cli/cli_command'
|
|
2
|
-
require 'date'
|
|
2
|
+
require 'date' #needed?
|
|
3
3
|
|
|
4
4
|
class Morpheus::Cli::InvoicesCommand
|
|
5
5
|
include Morpheus::Cli::CliCommand
|
|
@@ -306,20 +306,20 @@ class Morpheus::Cli::InvoicesCommand
|
|
|
306
306
|
|
|
307
307
|
if invoice_totals
|
|
308
308
|
cost_rows = [
|
|
309
|
-
{label: 'Price'.upcase, compute: invoice_totals['actualComputePrice'], memory: invoice_totals['actualMemoryPrice'], storage: invoice_totals['actualStoragePrice'], network: invoice_totals['actualNetworkPrice'], license: invoice_totals['actualLicensePrice'], extra: invoice_totals['actualExtraPrice'], running: invoice_totals['actualRunningPrice'], total: invoice_totals['actualTotalPrice'], currency:
|
|
309
|
+
{label: 'Price'.upcase, compute: invoice_totals['actualComputePrice'], memory: invoice_totals['actualMemoryPrice'], storage: invoice_totals['actualStoragePrice'], network: invoice_totals['actualNetworkPrice'], license: invoice_totals['actualLicensePrice'], extra: invoice_totals['actualExtraPrice'], running: invoice_totals['actualRunningPrice'], total: invoice_totals['actualTotalPrice'], currency: invoice_totals['actualCurrency']},
|
|
310
310
|
]
|
|
311
311
|
if options[:show_costs]
|
|
312
312
|
cost_rows += [
|
|
313
|
-
{label: 'Cost'.upcase, compute: invoice_totals['actualComputeCost'], memory: invoice_totals['actualMemoryCost'], storage: invoice_totals['actualStorageCost'], network: invoice_totals['actualNetworkCost'], license: invoice_totals['actualLicenseCost'], extra: invoice_totals['actualExtraCost'], running: invoice_totals['actualRunningCost'], total: invoice_totals['actualTotalCost'], currency:
|
|
313
|
+
{label: 'Cost'.upcase, compute: invoice_totals['actualComputeCost'], memory: invoice_totals['actualMemoryCost'], storage: invoice_totals['actualStorageCost'], network: invoice_totals['actualNetworkCost'], license: invoice_totals['actualLicenseCost'], extra: invoice_totals['actualExtraCost'], running: invoice_totals['actualRunningCost'], total: invoice_totals['actualTotalCost'], currency: invoice_totals['actualCurrency']}
|
|
314
314
|
]
|
|
315
315
|
end
|
|
316
316
|
if options[:show_estimates]
|
|
317
317
|
cost_rows += [
|
|
318
|
-
{label: 'Metered Price'.upcase, compute: invoice_totals['estimatedComputePrice'], memory: invoice_totals['estimatedMemoryPrice'], storage: invoice_totals['estimatedStoragePrice'], network: invoice_totals['estimatedNetworkPrice'], license: invoice_totals['estimatedLicensePrice'], extra: invoice_totals['estimatedExtraPrice'], running: invoice_totals['estimatedRunningPrice'], total: invoice_totals['estimatedTotalPrice'], currency:
|
|
318
|
+
{label: 'Metered Price'.upcase, compute: invoice_totals['estimatedComputePrice'], memory: invoice_totals['estimatedMemoryPrice'], storage: invoice_totals['estimatedStoragePrice'], network: invoice_totals['estimatedNetworkPrice'], license: invoice_totals['estimatedLicensePrice'], extra: invoice_totals['estimatedExtraPrice'], running: invoice_totals['estimatedRunningPrice'], total: invoice_totals['estimatedTotalPrice'], currency: invoice_totals['estimatedCurrency']}
|
|
319
319
|
]
|
|
320
320
|
if options[:show_costs]
|
|
321
321
|
cost_rows += [
|
|
322
|
-
{label: 'Metered Cost'.upcase, compute: invoice_totals['estimatedComputeCost'], memory: invoice_totals['estimatedMemoryCost'], storage: invoice_totals['estimatedStorageCost'], network: invoice_totals['estimatedNetworkCost'], license: invoice_totals['estimatedLicenseCost'], extra: invoice_totals['estimatedExtraCost'], running: invoice_totals['estimatedRunningCost'], total: invoice_totals['estimatedTotalCost'], currency:
|
|
322
|
+
{label: 'Metered Cost'.upcase, compute: invoice_totals['estimatedComputeCost'], memory: invoice_totals['estimatedMemoryCost'], storage: invoice_totals['estimatedStorageCost'], network: invoice_totals['estimatedNetworkCost'], license: invoice_totals['estimatedLicenseCost'], extra: invoice_totals['estimatedExtraCost'], running: invoice_totals['estimatedRunningCost'], total: invoice_totals['estimatedTotalCost'], currency: invoice_totals['estimatedCurrency']}
|
|
323
323
|
]
|
|
324
324
|
end
|
|
325
325
|
end
|
|
@@ -360,7 +360,7 @@ class Morpheus::Cli::InvoicesCommand
|
|
|
360
360
|
end
|
|
361
361
|
|
|
362
362
|
def get(args)
|
|
363
|
-
options = {}
|
|
363
|
+
options, params = {}, {}
|
|
364
364
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
|
365
365
|
opts.banner = subcommand_usage("[id]")
|
|
366
366
|
opts.on('-a', '--all', "Display all details, costs and prices." ) do
|
|
@@ -381,7 +381,6 @@ class Morpheus::Cli::InvoicesCommand
|
|
|
381
381
|
options[:sigdig] = val.to_i
|
|
382
382
|
end
|
|
383
383
|
build_standard_get_options(opts, options)
|
|
384
|
-
opts.footer = "Get details about a specific invoice."
|
|
385
384
|
opts.footer = <<-EOT
|
|
386
385
|
Get details about a specific invoice.
|
|
387
386
|
[id] is required. This is the id of an invoice.
|
|
@@ -390,32 +389,27 @@ EOT
|
|
|
390
389
|
optparse.parse!(args)
|
|
391
390
|
verify_args!(args:args, optparse:optparse, min:1)
|
|
392
391
|
connect(options)
|
|
392
|
+
params.merge!(parse_query_options(options))
|
|
393
393
|
id_list = parse_id_list(args)
|
|
394
394
|
return run_command_for_each_arg(id_list) do |arg|
|
|
395
|
-
_get(arg, options)
|
|
395
|
+
_get(arg, params, options)
|
|
396
396
|
end
|
|
397
397
|
end
|
|
398
398
|
|
|
399
|
-
def _get(id, options)
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
@invoices_interface.
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
json_response
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
end
|
|
412
|
-
render_result = render_with_format(json_response, options, 'invoice')
|
|
413
|
-
return 0 if render_result
|
|
414
|
-
|
|
399
|
+
def _get(id, params, options)
|
|
400
|
+
@invoices_interface.setopts(options)
|
|
401
|
+
if options[:dry_run]
|
|
402
|
+
print_dry_run @invoices_interface.dry.get(id, params)
|
|
403
|
+
return
|
|
404
|
+
end
|
|
405
|
+
json_response = @invoices_interface.get(id, params)
|
|
406
|
+
if options[:hide_line_items]
|
|
407
|
+
json_response['invoice'].delete('lineItems') rescue nil
|
|
408
|
+
end
|
|
409
|
+
render_response(json_response, options, invoice_object_key) do
|
|
410
|
+
invoice = json_response[invoice_object_key]
|
|
415
411
|
print_h1 "Invoice Details"
|
|
416
412
|
print cyan
|
|
417
|
-
|
|
418
|
-
|
|
419
413
|
description_cols = {
|
|
420
414
|
"Invoice ID" => lambda {|it| it['id'] },
|
|
421
415
|
"Type" => lambda {|it| format_invoice_ref_type(it) },
|
|
@@ -550,15 +544,9 @@ EOT
|
|
|
550
544
|
cost_columns.delete("Extra".upcase)
|
|
551
545
|
end
|
|
552
546
|
print as_pretty_table(cost_rows, cost_columns, options)
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
547
|
print reset,"\n"
|
|
557
|
-
return 0
|
|
558
|
-
rescue RestClient::Exception => e
|
|
559
|
-
print_rest_exception(e, options)
|
|
560
|
-
return 1
|
|
561
548
|
end
|
|
549
|
+
return 0, nil
|
|
562
550
|
end
|
|
563
551
|
|
|
564
552
|
def update(args)
|
|
@@ -618,7 +606,7 @@ Update an invoice.
|
|
|
618
606
|
invoice = json_response['invoice']
|
|
619
607
|
render_response(json_response, options, 'invoice') do
|
|
620
608
|
print_green_success "Updated invoice #{invoice['id']}"
|
|
621
|
-
return _get(invoice["id"], options)
|
|
609
|
+
return _get(invoice["id"], {}, options)
|
|
622
610
|
end
|
|
623
611
|
return 0, nil
|
|
624
612
|
end
|
|
@@ -927,14 +915,13 @@ EOT
|
|
|
927
915
|
end
|
|
928
916
|
|
|
929
917
|
def get_line_item(args)
|
|
930
|
-
options = {}
|
|
918
|
+
options, params = {}, {}
|
|
931
919
|
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
|
932
920
|
opts.banner = subcommand_usage("[id]")
|
|
933
921
|
opts.on('--sigdig DIGITS', "Significant digits when rounding cost values for display as currency. Default is 2. eg. $3.50") do |val|
|
|
934
922
|
options[:sigdig] = val.to_i
|
|
935
923
|
end
|
|
936
924
|
build_standard_get_options(opts, options)
|
|
937
|
-
opts.footer = "Get details about a specific invoice line item."
|
|
938
925
|
opts.footer = <<-EOT
|
|
939
926
|
Get details about a specific invoice line item.
|
|
940
927
|
[id] is required. This is the id of an invoice line item.
|
|
@@ -943,14 +930,15 @@ EOT
|
|
|
943
930
|
optparse.parse!(args)
|
|
944
931
|
verify_args!(args:args, optparse:optparse, min:1)
|
|
945
932
|
connect(options)
|
|
933
|
+
params.merge!(parse_query_options(options))
|
|
946
934
|
id_list = parse_id_list(args)
|
|
947
935
|
return run_command_for_each_arg(id_list) do |arg|
|
|
948
|
-
_get_line_item(arg, options)
|
|
936
|
+
_get_line_item(arg, params, options)
|
|
949
937
|
end
|
|
950
938
|
end
|
|
951
939
|
|
|
952
|
-
|
|
953
|
-
|
|
940
|
+
|
|
941
|
+
def _get_line_item(id, params, options)
|
|
954
942
|
@invoice_line_items_interface.setopts(options)
|
|
955
943
|
if options[:dry_run]
|
|
956
944
|
print_dry_run @invoice_line_items_interface.dry.get(id, params)
|
|
@@ -995,6 +983,22 @@ EOT
|
|
|
995
983
|
|
|
996
984
|
private
|
|
997
985
|
|
|
986
|
+
def invoice_object_key
|
|
987
|
+
'invoice'
|
|
988
|
+
end
|
|
989
|
+
|
|
990
|
+
def invoice_list_key
|
|
991
|
+
'invoices'
|
|
992
|
+
end
|
|
993
|
+
|
|
994
|
+
def invoice_line_item_object_key
|
|
995
|
+
'lineItem'
|
|
996
|
+
end
|
|
997
|
+
|
|
998
|
+
def invoice_line_item_list_key
|
|
999
|
+
'lineItems'
|
|
1000
|
+
end
|
|
1001
|
+
|
|
998
1002
|
# def find_invoice_by_name_or_id(val)
|
|
999
1003
|
# if val.to_s =~ /\A\d{1,}\Z/
|
|
1000
1004
|
# return find_invoice_by_id(val)
|
|
File without changes
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
require 'io/console'
|
|
2
|
-
require 'rest_client'
|
|
3
|
-
require 'optparse'
|
|
4
1
|
require 'morpheus/cli/cli_command'
|
|
5
|
-
require 'morpheus/cli/option_types'
|
|
6
|
-
require 'morpheus/cli/mixins/accounts_helper'
|
|
7
|
-
require 'json'
|
|
8
2
|
|
|
9
3
|
class Morpheus::Cli::KeyPairs
|
|
10
4
|
include Morpheus::Cli::CliCommand
|
|
File without changes
|
data/lib/morpheus/cli/{library_option_lists_command.rb → commands/library_option_lists_command.rb}
RENAMED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
require 'io/console'
|
|
2
|
-
require 'optparse'
|
|
3
|
-
require 'filesize'
|
|
4
1
|
require 'morpheus/cli/cli_command'
|
|
5
|
-
require 'morpheus/cli/mixins/library_helper'
|
|
6
2
|
|
|
7
3
|
class Morpheus::Cli::LibraryOptionListsCommand
|
|
8
4
|
include Morpheus::Cli::CliCommand
|
|
@@ -429,9 +425,9 @@ class Morpheus::Cli::LibraryOptionListsCommand
|
|
|
429
425
|
{'dependsOnCode' => 'optionTypeList.type:ldap', 'fieldName' => 'sourceUsername', 'fieldLabel' => 'Source Username', 'type' => 'text', 'description' => "An LDAP Username for use when type is 'ldap'.", 'displayOrder' => 10},
|
|
430
426
|
{'dependsOnCode' => 'optionTypeList.type:ldap', 'fieldName' => 'sourcePassword', 'fieldLabel' => 'Source Username', 'type' => 'text', 'description' => "An LDAP Password for use when type is 'ldap'.", 'displayOrder' => 11},
|
|
431
427
|
{'dependsOnCode' => 'optionTypeList.type:ldap', 'fieldName' => 'ldapQuery', 'fieldLabel' => 'LDAP Query', 'type' => 'text', 'description' => "LDAP Queries are standard LDAP formatted queries where different objects can be searched. Dependent parameters can be loaded into the query using the <%=phrase%> syntax.", 'displayOrder' => 12},
|
|
432
|
-
{'dependsOnCode' => 'optionTypeList.type:rest|api|manual', 'fieldName' => 'initialDataset', 'fieldLabel' => 'Initial Dataset', 'type' => 'code-editor', 'description' => "Create an initial json dataset to be used as the collection for this option list. It should be a list containing objects with properties 'name', and 'value'. However, if there is a translation script, that will also be passed through.", 'displayOrder' => 13},
|
|
433
|
-
{'dependsOnCode' => 'optionTypeList.type:rest|api|ldap', 'fieldName' => 'translationScript', 'fieldLabel' => 'Translation Script', 'type' => 'code-editor', 'description' => "Create a js script to translate the result data object into an Array containing objects with properties name, and value. The input data is provided as data and the result should be put on the global variable results.", 'displayOrder' => 14},
|
|
434
|
-
{'dependsOnCode' => 'optionTypeList.type:rest|api', 'fieldName' => 'requestScript', 'fieldLabel' => 'Request Script', 'type' => 'code-editor', 'description' => "Create a js script to prepare the request. Return a data object as the body for a post, and return an array containing properties name and value for a get. The input data is provided as data and the result should be put on the global variable results.", 'displayOrder' => 15},
|
|
428
|
+
{'dependsOnCode' => 'optionTypeList.type:rest|api|manual', 'fieldName' => 'initialDataset', 'fieldLabel' => 'Initial Dataset', 'type' => 'code-editor', 'description' => "Create an initial json dataset to be used as the collection for this option list. It should be a list containing objects with properties 'name', and 'value'. However, if there is a translation script, that will also be passed through.", 'displayOrder' => 13, 'dataType' => 'string'},
|
|
429
|
+
{'dependsOnCode' => 'optionTypeList.type:rest|api|ldap', 'fieldName' => 'translationScript', 'fieldLabel' => 'Translation Script', 'type' => 'code-editor', 'description' => "Create a js script to translate the result data object into an Array containing objects with properties name, and value. The input data is provided as data and the result should be put on the global variable results.", 'displayOrder' => 14, 'dataType' => 'string'},
|
|
430
|
+
{'dependsOnCode' => 'optionTypeList.type:rest|api', 'fieldName' => 'requestScript', 'fieldLabel' => 'Request Script', 'type' => 'code-editor', 'description' => "Create a js script to prepare the request. Return a data object as the body for a post, and return an array containing properties name and value for a get. The input data is provided as data and the result should be put on the global variable results.", 'displayOrder' => 15, 'dataType' => 'string'},
|
|
435
431
|
]
|
|
436
432
|
|
|
437
433
|
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
|
2
|
+
|
|
3
|
+
class Morpheus::Cli::LoadBalancerMonitors
|
|
4
|
+
include Morpheus::Cli::CliCommand
|
|
5
|
+
include Morpheus::Cli::RestCommand
|
|
6
|
+
include Morpheus::Cli::SecondaryRestCommand
|
|
7
|
+
include Morpheus::Cli::LoadBalancersHelper
|
|
8
|
+
|
|
9
|
+
set_command_description "View and manage load balancer monitors."
|
|
10
|
+
set_command_name :'load-balancer-monitors'
|
|
11
|
+
register_subcommands :list, :get, :add, :update, :remove
|
|
12
|
+
register_interfaces :load_balancer_monitors,
|
|
13
|
+
:load_balancers, :load_balancer_types
|
|
14
|
+
|
|
15
|
+
set_rest_parent_name :load_balancers
|
|
16
|
+
|
|
17
|
+
# set_rest_interface_name :load_balancer_monitors
|
|
18
|
+
# set_parent_rest_interface_name :load_balancers
|
|
19
|
+
|
|
20
|
+
# todo: a configurable way to load the optionTypes
|
|
21
|
+
# option_types = loadBalancer['monitorOptionTypes']
|
|
22
|
+
# set_rest_has_type true
|
|
23
|
+
# set_rest_type :load_balancer_virtual_server_types
|
|
24
|
+
|
|
25
|
+
protected
|
|
26
|
+
|
|
27
|
+
def load_balancer_monitor_list_column_definitions(options)
|
|
28
|
+
{
|
|
29
|
+
"ID" => 'id',
|
|
30
|
+
"Name" => 'name',
|
|
31
|
+
"Monitor Type" => lambda {|it| it['monitorTypeDisplay'] || it['monitorType'] },
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def load_balancer_monitor_column_definitions(options)
|
|
36
|
+
{
|
|
37
|
+
"ID" => 'id',
|
|
38
|
+
"Name" => 'name',
|
|
39
|
+
"Load Balancer" => lambda {|it| it['loadBalancer'] ? it['loadBalancer']['name'] : '' },
|
|
40
|
+
"Description" => 'description',
|
|
41
|
+
"Monitor Type" => lambda {|it| it['monitorTypeDisplay'] || it['monitorType'] },
|
|
42
|
+
"Created" => lambda {|it| format_local_dt(it['dateCreated']) },
|
|
43
|
+
"Updated" => lambda {|it| format_local_dt(it['lastUpdated']) }
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def load_balancer_monitor_object_key
|
|
48
|
+
'loadBalancerMonitor'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def load_balancer_monitor_list_key
|
|
52
|
+
'loadBalancerMonitors'
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def load_balancer_monitor_label
|
|
56
|
+
'Load Balancer Monitor'
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def load_balancer_monitor_label_plural
|
|
60
|
+
'Load Balancer Monitors'
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def load_option_types_for_load_balancer_monitor(type_record, parent_record)
|
|
64
|
+
load_balancer = parent_record
|
|
65
|
+
load_balancer_type_id = load_balancer['type']['id']
|
|
66
|
+
load_balancer_type = find_by_id(:load_balancer_type, load_balancer_type_id)
|
|
67
|
+
load_balancer_type['monitorOptionTypes']
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
end
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
|
2
|
+
|
|
3
|
+
class Morpheus::Cli::LoadBalancerPools
|
|
4
|
+
include Morpheus::Cli::CliCommand
|
|
5
|
+
include Morpheus::Cli::RestCommand
|
|
6
|
+
include Morpheus::Cli::SecondaryRestCommand
|
|
7
|
+
include Morpheus::Cli::LoadBalancersHelper
|
|
8
|
+
|
|
9
|
+
set_command_description "View and manage load balancer pools."
|
|
10
|
+
set_command_name :'load-balancer-pools'
|
|
11
|
+
register_subcommands :list, :get, :add, :update, :remove
|
|
12
|
+
register_interfaces :load_balancer_pools,
|
|
13
|
+
:load_balancers, :load_balancer_types
|
|
14
|
+
|
|
15
|
+
set_rest_parent_name :load_balancers
|
|
16
|
+
|
|
17
|
+
# set_rest_interface_name :load_balancer_pools
|
|
18
|
+
# set_parent_rest_interface_name :load_balancers
|
|
19
|
+
|
|
20
|
+
# todo: a configurable way to load the optionTypes
|
|
21
|
+
# option_types = loadBalancer['poolOptionTypes']
|
|
22
|
+
# set_rest_has_type true
|
|
23
|
+
# set_rest_type :load_balancer_virtual_server_types
|
|
24
|
+
|
|
25
|
+
protected
|
|
26
|
+
|
|
27
|
+
def load_balancer_pool_list_column_definitions(options)
|
|
28
|
+
{
|
|
29
|
+
"ID" => 'id',
|
|
30
|
+
"Name" => 'name',
|
|
31
|
+
#"Load Balancer" => lambda {|it| it['loadBalancer'] ? it['loadBalancer']['name'] : '' },
|
|
32
|
+
"Balancer Mode" => lambda {|it| it['vipBalance'] },
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def load_balancer_pool_column_definitions(options)
|
|
37
|
+
{
|
|
38
|
+
"ID" => 'id',
|
|
39
|
+
"Name" => 'name',
|
|
40
|
+
"Load Balancer" => lambda {|it| it['loadBalancer'] ? it['loadBalancer']['name'] : '' },
|
|
41
|
+
"Description" => 'description',
|
|
42
|
+
"Balancer Mode" => lambda {|it| it['vipBalance'] },
|
|
43
|
+
# todo: more properties to show here
|
|
44
|
+
"Status" => lambda {|it| format_load_balancer_pool_status(it) },
|
|
45
|
+
"Created" => lambda {|it| format_local_dt(it['dateCreated']) },
|
|
46
|
+
"Updated" => lambda {|it| format_local_dt(it['lastUpdated']) }
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def load_balancer_pool_object_key
|
|
51
|
+
'loadBalancerPool'
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def load_balancer_pool_list_key
|
|
55
|
+
'loadBalancerPools'
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def load_balancer_pool_label
|
|
59
|
+
'Load Balancer Pool'
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def load_balancer_pool_label_plural
|
|
63
|
+
'Load Balancer Pools'
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def format_load_balancer_pool_status(record, return_color=cyan)
|
|
67
|
+
out = ""
|
|
68
|
+
status_string = record['status']
|
|
69
|
+
if status_string.nil? || status_string.empty? || status_string == "unknown"
|
|
70
|
+
out << "#{white}UNKNOWN#{return_color}"
|
|
71
|
+
elsif status_string == 'ok'
|
|
72
|
+
out << "#{green}#{status_string.upcase}#{return_color}"
|
|
73
|
+
elsif status_string == 'syncing'
|
|
74
|
+
out << "#{yellow}#{status_string.upcase}#{return_color}"
|
|
75
|
+
else
|
|
76
|
+
out << "#{red}#{status_string ? status_string.upcase : 'N/A'}#{record['statusMessage'] ? "#{return_color} - #{record['statusMessage']}" : ''}#{return_color}"
|
|
77
|
+
end
|
|
78
|
+
out
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def load_option_types_for_load_balancer_pool(type_record, parent_record)
|
|
82
|
+
load_balancer = parent_record
|
|
83
|
+
load_balancer_type_id = load_balancer['type']['id']
|
|
84
|
+
load_balancer_type = find_by_id(:load_balancer_type, load_balancer_type_id)
|
|
85
|
+
load_balancer_type['poolOptionTypes']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
## using CliCommand's generic find_by methods
|
|
89
|
+
|
|
90
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
|
2
|
+
|
|
3
|
+
class Morpheus::Cli::LoadBalancerProfiles
|
|
4
|
+
include Morpheus::Cli::CliCommand
|
|
5
|
+
include Morpheus::Cli::RestCommand
|
|
6
|
+
include Morpheus::Cli::SecondaryRestCommand
|
|
7
|
+
include Morpheus::Cli::LoadBalancersHelper
|
|
8
|
+
|
|
9
|
+
set_command_description "View and manage load balancer profiles."
|
|
10
|
+
set_command_name :'load-balancer-profiles'
|
|
11
|
+
register_subcommands :list, :get, :add, :update, :remove
|
|
12
|
+
register_interfaces :load_balancer_profiles,
|
|
13
|
+
:load_balancers, :load_balancer_types
|
|
14
|
+
|
|
15
|
+
set_rest_parent_name :load_balancers
|
|
16
|
+
|
|
17
|
+
protected
|
|
18
|
+
|
|
19
|
+
def load_balancer_profile_list_column_definitions(options)
|
|
20
|
+
{
|
|
21
|
+
"ID" => 'id',
|
|
22
|
+
"Name" => 'name',
|
|
23
|
+
# "Profile Type" => lambda {|it| it['config']['profileType'] rescue '' },
|
|
24
|
+
"Service Type" => lambda {|it| it['serviceTypeDisplay'] || it['serviceType'] },
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def load_balancer_profile_column_definitions(options)
|
|
29
|
+
{
|
|
30
|
+
"ID" => 'id',
|
|
31
|
+
"Name" => 'name',
|
|
32
|
+
"Load Balancer" => lambda {|it| it['loadBalancer'] ? it['loadBalancer']['name'] : '' },
|
|
33
|
+
"Description" => 'description',
|
|
34
|
+
# "Profile Type" => lambda {|it| it['config']['profileType'] rescue '' },
|
|
35
|
+
"Service Type" => lambda {|it| it['serviceTypeDisplay'] || it['serviceType'] },
|
|
36
|
+
"Created" => lambda {|it| format_local_dt(it['dateCreated']) },
|
|
37
|
+
"Updated" => lambda {|it| format_local_dt(it['lastUpdated']) }
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def load_balancer_profile_object_key
|
|
42
|
+
'loadBalancerProfile'
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def load_balancer_profile_list_key
|
|
46
|
+
'loadBalancerProfiles'
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def load_balancer_profile_label
|
|
50
|
+
'Load Balancer Profile'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def load_balancer_profile_label_plural
|
|
54
|
+
'Load Balancer Profiles'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def load_option_types_for_load_balancer_profile(type_record, parent_record)
|
|
58
|
+
load_balancer = parent_record
|
|
59
|
+
load_balancer_type_id = load_balancer['type']['id']
|
|
60
|
+
load_balancer_type = find_by_id(:load_balancer_type, load_balancer_type_id)
|
|
61
|
+
load_balancer_type['profileOptionTypes']
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
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::LoadBalancerTypes
|
|
@@ -16,16 +12,21 @@ class Morpheus::Cli::LoadBalancerTypes
|
|
|
16
12
|
|
|
17
13
|
protected
|
|
18
14
|
|
|
19
|
-
def
|
|
15
|
+
def load_balancer_type_list_column_definitions(options)
|
|
20
16
|
{
|
|
21
17
|
"ID" => 'id',
|
|
22
18
|
"Name" => 'name',
|
|
23
|
-
"Code" => 'code'
|
|
19
|
+
"Code" => 'code',
|
|
24
20
|
}
|
|
25
21
|
end
|
|
26
22
|
|
|
27
|
-
def
|
|
28
|
-
|
|
23
|
+
def load_balancer_type_column_definitions(options)
|
|
24
|
+
{
|
|
25
|
+
"ID" => 'id',
|
|
26
|
+
"Name" => 'name',
|
|
27
|
+
"Code" => 'code',
|
|
28
|
+
"Creatable" => lambda {|it| format_boolean(it['creatable']) },
|
|
29
|
+
}
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# overridden to support name or code
|