Class: Fog::Network::AzureRM::Subnets

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/azurerm/models/network/subnets.rb

Overview

Subnet collection for network service

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
13
14
15
16
17
# File 'lib/fog/azurerm/models/network/subnets.rb', line 10

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

#check_subnet_exists(resource_group, virtual_network_name, subnet_name) ⇒ Object



25
26
27
# File 'lib/fog/azurerm/models/network/subnets.rb', line 25

def check_subnet_exists(resource_group, virtual_network_name, subnet_name)
  service.check_subnet_exists(resource_group, virtual_network_name, subnet_name)
end

#get(resource_group, virtual_network_name, subnet_name) ⇒ Object



19
20
21
22
23
# File 'lib/fog/azurerm/models/network/subnets.rb', line 19

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