Sha256: 71ad594a4b31ad8a3e6e6b4ec585cd0aeb44a083a34e22c298ff7fa0338d8f1a

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 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 = @logger_messages['network']['express_route_circuit_authentication']['message']['list']
                .gsub('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

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/requests/network/list_express_route_circuit_authorizations.rb
fog-azure-rm-0.1.0 lib/fog/azurerm/requests/network/list_express_route_circuit_authorizations.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/network/list_express_route_circuit_authorizations.rb