Class: Fog::Network::AzureRM::LoadBalancers

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

Overview

LoadBalancers collection class for Network Service

Instance Method Summary collapse

Instance Method Details

#allObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/fog/azurerm/models/network/load_balancers.rb', line 9

def all
  load_balancers = []
  if !resource_group.nil?
    requires :resource_group
    l_balancers = service.list_load_balancers(resource_group)
  else
    l_balancers = service.list_load_balancers_in_subscription
  end

  l_balancers.each do |load_balancer|
    load_balancers << Fog::Network::AzureRM::LoadBalancer.parse(load_balancer)
  end
  load(load_balancers)
end

#check_load_balancer_exists(resource_group_name, load_balancer_name) ⇒ Object



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

def check_load_balancer_exists(resource_group_name, load_balancer_name)
  service.check_load_balancer_exists(resource_group_name, load_balancer_name)
end

#get(resource_group_name, load_balancer_name) ⇒ Object



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

def get(resource_group_name, load_balancer_name)
  load_balancer = service.get_load_balancer(resource_group_name, load_balancer_name)
  load_balancer_fog = Fog::Network::AzureRM::LoadBalancer.new(service: service)
  load_balancer_fog.merge_attributes(Fog::Network::AzureRM::LoadBalancer.parse(load_balancer))
end