Class: Morpheus::Cli::LoadBalancers
- Inherits:
-
Object
- Object
- Morpheus::Cli::LoadBalancers
- Includes:
- CliCommand, LoadBalancersHelper, RestCommand
- Defined in:
- lib/morpheus/cli/load_balancers.rb
Instance Attribute Summary
Attributes included from CliCommand
Instance Method Summary collapse
-
#render_response_for_get(json_response, options) ⇒ Object
set_rest_type :load_balancer_types.
-
#types(args) ⇒ Object
deprecated, to be removed in the future.
Methods included from LoadBalancersHelper
#find_load_balancer_by_id, #find_load_balancer_by_name, #find_load_balancer_by_name_or_id, #find_load_balancer_type_by_id, #find_load_balancer_type_by_name, #get_available_load_balancer_types, included, #load_balancer_label, #load_balancer_label_plural, #load_balancer_list_key, #load_balancer_object_key, #load_balancer_type_for_id, #load_balancer_type_for_name, #load_balancer_type_for_name_or_id, #load_balancer_type_label, #load_balancer_type_label_plural, #load_balancer_type_list_key, #load_balancer_type_object_key, #load_balancer_types_interface, #load_balancers_interface
Methods included from RestCommand
#_get, #add, #connect, #get, #handle, included, #list, #registered_interfaces, #remove, #rest_arg, #rest_column_definitions, #rest_find_by_name_or_id, #rest_has_type, #rest_interface, #rest_interface_name, #rest_key, #rest_label, #rest_label_plural, #rest_list_column_definitions, #rest_list_key, #rest_name, #rest_object_key, #rest_type_arg, #rest_type_column_definitions, #rest_type_find_by_name_or_id, #rest_type_interface, #rest_type_interface_name, #rest_type_key, #rest_type_label, #rest_type_label_plural, #rest_type_list_column_definitions, #rest_type_list_key, #rest_type_name, #rest_type_object_key, #update
Methods included from CliCommand
#apply_options, #build_common_options, #build_option_type_options, #build_standard_add_options, #build_standard_delete_options, #build_standard_get_options, #build_standard_list_options, #build_standard_post_options, #build_standard_put_options, #build_standard_remove_options, #build_standard_update_options, #command_description, #command_name, #default_refresh_interval, #default_sigdig, #default_subcommand, #establish_remote_appliance_connection, #full_command_usage, #get_subcommand_description, #handle, #handle_subcommand, included, #interactive?, #my_help_command, #my_terminal, #my_terminal=, #parse_bytes_param, #parse_id_list, #parse_list_options, #parse_list_subtitles, #parse_passed_options, #parse_payload, #parse_query_options, #print, #print_error, #println, #prog_name, #puts, #puts_error, #raise_args_error, #raise_command_error, #render_response, #run_command_for_each_arg, #subcommand_aliases, #subcommand_description, #subcommand_usage, #subcommands, #usage, #validate_outfile, #verify_args!, #visible_subcommands
Instance Method Details
#render_response_for_get(json_response, options) ⇒ Object
set_rest_type :load_balancer_types
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/morpheus/cli/load_balancers.rb', line 21 def render_response_for_get(json_response, ) render_response(json_response, , rest_object_key) do record = json_response[rest_object_key] print_h1 rest_label, [], print cyan print_description_list(rest_column_definitions, record, ) # show LB Ports ports = record['ports'] if ports && ports.size > 0 print_h2 "LB Ports", columns = [ {"ID" => 'id'}, {"Name" => 'name'}, #{"Description" => 'description'}, {"Port" => lambda {|it| it['port'] } }, {"Protocol" => lambda {|it| it['proxyProtocol'] } }, {"SSL" => lambda {|it| it['sslEnabled'] ? "Yes (#{it['sslCert'] ? it['sslCert']['name'] : 'none'})" : "No" } }, ] print as_pretty_table(ports, columns, ) end print reset,"\n" end end |
#types(args) ⇒ Object
deprecated, to be removed in the future.
46 47 48 49 |
# File 'lib/morpheus/cli/load_balancers.rb', line 46 def types(args) print_error yellow,"[DEPRECATED] The command `load-balancers types` is deprecated and replaced by `load-balancer-types list`.",reset,"\n" my_terminal.execute("load-balancer-types list #{args.join(' ')}") end |