morpheus-cli 5.3.2.3 → 5.4.1
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/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 +39 -5
- 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_images_interface.rb +23 -2
- data/lib/morpheus/api/virtual_servers_interface.rb +9 -0
- data/lib/morpheus/cli/cli_command.rb +274 -19
- data/lib/morpheus/cli/cli_registry.rb +56 -2
- 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} +17 -89
- 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} +170 -138
- data/lib/morpheus/cli/{clouds.rb → commands/clouds.rb} +22 -47
- data/lib/morpheus/cli/{clusters.rb → commands/clusters.rb} +86 -49
- 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} +2 -8
- data/lib/morpheus/cli/{instance_types.rb → commands/instance_types.rb} +0 -3
- data/lib/morpheus/cli/{instances.rb → commands/instances.rb} +473 -150
- data/lib/morpheus/cli/{integrations_command.rb → commands/integrations_command.rb} +0 -0
- data/lib/morpheus/cli/{invoices_command.rb → commands/invoices_command.rb} +118 -134
- 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} +20 -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 +71 -0
- data/lib/morpheus/cli/commands/load_balancer_pools.rb +91 -0
- data/lib/morpheus/cli/commands/load_balancer_profiles.rb +65 -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 +156 -0
- data/lib/morpheus/cli/commands/load_balancers.rb +176 -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} +2 -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} +21 -21
- 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} +4 -1
- 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} +251 -33
- 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 +167 -110
- data/lib/morpheus/cli/mixins/rest_command.rb +268 -94
- data/lib/morpheus/cli/mixins/secondary_rest_command.rb +668 -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_parser.rb +25 -17
- data/lib/morpheus/cli/option_types.rb +137 -52
- 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
- data/morpheus-cli.gemspec +1 -1
- metadata +183 -149
- 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
@@ -0,0 +1,71 @@
|
|
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_hidden
|
10
|
+
set_command_description "View and manage load balancer monitors."
|
11
|
+
set_command_name :'load-balancer-monitors'
|
12
|
+
register_subcommands :list, :get, :add, :update, :remove
|
13
|
+
register_interfaces :load_balancer_monitors,
|
14
|
+
:load_balancers, :load_balancer_types
|
15
|
+
|
16
|
+
set_rest_parent_name :load_balancers
|
17
|
+
|
18
|
+
# set_rest_interface_name :load_balancer_monitors
|
19
|
+
# set_parent_rest_interface_name :load_balancers
|
20
|
+
|
21
|
+
# todo: a configurable way to load the optionTypes
|
22
|
+
# option_types = loadBalancer['monitorOptionTypes']
|
23
|
+
# set_rest_has_type true
|
24
|
+
# set_rest_type :load_balancer_virtual_server_types
|
25
|
+
|
26
|
+
protected
|
27
|
+
|
28
|
+
def load_balancer_monitor_list_column_definitions(options)
|
29
|
+
{
|
30
|
+
"ID" => 'id',
|
31
|
+
"Name" => 'name',
|
32
|
+
"Monitor Type" => lambda {|it| it['monitorTypeDisplay'] || it['monitorType'] },
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def load_balancer_monitor_column_definitions(options)
|
37
|
+
{
|
38
|
+
"ID" => 'id',
|
39
|
+
"Name" => 'name',
|
40
|
+
"Load Balancer" => lambda {|it| it['loadBalancer'] ? it['loadBalancer']['name'] : '' },
|
41
|
+
"Description" => 'description',
|
42
|
+
"Monitor Type" => lambda {|it| it['monitorTypeDisplay'] || it['monitorType'] },
|
43
|
+
"Created" => lambda {|it| format_local_dt(it['dateCreated']) },
|
44
|
+
"Updated" => lambda {|it| format_local_dt(it['lastUpdated']) }
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
def load_balancer_monitor_object_key
|
49
|
+
'loadBalancerMonitor'
|
50
|
+
end
|
51
|
+
|
52
|
+
def load_balancer_monitor_list_key
|
53
|
+
'loadBalancerMonitors'
|
54
|
+
end
|
55
|
+
|
56
|
+
def load_balancer_monitor_label
|
57
|
+
'Load Balancer Monitor'
|
58
|
+
end
|
59
|
+
|
60
|
+
def load_balancer_monitor_label_plural
|
61
|
+
'Load Balancer Monitors'
|
62
|
+
end
|
63
|
+
|
64
|
+
def load_option_types_for_load_balancer_monitor(type_record, parent_record)
|
65
|
+
load_balancer = parent_record
|
66
|
+
load_balancer_type_id = load_balancer['type']['id']
|
67
|
+
load_balancer_type = find_by_id(:load_balancer_type, load_balancer_type_id)
|
68
|
+
load_balancer_type['monitorOptionTypes']
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
@@ -0,0 +1,91 @@
|
|
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_hidden
|
10
|
+
set_command_description "View and manage load balancer pools."
|
11
|
+
set_command_name :'load-balancer-pools'
|
12
|
+
register_subcommands :list, :get, :add, :update, :remove
|
13
|
+
register_interfaces :load_balancer_pools,
|
14
|
+
:load_balancers, :load_balancer_types
|
15
|
+
|
16
|
+
set_rest_parent_name :load_balancers
|
17
|
+
|
18
|
+
# set_rest_interface_name :load_balancer_pools
|
19
|
+
# set_parent_rest_interface_name :load_balancers
|
20
|
+
|
21
|
+
# todo: a configurable way to load the optionTypes
|
22
|
+
# option_types = loadBalancer['poolOptionTypes']
|
23
|
+
# set_rest_has_type true
|
24
|
+
# set_rest_type :load_balancer_virtual_server_types
|
25
|
+
|
26
|
+
protected
|
27
|
+
|
28
|
+
def load_balancer_pool_list_column_definitions(options)
|
29
|
+
{
|
30
|
+
"ID" => 'id',
|
31
|
+
"Name" => 'name',
|
32
|
+
#"Load Balancer" => lambda {|it| it['loadBalancer'] ? it['loadBalancer']['name'] : '' },
|
33
|
+
"Balancer Mode" => lambda {|it| it['vipBalance'] },
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
def load_balancer_pool_column_definitions(options)
|
38
|
+
{
|
39
|
+
"ID" => 'id',
|
40
|
+
"Name" => 'name',
|
41
|
+
"Load Balancer" => lambda {|it| it['loadBalancer'] ? it['loadBalancer']['name'] : '' },
|
42
|
+
"Description" => 'description',
|
43
|
+
"Balancer Mode" => lambda {|it| it['vipBalance'] },
|
44
|
+
# todo: more properties to show here
|
45
|
+
"Status" => lambda {|it| format_load_balancer_pool_status(it) },
|
46
|
+
"Created" => lambda {|it| format_local_dt(it['dateCreated']) },
|
47
|
+
"Updated" => lambda {|it| format_local_dt(it['lastUpdated']) }
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
def load_balancer_pool_object_key
|
52
|
+
'loadBalancerPool'
|
53
|
+
end
|
54
|
+
|
55
|
+
def load_balancer_pool_list_key
|
56
|
+
'loadBalancerPools'
|
57
|
+
end
|
58
|
+
|
59
|
+
def load_balancer_pool_label
|
60
|
+
'Load Balancer Pool'
|
61
|
+
end
|
62
|
+
|
63
|
+
def load_balancer_pool_label_plural
|
64
|
+
'Load Balancer Pools'
|
65
|
+
end
|
66
|
+
|
67
|
+
def format_load_balancer_pool_status(record, return_color=cyan)
|
68
|
+
out = ""
|
69
|
+
status_string = record['status']
|
70
|
+
if status_string.nil? || status_string.empty? || status_string == "unknown"
|
71
|
+
out << "#{white}UNKNOWN#{return_color}"
|
72
|
+
elsif status_string == 'ok'
|
73
|
+
out << "#{green}#{status_string.upcase}#{return_color}"
|
74
|
+
elsif status_string == 'syncing'
|
75
|
+
out << "#{yellow}#{status_string.upcase}#{return_color}"
|
76
|
+
else
|
77
|
+
out << "#{red}#{status_string ? status_string.upcase : 'N/A'}#{record['statusMessage'] ? "#{return_color} - #{record['statusMessage']}" : ''}#{return_color}"
|
78
|
+
end
|
79
|
+
out
|
80
|
+
end
|
81
|
+
|
82
|
+
def load_option_types_for_load_balancer_pool(type_record, parent_record)
|
83
|
+
load_balancer = parent_record
|
84
|
+
load_balancer_type_id = load_balancer['type']['id']
|
85
|
+
load_balancer_type = find_by_id(:load_balancer_type, load_balancer_type_id)
|
86
|
+
load_balancer_type['poolOptionTypes']
|
87
|
+
end
|
88
|
+
|
89
|
+
## using CliCommand's generic find_by methods
|
90
|
+
|
91
|
+
end
|
@@ -0,0 +1,65 @@
|
|
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_hidden
|
10
|
+
set_command_description "View and manage load balancer profiles."
|
11
|
+
set_command_name :'load-balancer-profiles'
|
12
|
+
register_subcommands :list, :get, :add, :update, :remove
|
13
|
+
register_interfaces :load_balancer_profiles,
|
14
|
+
:load_balancers, :load_balancer_types
|
15
|
+
|
16
|
+
set_rest_parent_name :load_balancers
|
17
|
+
|
18
|
+
protected
|
19
|
+
|
20
|
+
def load_balancer_profile_list_column_definitions(options)
|
21
|
+
{
|
22
|
+
"ID" => 'id',
|
23
|
+
"Name" => 'name',
|
24
|
+
# "Profile Type" => lambda {|it| it['config']['profileType'] rescue '' },
|
25
|
+
"Service Type" => lambda {|it| it['serviceTypeDisplay'] || it['serviceType'] },
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
def load_balancer_profile_column_definitions(options)
|
30
|
+
{
|
31
|
+
"ID" => 'id',
|
32
|
+
"Name" => 'name',
|
33
|
+
"Load Balancer" => lambda {|it| it['loadBalancer'] ? it['loadBalancer']['name'] : '' },
|
34
|
+
"Description" => 'description',
|
35
|
+
# "Profile Type" => lambda {|it| it['config']['profileType'] rescue '' },
|
36
|
+
"Service Type" => lambda {|it| it['serviceTypeDisplay'] || it['serviceType'] },
|
37
|
+
"Created" => lambda {|it| format_local_dt(it['dateCreated']) },
|
38
|
+
"Updated" => lambda {|it| format_local_dt(it['lastUpdated']) }
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
def load_balancer_profile_object_key
|
43
|
+
'loadBalancerProfile'
|
44
|
+
end
|
45
|
+
|
46
|
+
def load_balancer_profile_list_key
|
47
|
+
'loadBalancerProfiles'
|
48
|
+
end
|
49
|
+
|
50
|
+
def load_balancer_profile_label
|
51
|
+
'Load Balancer Profile'
|
52
|
+
end
|
53
|
+
|
54
|
+
def load_balancer_profile_label_plural
|
55
|
+
'Load Balancer Profiles'
|
56
|
+
end
|
57
|
+
|
58
|
+
def load_option_types_for_load_balancer_profile(type_record, parent_record)
|
59
|
+
load_balancer = parent_record
|
60
|
+
load_balancer_type_id = load_balancer['type']['id']
|
61
|
+
load_balancer_type = find_by_id(:load_balancer_type, load_balancer_type_id)
|
62
|
+
load_balancer_type['profileOptionTypes']
|
63
|
+
end
|
64
|
+
|
65
|
+
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
|
@@ -0,0 +1,156 @@
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
2
|
+
|
3
|
+
class Morpheus::Cli::LoadBalancerVirtualServers
|
4
|
+
include Morpheus::Cli::CliCommand
|
5
|
+
include Morpheus::Cli::RestCommand
|
6
|
+
include Morpheus::Cli::SecondaryRestCommand
|
7
|
+
include Morpheus::Cli::LoadBalancersHelper
|
8
|
+
|
9
|
+
set_command_hidden
|
10
|
+
set_command_description "View and manage load balancer virtual servers."
|
11
|
+
set_command_name :'load-balancer-virtual-servers'
|
12
|
+
register_subcommands :list, :get, :add, :update, :remove
|
13
|
+
|
14
|
+
register_interfaces :load_balancer_virtual_servers,
|
15
|
+
:load_balancers, :load_balancer_types
|
16
|
+
|
17
|
+
set_rest_parent_name :load_balancers
|
18
|
+
set_rest_arg 'vipName'
|
19
|
+
|
20
|
+
# overridden to provide global list functionality without requiring parent argument
|
21
|
+
def list(args)
|
22
|
+
parent_id, parent_record = nil, nil
|
23
|
+
params = {}
|
24
|
+
options = {}
|
25
|
+
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
26
|
+
opts.banner = subcommand_usage("[#{rest_parent_arg}] [search]")
|
27
|
+
build_list_options(opts, options, params)
|
28
|
+
opts.footer = <<-EOT
|
29
|
+
List #{rest_label_plural.downcase}.
|
30
|
+
[#{rest_parent_arg}] is optional. This is the #{rest_parent_has_name ? 'name or id' : 'id'} of #{a_or_an(rest_parent_label)} #{rest_parent_label.downcase}.
|
31
|
+
[search] is optional. This is a search phrase to filter the results.
|
32
|
+
EOT
|
33
|
+
end
|
34
|
+
optparse.parse!(args)
|
35
|
+
parent_id = args[0]
|
36
|
+
connect(options)
|
37
|
+
if parent_id
|
38
|
+
args = args[1..-1]
|
39
|
+
parent_record = rest_parent_find_by_name_or_id(parent_id)
|
40
|
+
if parent_record.nil?
|
41
|
+
return 1, "#{rest_parent_label} not found for '#{parent_id}"
|
42
|
+
end
|
43
|
+
parent_id = parent_record['id']
|
44
|
+
end
|
45
|
+
parse_list_options!(args, options, params)
|
46
|
+
rest_interface.setopts(options)
|
47
|
+
if options[:dry_run]
|
48
|
+
print_dry_run rest_interface.dry.list(parent_id, params)
|
49
|
+
return
|
50
|
+
end
|
51
|
+
json_response = rest_interface.list(parent_id, params)
|
52
|
+
render_response(json_response, options, rest_list_key) do
|
53
|
+
records = json_response[rest_list_key]
|
54
|
+
print_h1 "Morpheus #{rest_label_plural}"
|
55
|
+
if records.nil? || records.empty?
|
56
|
+
print cyan,"No #{rest_label_plural.downcase} found.",reset,"\n"
|
57
|
+
else
|
58
|
+
print as_pretty_table(records, rest_list_column_definitions(options).upcase_keys!, options)
|
59
|
+
print_results_pagination(json_response) if json_response['meta']
|
60
|
+
end
|
61
|
+
print reset,"\n"
|
62
|
+
end
|
63
|
+
return 0, nil
|
64
|
+
end
|
65
|
+
|
66
|
+
protected
|
67
|
+
|
68
|
+
def build_list_options(opts, options, params)
|
69
|
+
opts.on('--load-balancer LB', String, "Load Balancer Name or ID") do |val|
|
70
|
+
options[:load_balancer] = val
|
71
|
+
end
|
72
|
+
# build_standard_list_options(opts, options)
|
73
|
+
super
|
74
|
+
end
|
75
|
+
|
76
|
+
def parse_list_options!(args, options, params)
|
77
|
+
parse_parameter_as_resource_id!(:load_balancer, options, params)
|
78
|
+
super
|
79
|
+
end
|
80
|
+
|
81
|
+
def load_balancer_virtual_server_list_column_definitions(options)
|
82
|
+
{
|
83
|
+
"ID" => 'id',
|
84
|
+
"Name" => 'vipName',
|
85
|
+
"LB" => lambda {|it| it['loadBalancer'] ? it['loadBalancer']['name'] : '' },
|
86
|
+
# "Description" => 'description',
|
87
|
+
"Instance" => lambda {|it| it['instance'] ? it['instance']['name'] : '(Unassigned)' },
|
88
|
+
"Hostname" => lambda {|it| it['vipHostname'] },
|
89
|
+
"VIP" => lambda {|it| it['vipAddress'] },
|
90
|
+
"Protocol" => lambda {|it| it['vipProtocol'] },
|
91
|
+
"Port" => lambda {|it| it['vipPort'] },
|
92
|
+
"SSL" => lambda {|it| format_boolean(it['sslEnabled']) },
|
93
|
+
"Status" => lambda {|it| format_virtual_server_status(it) },
|
94
|
+
}
|
95
|
+
end
|
96
|
+
|
97
|
+
def load_balancer_virtual_server_column_definitions(options)
|
98
|
+
{
|
99
|
+
"ID" => 'id',
|
100
|
+
"Name" => 'vipName',
|
101
|
+
"Description" => 'description',
|
102
|
+
"LB" => lambda {|it| it['loadBalancer'] ? it['loadBalancer']['name'] : '' },
|
103
|
+
"Instance" => lambda {|it| it['instance'] ? it['instance']['name'] : '(Unassigned)' },
|
104
|
+
"Hostname" => lambda {|it| it['vipHostname'] },
|
105
|
+
"VIP" => lambda {|it| it['vipAddress'] },
|
106
|
+
"Protocol" => lambda {|it| it['vipProtocol'] },
|
107
|
+
"Port" => lambda {|it| it['vipPort'] },
|
108
|
+
"SSL" => lambda {|it| format_boolean(it['sslEnabled']) },
|
109
|
+
# todo: more properties to show here
|
110
|
+
"Status" => lambda {|it| format_virtual_server_status(it) },
|
111
|
+
"Created" => lambda {|it| format_local_dt(it['dateCreated']) },
|
112
|
+
"Updated" => lambda {|it| format_local_dt(it['lastUpdated']) }
|
113
|
+
}
|
114
|
+
end
|
115
|
+
|
116
|
+
def load_balancer_virtual_server_object_key
|
117
|
+
'loadBalancerInstance'
|
118
|
+
end
|
119
|
+
|
120
|
+
def load_balancer_virtual_server_list_key
|
121
|
+
'loadBalancerInstances'
|
122
|
+
end
|
123
|
+
|
124
|
+
def load_balancer_virtual_server_label
|
125
|
+
'Virtual Server'
|
126
|
+
end
|
127
|
+
|
128
|
+
def load_balancer_virtual_server_label_plural
|
129
|
+
'Virtual Servers'
|
130
|
+
end
|
131
|
+
|
132
|
+
def format_virtual_server_status(virtual_server, return_color=cyan)
|
133
|
+
out = ""
|
134
|
+
status_string = virtual_server['vipStatus'] || virtual_server['status']
|
135
|
+
if status_string.nil? || status_string.empty? || status_string == "unknown"
|
136
|
+
out << "#{white}UNKNOWN#{return_color}"
|
137
|
+
elsif status_string == 'online'
|
138
|
+
out << "#{green}#{status_string.upcase}#{return_color}"
|
139
|
+
elsif status_string == 'syncing'
|
140
|
+
out << "#{yellow}#{status_string.upcase}#{return_color}"
|
141
|
+
else
|
142
|
+
out << "#{red}#{status_string ? status_string.upcase : 'N/A'}#{virtual_server['statusMessage'] ? "#{return_color} - #{virtual_server['statusMessage']}" : ''}#{return_color}"
|
143
|
+
end
|
144
|
+
out
|
145
|
+
end
|
146
|
+
|
147
|
+
def load_option_types_for_load_balancer_virtual_server(type_record, parent_record)
|
148
|
+
load_balancer = parent_record
|
149
|
+
load_balancer_type_id = load_balancer['type']['id']
|
150
|
+
load_balancer_type = find_by_id(:load_balancer_type, load_balancer_type_id)
|
151
|
+
load_balancer_type['vipOptionTypes']
|
152
|
+
end
|
153
|
+
|
154
|
+
## using CliCommand's generic find_by methods
|
155
|
+
|
156
|
+
end
|
@@ -0,0 +1,176 @@
|
|
1
|
+
require 'morpheus/cli/cli_command'
|
2
|
+
|
3
|
+
class Morpheus::Cli::LoadBalancers
|
4
|
+
include Morpheus::Cli::CliCommand
|
5
|
+
include Morpheus::Cli::RestCommand
|
6
|
+
include Morpheus::Cli::LoadBalancersHelper
|
7
|
+
|
8
|
+
set_command_hidden
|
9
|
+
set_command_description "View and manage load balancers."
|
10
|
+
set_command_name :'load-balancers'
|
11
|
+
register_subcommands :list, :get, :add, :update, :remove, :refresh
|
12
|
+
|
13
|
+
# deprecated the `load-balancers types` command in 5.3.2, it moved to `load-balancer-types list`
|
14
|
+
register_subcommands :types
|
15
|
+
set_subcommands_hidden :types
|
16
|
+
|
17
|
+
# RestCommand settings
|
18
|
+
register_interfaces :load_balancers, :load_balancer_types
|
19
|
+
set_rest_has_type true
|
20
|
+
# set_rest_type :load_balancer_types
|
21
|
+
|
22
|
+
def render_response_for_get(json_response, options)
|
23
|
+
render_response(json_response, options, rest_object_key) do
|
24
|
+
record = json_response[rest_object_key]
|
25
|
+
print_h1 rest_label, [], options
|
26
|
+
print cyan
|
27
|
+
print_description_list(rest_column_definitions(options), record, options)
|
28
|
+
# show LB Ports
|
29
|
+
ports = record['ports']
|
30
|
+
if ports && ports.size > 0
|
31
|
+
print_h2 "LB Ports", options
|
32
|
+
columns = [
|
33
|
+
{"ID" => 'id'},
|
34
|
+
{"Name" => 'name'},
|
35
|
+
#{"Description" => 'description'},
|
36
|
+
{"Port" => lambda {|it| it['port'] } },
|
37
|
+
{"Protocol" => lambda {|it| it['proxyProtocol'] } },
|
38
|
+
{"SSL" => lambda {|it| it['sslEnabled'] ? "Yes (#{it['sslCert'] ? it['sslCert']['name'] : 'none'})" : "No" } },
|
39
|
+
]
|
40
|
+
print as_pretty_table(ports, columns, options)
|
41
|
+
end
|
42
|
+
print reset,"\n"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def refresh(args)
|
47
|
+
id = args[0]
|
48
|
+
record_type = nil
|
49
|
+
record_type_id = nil
|
50
|
+
options = {}
|
51
|
+
optparse = Morpheus::Cli::OptionParser.new do |opts|
|
52
|
+
opts.banner = subcommand_usage("[#{rest_arg}] [options]")
|
53
|
+
build_standard_update_options(opts, options)
|
54
|
+
opts.footer = <<-EOT
|
55
|
+
Refresh an existing #{rest_label.downcase}.
|
56
|
+
[#{rest_arg}] is required. This is the #{rest_has_name ? 'name or id' : 'id'} of #{a_or_an(rest_label)} #{rest_label.downcase}.
|
57
|
+
EOT
|
58
|
+
end
|
59
|
+
optparse.parse!(args)
|
60
|
+
verify_args!(args:args, optparse:optparse, count:1)
|
61
|
+
connect(options)
|
62
|
+
record = rest_find_by_name_or_id(id)
|
63
|
+
if record.nil?
|
64
|
+
return 1, "#{rest_name} not found for '#{id}'"
|
65
|
+
end
|
66
|
+
passed_options = parse_passed_options(options)
|
67
|
+
payload = {}
|
68
|
+
if options[:payload]
|
69
|
+
payload = options[:payload]
|
70
|
+
payload.deep_merge!({rest_object_key => passed_options}) unless passed_options.empty?
|
71
|
+
else
|
72
|
+
record_payload = passed_options
|
73
|
+
payload[rest_object_key] = record_payload
|
74
|
+
end
|
75
|
+
rest_interface.setopts(options)
|
76
|
+
if options[:dry_run]
|
77
|
+
print_dry_run rest_interface.dry.refresh(record['id'], payload)
|
78
|
+
return
|
79
|
+
end
|
80
|
+
json_response = rest_interface.refresh(record['id'], payload)
|
81
|
+
render_response(json_response, options, rest_object_key) do
|
82
|
+
print_green_success "Refreshing #{rest_label.downcase} #{record['name'] || record['id']}"
|
83
|
+
_get(record["id"], {}, options)
|
84
|
+
end
|
85
|
+
return 0, nil
|
86
|
+
end
|
87
|
+
|
88
|
+
# deprecated, to be removed in the future.
|
89
|
+
def types(args)
|
90
|
+
print_error yellow,"[DEPRECATED] The command `load-balancers types` is deprecated and replaced by `load-balancer-types list`.",reset,"\n"
|
91
|
+
my_terminal.execute("load-balancer-types list #{args.join(' ')}")
|
92
|
+
end
|
93
|
+
|
94
|
+
protected
|
95
|
+
|
96
|
+
def load_balancer_list_column_definitions(options)
|
97
|
+
{
|
98
|
+
"ID" => 'id',
|
99
|
+
"Name" => 'name',
|
100
|
+
"Type" => lambda {|it| it['type'] ? it['type']['name'] : '' },
|
101
|
+
"Cloud" => lambda {|it| it['cloud'] ? it['cloud']['name'] : '' },
|
102
|
+
"Host" => lambda {|it| it['host'] }
|
103
|
+
}
|
104
|
+
end
|
105
|
+
|
106
|
+
def load_balancer_column_definitions(options)
|
107
|
+
{
|
108
|
+
"ID" => 'id',
|
109
|
+
"Name" => 'name',
|
110
|
+
"Description" => 'description',
|
111
|
+
"Type" => lambda {|it| it['type'] ? it['type']['name'] : '' },
|
112
|
+
"Cloud" => lambda {|it| it['cloud'] ? it['cloud']['name'] : '' },
|
113
|
+
"Visibility" => 'visibility',
|
114
|
+
"IP" => 'ip',
|
115
|
+
"Host" => 'host',
|
116
|
+
"Port" => 'port',
|
117
|
+
"Username" => 'username',
|
118
|
+
# "SSL Enabled" => lambda {|it| format_boolean it['sslEnabled'] },
|
119
|
+
# "SSL Cert" => lambda {|it| it['sslCert'] ? it['sslCert']['name'] : '' },
|
120
|
+
# "SSL" => lambda {|it| it['sslEnabled'] ? "Yes (#{it['sslCert'] ? it['sslCert']['name'] : 'none'})" : "No" },
|
121
|
+
"Created" => lambda {|it| format_local_dt(it['dateCreated']) },
|
122
|
+
"Updated" => lambda {|it| format_local_dt(it['lastUpdated']) }
|
123
|
+
}
|
124
|
+
end
|
125
|
+
|
126
|
+
# overridden to work with name or code
|
127
|
+
# nope, api works with name=code now too
|
128
|
+
# def find_load_balancer_type_by_name_or_id(name)
|
129
|
+
# load_balancer_type_for_name_or_id(name)
|
130
|
+
# end
|
131
|
+
|
132
|
+
# def add_load_balancer_option_types()
|
133
|
+
# [
|
134
|
+
# {'fieldName' => 'name', 'fieldLabel' => 'Name', 'type' => 'text', 'required' => true},
|
135
|
+
# {'fieldName' => 'description', 'fieldLabel' => 'Description', 'type' => 'text', 'required' => false},
|
136
|
+
# {'fieldName' => 'enabled', 'fieldLabel' => 'Enabled', 'type' => 'checkbox', 'required' => false, 'defaultValue' => true},
|
137
|
+
# # {'fieldName' => 'type', 'fieldLabel' => 'Storage Server Type', 'type' => 'select', 'optionSource' => 'loadBalancerTypes', 'required' => true},
|
138
|
+
# ]
|
139
|
+
# end
|
140
|
+
|
141
|
+
def add_load_balancer_advanced_option_types()
|
142
|
+
[
|
143
|
+
{'fieldName' => 'visibility', 'fieldLabel' => 'Visibility', 'fieldGroup' => 'Advanced', 'type' => 'select', 'selectOptions' => [{'name' => 'Private', 'value' => 'private'},{'name' => 'Public', 'value' => 'public'}], 'required' => false, 'description' => 'Visibility', 'category' => 'permissions', 'defaultValue' => 'public'},
|
144
|
+
{'fieldName' => 'tenants', 'fieldLabel' => 'Tenants', 'fieldGroup' => 'Advanced', 'type' => 'multiSelect', 'optionSource' => lambda { |api_client, api_params|
|
145
|
+
api_client.options.options_for_source("allTenants", {})['data']
|
146
|
+
}},
|
147
|
+
]
|
148
|
+
end
|
149
|
+
|
150
|
+
# def update_load_balancer_option_types()
|
151
|
+
# [
|
152
|
+
# {'fieldName' => 'name', 'fieldLabel' => 'Name', 'type' => 'text'},
|
153
|
+
# {'fieldName' => 'description', 'fieldLabel' => 'Description', 'type' => 'text'},
|
154
|
+
# {'fieldName' => 'enabled', 'fieldLabel' => 'Enabled', 'type' => 'checkbox'},
|
155
|
+
# ]
|
156
|
+
# end
|
157
|
+
|
158
|
+
def update_load_balancer_advanced_option_types()
|
159
|
+
add_load_balancer_advanced_option_types()
|
160
|
+
end
|
161
|
+
|
162
|
+
def load_option_types_for_load_balancer(type_record, parent_record)
|
163
|
+
load_balancer_type = type_record
|
164
|
+
# reload it by id to get optionTypes
|
165
|
+
option_types = load_balancer_type['optionTypes']
|
166
|
+
if option_types.nil?
|
167
|
+
load_balancer_type = find_by_id(:load_balancer_type, load_balancer_type['id'])
|
168
|
+
if load_balancer_type.nil?
|
169
|
+
raise_command_error("Load balancer type not found for id '#{id}'")
|
170
|
+
end
|
171
|
+
option_types = load_balancer_type['optionTypes']
|
172
|
+
end
|
173
|
+
return option_types
|
174
|
+
end
|
175
|
+
|
176
|
+
end
|
File without changes
|