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.4.1 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.4.0 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/models/network/subnets.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/models/network/subnets.rb