Method: BBGAPI::LB_Services.create

Defined in:
lib/bbgapi/lb_services.rb

.createObject



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/bbgapi/lb_services.rb', line 62

def self.create
  begin
    cur_app = BBGAPI::LB_Applications.get_app
  rescue
    cur_app = self.recurse
  end

  choose do |menu|
    menu.prompt = "HTTP or HTTPS?"
    menu.choices(:http) {service_type="http"}
    menu.choices(:https) {service_type="https"}
  end

  options = { :body => {
    :service_type => service_type
    } }

  partial = "/api/lb_applications/#{cur_app}/lb_services"
  api_response = BBGAPI::Client.posturl(partial,options)
  pp api_response
  #puts "Name:         #{api_response["name"]}"

  puts "\n"
end