Sha256: 442a93e858d234a0dcdb4fb25c07f2ac32ad763aaaf3e86d70542f0d406d4174

Contents?: true

Size: 1011 Bytes

Versions: 1

Compression:

Stored size: 1011 Bytes

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Network Request
      class Real
        def delete_virtual_network(resource_group, name)
          Fog::Logger.debug "Deleting Virtual Network: #{name}..."
          begin
            promise = @network_client.virtual_networks.delete(resource_group, name)
            promise.value!
            Fog::Logger.debug "Virtual Network #{name} deleted successfully."
            true
          rescue MsRestAzure::AzureOperationError => e
            msg = "Exception deleting Virtual Network #{name} in Resource Group: #{resource_group}. #{e.body['error']['message']}"
            raise msg
          end
        end
      end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.2 lib/fog/azurerm/requests/network/delete_virtual_network.rb