Sha256: d3e65f70ad69a5b781d66c9f5cce2a3c31e62b6469eed668b5a8e4112cc6628b

Contents?: true

Size: 1.28 KB

Versions: 46

Compression:

Stored size: 1.28 KB

Contents

module Fog
  module Network
    class AzureRM
      # LoadBalancers collection class for Network Service
      class LoadBalancers < Fog::Collection
        model Fog::Network::AzureRM::LoadBalancer
        attribute :resource_group

        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

        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

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

Version data entries

46 entries across 46 versions & 4 rubygems

Version Path
fog-azure-rm-0.6.0 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/models/network/load_balancers.rb
far-gem-0.5.6 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/models/network/load_balancers.rb
far-gem-0.5.5 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/models/network/load_balancers.rb
far-gem-0.5.4 lib/fog/azurerm/models/network/load_balancers.rb
far-gem-0.5.3 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/models/network/load_balancers.rb
far-gem-0.5.2 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/models/network/load_balancers.rb
far-gem-0.5.1 lib/fog/azurerm/models/network/load_balancers.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/models/network/load_balancers.rb