Sha256: be13180ad39800773d1dbfd1dd778cb9cd6092f017146510505cb6afa4d0db13

Contents?: true

Size: 1.88 KB

Versions: 47

Compression:

Stored size: 1.88 KB

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Local Network Gateway Request
      class Real
        def list_local_network_gateways(resource_group_name)
          msg = @logger_messages['network']['local_network_gateway']['message']['list']
                .gsub('RESOURCE_GROUP', resource_group_name)
          Fog::Logger.debug msg
          begin
            local_network_gateways = @network_client.local_network_gateways.list_as_lazy(resource_group_name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          local_network_gateways.value
        end
      end

      # Mock class for Local Network Gateway Request
      class Mock
        def list_virtual_network_gateways(*)
          local_network_gateway = {
            'value' => [
              {
                'id' => '/subscriptions/<Subscription_id>/resourceGroups/learn_fog/providers/Microsoft.Network/localNetworkGateways/testLocalNetworkGateway',
                'name' => 'testLocalNetworkGateway',
                'type' => 'Microsoft.Network/localNetworkGateways',
                'location' => 'eastus',
                'properties' =>
                  {
                    'local_network_address_space' => {
                      'address_prefixes' => []
                    },
                    'gateway_ip_address' => '192.168.1.1',
                    'bgp_settings' => {
                      'asn' => 100,
                      'bgp_peering_address' => '192.168.1.2',
                      'peer_weight' => 3
                    }
                  }
              }
            ]
          }
          local_network_gateway_mapper = Azure::ARM::Network::Models::LocalNetworkGatewayListResult.mapper
          @network_client.deserialize(local_network_gateway_mapper, local_network_gateway, 'result.body')
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
fog-azure-rm-0.6.0 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
far-gem-0.5.6 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
far-gem-0.5.5 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
far-gem-0.5.4 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
far-gem-0.5.3 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
far-gem-0.5.2 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
far-gem-0.5.1 lib/fog/azurerm/requests/network/list_local_network_gateways.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/requests/network/list_local_network_gateways.rb