Sha256: 589e63bafdc56e78f6918713a9dc5cd1195a3db1b23c4deecf6c701ae17d14ed

Contents?: true

Size: 910 Bytes

Versions: 2

Compression:

Stored size: 910 Bytes

Contents

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

      # Mock class for Network Request
      class Mock
        def delete_virtual_network(_resource_group_name, _name)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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