Sha256: d6f374b55ef5d89ce88c4318523164c114bfa82f511b5d0693f5a34f13ba317b

Contents?: true

Size: 1.26 KB

Versions: 46

Compression:

Stored size: 1.26 KB

Contents

module Fog
  module Network
    class AzureRM
      # This class is giving implementation of all/list, get and
      # check name availability for virtual network.
      class VirtualNetworks < Fog::Collection
        model Fog::Network::AzureRM::VirtualNetwork
        attribute :resource_group

        def all
          virtual_networks = []
          if !resource_group.nil?
            requires :resource_group
            vnets = service.list_virtual_networks(resource_group)
          else
            vnets = service.list_virtual_networks_in_subscription
          end
          vnets.each do |vnet|
            virtual_networks << Fog::Network::AzureRM::VirtualNetwork.parse(vnet)
          end
          load(virtual_networks)
        end

        def get(resource_group_name, virtual_network_name)
          virtual_network = service.get_virtual_network(resource_group_name, virtual_network_name)
          virtual_network_fog = Fog::Network::AzureRM::VirtualNetwork.new(service: service)
          virtual_network_fog.merge_attributes(Fog::Network::AzureRM::VirtualNetwork.parse(virtual_network))
        end

        def check_virtual_network_exists(resource_group, name)
          service.check_virtual_network_exists(resource_group, name)
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 4 rubygems

Version Path
fog-azure-rm-0.6.0 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/models/network/virtual_networks.rb
far-gem-0.5.6 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/models/network/virtual_networks.rb
far-gem-0.5.5 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/models/network/virtual_networks.rb
far-gem-0.5.4 lib/fog/azurerm/models/network/virtual_networks.rb
far-gem-0.5.3 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/models/network/virtual_networks.rb
far-gem-0.5.2 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/models/network/virtual_networks.rb
far-gem-0.5.1 lib/fog/azurerm/models/network/virtual_networks.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/models/network/virtual_networks.rb