Class: Fog::Network::AzureRM::NetworkInterfaces

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

Overview

NetworkInterfaces collection class for Network Service

Instance Method Summary collapse

Instance Method Details

#allObject



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

def all
  requires :resource_group
  network_interfaces = []
  service.list_network_interfaces(resource_group).each do |nic|
    network_interfaces << Fog::Network::AzureRM::NetworkInterface.parse(nic)
  end
  load(network_interfaces)
end

#check_network_interface_exists(resource_group_name, name) ⇒ Object



30
31
32
# File 'lib/fog/azurerm/models/network/network_interfaces.rb', line 30

def check_network_interface_exists(resource_group_name, name)
  service.check_network_interface_exists(resource_group_name, name)
end

#create_async(attributes = {}) ⇒ Object



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

def create_async(attributes = {})
  network_interface = new(attributes)
  promise = network_interface.save(true)
  Fog::AzureRM::AsyncResponse.new(network_interface, promise)
end

#get(resource_group_name, name) ⇒ Object



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

def get(resource_group_name, name)
  network_interface_card = service.get_network_interface(resource_group_name, name)
  network_interface_card_fog = Fog::Network::AzureRM::NetworkInterface.new(service: service)
  network_interface_card_fog.merge_attributes(Fog::Network::AzureRM::NetworkInterface.parse(network_interface_card))
end