Sha256: 77565b1770694ad3e370f596a467fcf8e1b9f2b7e4fafcd3e7919b575579838f

Contents?: true

Size: 1004 Bytes

Versions: 2

Compression:

Stored size: 1004 Bytes

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Network Request
      class Real
        def delete_public_ip(resource_group, name)
          Fog::Logger.debug "Deleting PublicIP #{name} from Resource Group #{resource_group}."
          begin
            promise = @network_client.public_ipaddresses.delete(resource_group, name)
            promise.value!
            Fog::Logger.debug "PublicIP #{name} Deleted Successfully."
            true
          rescue  MsRestAzure::AzureOperationError => e
            msg = "Exception deleting Public IP #{name} in Resource Group: #{resource_group}. #{e.body['error']['message']}"
            raise msg
          end
        end
      end

      # Mock class for Network Request
      class Mock
        def delete_public_ip(resource_group, name)
          Fog::Logger.debug "Public IP #{name} from Resource group #{resource_group} deleted successfully."
          true
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.4 lib/fog/azurerm/requests/network/delete_public_ip.rb
fog-azure-rm-0.0.3 lib/fog/azurerm/requests/network/delete_public_ip.rb