Class: Fog::Network::AzureRM::VirtualNetworkGatewayConnection

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/azurerm/models/network/virtual_network_gateway_connection.rb

Overview

VirtualNetworkGatewayConnection model class for Network Service

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(gateway_connection) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/fog/azurerm/models/network/virtual_network_gateway_connection.rb', line 26

def self.parse(gateway_connection)
  connection = get_hash_from_object(gateway_connection)

  unless gateway_connection.virtual_network_gateway1.nil?
    gateway1 = Fog::Network::AzureRM::VirtualNetworkGateway.new
    connection['virtual_network_gateway1'] = gateway1.merge_attributes(Fog::Network::AzureRM::VirtualNetworkGateway.parse(gateway_connection.virtual_network_gateway1))
  end

  unless gateway_connection.virtual_network_gateway2.nil?
    gateway2 = Fog::Network::AzureRM::VirtualNetworkGateway.new
    connection['virtual_network_gateway2'] = gateway2.merge_attributes(Fog::Network::AzureRM::VirtualNetworkGateway.parse(gateway_connection.virtual_network_gateway2))
  end
  connection['resource_group'] = get_resource_group_from_id(gateway_connection.id)
  connection
end

Instance Method Details

#destroyObject



48
49
50
# File 'lib/fog/azurerm/models/network/virtual_network_gateway_connection.rb', line 48

def destroy
  service.delete_virtual_network_gateway_connection(resource_group, name)
end

#saveObject



42
43
44
45
46
# File 'lib/fog/azurerm/models/network/virtual_network_gateway_connection.rb', line 42

def save
  requires :name, :location, :resource_group, :connection_type
  gateway_connection = service.create_or_update_virtual_network_gateway_connection(gateway_connection_parameters)
  merge_attributes(Fog::Network::AzureRM::VirtualNetworkGatewayConnection.parse(gateway_connection))
end