Sha256: 56bceaabf437e3a4590d1aca893e3113495013fd8dee96edff699d027caeccc4

Contents?: true

Size: 981 Bytes

Versions: 1

Compression:

Stored size: 981 Bytes

Contents

module Fog
  module Network
    class AzureRM
      class Real
        def list_virtual_networks
          begin
            response = @network_client.virtual_networks.list_all
            result = response.value!
            result.body.value
          rescue MsRestAzure::AzureOperationError => e
            msg = "Exception listing Virtual Networks. #{e.body['error']['message']}."
            raise msg
          end
        end
      end

      class Mock
        def list_virtual_networks
          vnet = Azure::ARM::Network::Models::VirtualNetwork.new
          vnet.id = '/subscriptions/########-####-####-####-############/resourceGroups/fog-test-resource-group/providers/Microsoft.Network/virtualNetworks/fogtestvnet'
          vnet.name = 'fogtestvnet'
          vnet.location = 'West US'
          vnet.properties = Azure::ARM::Network::Models::VirtualNetworkPropertiesFormat.new
          [vnet]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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