Sha256: e4c584465681a97bf6d0b484ec95f95fa66c85ba0f17e7a4589ef0ad1d196ff2

Contents?: true

Size: 1.24 KB

Versions: 47

Compression:

Stored size: 1.24 KB

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Network Request
      class Real
        def get_subnet(resource_group, virtual_network_name, subnet_name)
          msg = "Getting Subnet: #{subnet_name}."
          Fog::Logger.debug msg
          begin
            subnet = @network_client.subnets.get(resource_group, virtual_network_name, subnet_name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          Fog::Logger.debug "Subnet #{subnet_name} retrieved successfully."
          subnet
        end
      end

      # Mock class for Network Request
      class Mock
        def get_subnet(*)
          subnet = {
            'id' => '/subscriptions/########-####-####-####-############/resourceGroups/fog-rg/providers/Microsoft.Network/virtualNetworks/fog-vnet/subnets/fog-subnet',
            'properties' =>
              {
                'addressPrefix' => '10.1.0.0/24',
                'provisioningState' => 'Succeeded'
              },
            'name' => 'fog-subnet'
          }
          subnet_mapper = Azure::ARM::Network::Models::Subnet.mapper
          @network_client.deserialize(subnet_mapper, subnet, 'result.body')
        end
      end
    end
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
fog-azure-rm-0.4.1 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.4.0 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/requests/network/get_subnet.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/requests/network/get_subnet.rb