Sha256: 214658e278473b1ba2888a2377d8132072a431bbc264ed62cf7b82d1674e5500

Contents?: true

Size: 784 Bytes

Versions: 2

Compression:

Stored size: 784 Bytes

Contents

require 'fog/core/collection'
require 'fog/azurerm/models/network/subnet'

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
          requires :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(identity)
          all.find { |f| f.name == identity }
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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