Class: EdgeGateway

Inherits:
Object
  • Object
show all
Defined in:
lib/vcloud_network_configurator/edge_gateway.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ EdgeGateway

Returns a new instance of EdgeGateway.



7
8
9
10
# File 'lib/vcloud_network_configurator/edge_gateway.rb', line 7

def initialize options
  @options = options
  @vcloud_settings = VcloudSettings.new( { url: @options[:api_url], edge_gateway_uuid: @options[:org_edgegateway_uuid] } )
end

Instance Method Details

#apply_configurationObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/vcloud_network_configurator/edge_gateway.rb', line 12

def apply_configuration
  auth_header = authorize_request
  configure_request = VcloudConfigureRequest.new(@vcloud_settings, auth_header, @options[:component], @options[:rules_files], @options[:interfaces_files])
  configure_request.submit

  if configure_request.success?
    check_for_success auth_header, ConfigureTask.new(configure_request.response_body)
    return true
  else
    abort("Failed to configure the edge gateway")
  end
end