Sha256: 1d3fcaa0fa31c4beea1034aedb2c24fcb1c747a20b76deb3d27e909463dcbfa8

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Network Request
      class Real
        def list_application_gateways(resource_group)
          Fog::Logger.debug "Getting list of Application-Gateway from Resource Group #{resource_group}."
          begin
            promise = @network_client.application_gateways.list(resource_group)
            result = promise.value!
            Azure::ARM::Network::Models::ApplicationGatewayListResult.serialize_object(result.body)['value']
          rescue MsRestAzure::AzureOperationError => e
            msg = "Exception listing Application-Gateway from Resource Group '#{resource_group}'. #{e.body['error']['message']}."
            raise msg
          end
        end
      end

      # Mock class for Network Request
      class Mock
        def list_application_gateways(_resource_group)
          ag = Azure::ARM::Network::Models::ApplicationGateway.new
          ag.name = 'fogtestgateway'
          ag.location = 'East US'
          ag.properties = Azure::ARM::Network::Models::ApplicationGatewayPropertiesFormat.new
          [ag]
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.4 lib/fog/azurerm/requests/network/list_application_gateways.rb
fog-azure-rm-0.0.3 lib/fog/azurerm/requests/network/list_application_gateways.rb