Class: Chef::Knife::AzureInternalLbCreate
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::AzureInternalLbCreate
- Includes:
- AzureBase
- Defined in:
- lib/chef/knife/azure_internal-lb_create.rb
Instance Method Summary collapse
Methods included from AzureBase
#fetch_chef_client_logs, #fetch_deployment, #fetch_extension, #fetch_role, #fetch_substatus, #find_file, #get_azure_profile_file_path, #get_default_subscription, included, #is_image_windows?, #locate_config_value, #msg_pair, #msg_server_summary, #parse_azure_profile, #parse_publish_settings_file, #pretty_key, #service, #validate!, #validate_asm_keys!, #validate_params!
Instance Method Details
#run ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/chef/knife/azure_internal-lb_create.rb', line 46 def run $stdout.sync = true Chef::Log.info('validating...') validate_asm_keys!(:azure_load_balancer) params = { azure_load_balancer: locate_config_value(:azure_load_balancer), azure_lb_static_vip: locate_config_value(:azure_lb_static_vip), azure_subnet_name: locate_config_value(:azure_subnet_name), azure_dns_name: locate_config_value(:azure_dns_name) } rsp = service.create_internal_lb(params) print "\n" if rsp.at_css('Status').nil? if rsp.at_css('Code').nil? || rsp.at_css('Message').nil? puts 'Unknown Error. try -VV' else puts "#{rsp.at_css('Code').content}: "\ "#{rsp.at_css('Message').content}" end else puts "Creation status: #{rsp.at_css('Status').content}" end end |