Class: Vcloud::Core::EdgeGatewayInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/vcloud/core/edge_gateway_interface.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gateway_interface_hash) ⇒ Vcloud::Core::EdgeGatewayInterface

Return a new instance of an EdgeGatewayInterface

Parameters:

  • gateway_interface_hash (Hash)

    The configuration of EdgeGatewayInterface



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 11

def initialize(gateway_interface_hash)
  if gateway_interface_hash.nil?
    raise "EdgeGatewayInterface: gateway_interface_hash cannot be nil"
  end
  unless gateway_interface_hash[:Name] && gateway_interface_hash[:Network]
    raise "EdgeGatewayInterface: bad input: #{gateway_interface_hash}"
  end
  @vcloud_gateway_interface = gateway_interface_hash
  @name = gateway_interface_hash[:Name]
  @network_href = gateway_interface_hash[:Network][:href]
  @network_name = gateway_interface_hash[:Network][:name]
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 5

def name
  @name
end

#network_hrefObject

Returns the value of attribute network_href.



5
6
7
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 5

def network_href
  @network_href
end

#network_nameObject

Returns the value of attribute network_name.



5
6
7
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 5

def network_name
  @network_name
end

Instance Method Details

#network_idString

Get the ID of EdgeGatewayInterface from the @network_href

Returns:

  • (String)

    The ID of EdgeGatewayInterface



27
28
29
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 27

def network_id
  network_href.split('/').last
end