Sha256: 0f19913310a4f7c2621bf7bb079fa8e2ac8087c11acea24ea27ae787158eb10b

Contents?: true

Size: 1.33 KB

Versions: 2

Compression:

Stored size: 1.33 KB

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Express Route Circuit Authorization Request
      class Real
        def list_express_route_circuit_authorizations(resource_group_name, circuit_name)
          msg = "Getting list of Express Route Circuit Authorizations from Resource Group #{resource_group_name}."
          Fog::Logger.debug msg
          begin
            circuit_authorizations = @network_client.express_route_circuit_authorizations.list(resource_group_name, circuit_name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          circuit_authorizations
        end
      end

      # Mock class for Express Route Circuit Authorization Request
      class Mock
        def list_express_route_circuit_authorizations(*)
          authorizations = [
            {
              'name' => 'authorization-name',
              'properties' => {
                'authorizationKey' => 'authorization-key',
                'authorizationUseStatus' => 'Available'
              }
            }
          ]
          authorization_mapper = Azure::ARM::Network::Models::ExpressRouteCircuitAuthorization.mapper
          @network_client.deserialize(authorization_mapper, authorizations, 'result.body')
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.8 lib/fog/azurerm/requests/network/list_express_route_circuit_authorizations.rb
fog-azure-rm-0.0.6 lib/fog/azurerm/requests/network/list_express_route_circuit_authorizations.rb