Sha256: b87a11704a53da457babaf0927c776be5cd84a4fea74af6aa9bf2318850fb9b8

Contents?: true

Size: 1.06 KB

Versions: 46

Compression:

Stored size: 1.06 KB

Contents

module Fog
  module Network
    class AzureRM
      # Subnet collection for network service
      class Subnets < Fog::Collection
        model Fog::Network::AzureRM::Subnet
        attribute :resource_group
        attribute :virtual_network_name

        def all
          requires :resource_group, :virtual_network_name
          subnets = []
          service.list_subnets(resource_group, virtual_network_name).each do |subnet|
            subnets << Fog::Network::AzureRM::Subnet.parse(subnet)
          end
          load(subnets)
        end

        def get(resource_group, virtual_network_name, subnet_name)
          subnet = service.get_subnet(resource_group, virtual_network_name, subnet_name)
          subnet_fog = Fog::Network::AzureRM::Subnet.new(service: service)
          subnet_fog.merge_attributes(Fog::Network::AzureRM::Subnet.parse(subnet))
        end

        def check_subnet_exists(resource_group, virtual_network_name, subnet_name)
          service.check_subnet_exists(resource_group, virtual_network_name, subnet_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/subnets.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/models/network/subnets.rb
far-gem-0.5.6 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/models/network/subnets.rb
far-gem-0.5.5 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/models/network/subnets.rb
far-gem-0.5.4 lib/fog/azurerm/models/network/subnets.rb
far-gem-0.5.3 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/models/network/subnets.rb
far-gem-0.5.2 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/models/network/subnets.rb
far-gem-0.5.1 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/models/network/subnets.rb