Sha256: 8f2445111f9674a20d0a767b30142c4fa674e12116d0d5209001bd37ecd5d3b9

Contents?: true

Size: 1.67 KB

Versions: 47

Compression:

Stored size: 1.67 KB

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Network Request
      class Real
        def get_public_ip(resource_group_name, public_ip_name)
          Fog::Logger.debug "Getting Public IP #{public_ip_name} from Resource Group #{resource_group_name}"
          begin
            public_ip = @network_client.public_ipaddresses.get(resource_group_name, public_ip_name)
            Fog::Logger.debug "Public IP #{public_ip_name} retrieved successfully"
            public_ip
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, "Getting Public IP #{public_ip_name} from Resource Group #{resource_group_name}")
          end
        end
      end

      # Mock class for Network Request
      class Mock
        def get_public_ip(resource_group_name, public_ip_name)
          public_ip = {
            'id' => "/subscriptions/########-####-####-####-############/resourceGroups/#{resource_group_name}/providers/Microsoft.Network/publicIPAddresses/#{public_ip_name}",
            'name' => public_ip_name,
            'type' => 'Microsoft.Network/publicIPAddresses',
            'location' => 'westus',
            'properties' =>
              {
                'publicIPAllocationMethod' => 'Dynamic',
                'ipAddress' => '13.91.253.67',
                'idleTimeoutInMinutes' => 4,
                'resourceGuid' => '767b1955-94de-433c-8e4a-ea0ad25e8d0c',
                'provisioningState' => 'Succeeded'
              }
          }
          public_ip_mapper = Azure::ARM::Network::Models::PublicIPAddress.mapper
          @network_client.deserialize(public_ip_mapper, public_ip, '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_public_ip.rb
fog-azure-rm-0.4.0 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/requests/network/get_public_ip.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/requests/network/get_public_ip.rb