Sha256: 116ae369fe1709731504a998650e0b1b557e4c041dcb6c9d56fa0c8847263452

Contents?: true

Size: 1.46 KB

Versions: 6

Compression:

Stored size: 1.46 KB

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Network Request
      class Real
        def list_virtual_network_gateways(resource_group)
          msg = "Getting list of Virtual Network Gateway from Resource Group #{resource_group}."
          Fog::Logger.debug msg
          begin
            network_gateways = @network_client.virtual_network_gateways.list_as_lazy(resource_group)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          network_gateways.value
        end
      end

      # Mock class for Network Request
      class Mock
        def list_virtual_network_gateways(*)
          gateway = {
            'value' => [
              {
                'name' => 'myvirtualgateway1',
                'location' => 'West US',
                'tags' => { 'key1' => 'value1' },
                'properties' => {
                  'gatewayType' => 'DynamicRouting',
                  'gatewaySize' => 'Default',
                  'bgpEnabled' => true,
                  'vpnClientAddressPool' => ['{vpnClientAddressPoolPrefix}'],
                  'defaultSites' => ['mysite1']
                }
              }
            ]
          }
          gateway_mapper = Azure::ARM::Network::Models::VirtualNetworkGatewayListResult.mapper
          @network_client.deserialize(gateway_mapper, gateway, 'result.body').value
        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/list_virtual_network_gateways.rb
fog-azure-rm-0.1.0 lib/fog/azurerm/requests/network/list_virtual_network_gateways.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/network/list_virtual_network_gateways.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/requests/network/list_virtual_network_gateways.rb
fog-azure-rm-0.0.6 lib/fog/azurerm/requests/network/list_virtual_network_gateways.rb
fog-azure-rm-0.0.5 lib/fog/azurerm/requests/network/list_virtual_network_gateways.rb