Sha256: 1fb6f3a1e7683edb361772be0570efbe5fbabd58824cbbe37bce82f15a79caa8

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

require 'fog/core/collection'
require 'fog/azurerm/models/application_gateway/gateway'

module Fog
  module ApplicationGateway
    class AzureRM
      # Application Gateway collection class for Application Gateway Service
      class Gateways < Fog::Collection
        model Fog::ApplicationGateway::AzureRM::Gateway
        attribute :resource_group

        def all
          requires :resource_group
          application_gateways = []
          service.list_application_gateways(resource_group).each do |gateway|
            application_gateways << Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway)
          end
          load(application_gateways)
        end

        def get(resource_group_name, application_gateway_name)
          gateway = service.get_application_gateway(resource_group_name, application_gateway_name)
          application_gateway = Fog::ApplicationGateway::AzureRM::Gateway.new(service: service)
          application_gateway.merge_attributes(Fog::ApplicationGateway::AzureRM::Gateway.parse(gateway))
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.9 lib/fog/azurerm/models/application_gateway/gateways.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/models/application_gateway/gateways.rb
fog-azure-rm-0.0.6 lib/fog/azurerm/models/application_gateway/gateways.rb