Sha256: df85267f22559bdd1afd003579f2bdfe125904bcfe70c8a8e4add4e6ceaf128a

Contents?: true

Size: 1.92 KB

Versions: 6

Compression:

Stored size: 1.92 KB

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Network Gateway Request
      class Real
        def get_virtual_network_gateway(resource_group_name, network_gateway_name)
          msg = "Getting Virtual Network Gateway #{network_gateway_name} from Resource Group #{resource_group_name}."
          Fog::Logger.debug msg
          begin
            network_gateway = @network_client.virtual_network_gateways.get(resource_group_name, network_gateway_name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          Fog::Logger.debug "Virtual Network Gateway #{network_gateway_name} retrieved successfully."
          network_gateway
        end
      end

      # Mock class for Network Gateway Request
      class Mock
        def get_virtual_network_gateway(*)
          gateway = {
            'name' => 'myvirtualgateway1',
            'id' => '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/microsoft.network/virtualNetworkGateways/myvirtualgateway1',
            'location' => 'West US',
            'tags' => { 'key1' => 'value1' },
            'properties' => {
              'gatewayType' => 'DynamicRouting',
              'gatewaySize' => 'Default',
              'subnet' => {
                'id' => '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/microsoft.network/virtualNetworks/<virtualNetworkName>/subnets/subnet1'
              },
              'vipAddress' => '{vipAddress}',
              'bgpEnabled' => true,
              'vpnClientAddressPool' => ['{vpnClientAddressPoolPrefix}'],
              'defaultSites' => ['mysite1']
            }
          }
          gateway_mapper = Azure::ARM::Network::Models::VirtualNetworkGateway.mapper
          @network_client.deserialize(gateway_mapper, gateway, 'result.body')
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/requests/network/get_virtual_network_gateway.rb
fog-azure-rm-0.1.0 lib/fog/azurerm/requests/network/get_virtual_network_gateway.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/network/get_virtual_network_gateway.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/requests/network/get_virtual_network_gateway.rb
fog-azure-rm-0.0.6 lib/fog/azurerm/requests/network/get_virtual_network_gateway.rb
fog-azure-rm-0.0.5 lib/fog/azurerm/requests/network/get_virtual_network_gateway.rb