Sha256: 923bfdba3d3caeb0fe77d30b699fc4dee51da6e90474582ba208edf6d2ac013c

Contents?: true

Size: 845 Bytes

Versions: 1

Compression:

Stored size: 845 Bytes

Contents

module Fog
  module Network
    class AzureRM
      # Subnet collection for network service
      class Subnets < Fog::Collection
        model 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 << 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_object = Subnet.new(service: service)
          subnet_object.merge_attributes(Subnet.parse(subnet))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.0 lib/fog/azurerm/models/network/subnets.rb