Sha256: 0899e6689be46dda4882bd4d635f64850326acc452f281378acb71903816f728

Contents?: true

Size: 1.41 KB

Versions: 3

Compression:

Stored size: 1.41 KB

Contents

module Fog
  module Network
    class AzureRM
      # Real class for Express Route Circuit Authorization Request
      class Real
        def get_express_route_circuit_authorization(resource_group_name, circuit_name, authorization_name)
          msg = @logger_messages['network']['express_route_circuit_authentication']['message']['get']
                .gsub('NAME', authorization_name).gsub('RESOURCE_GROUP', resource_group_name)
          Fog::Logger.debug msg
          begin
            circuit_authorization = @network_client.express_route_circuit_authorizations.get(resource_group_name, circuit_name, authorization_name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          circuit_authorization
        end
      end

      # Mock class for Express Route Circuit Authorization Request
      class Mock
        def get_express_route_circuit_authorization(*)
          authorization = {
            'name' => 'authorization-name',
            'properties' => {
              'authorizationKey' => 'authorization-key',
              'authorizationUseStatus' => 'Available'
            }
          }
          authorization_mapper = Azure::ARM::Network::Models::ExpressRouteCircuitAuthorization.mapper
          @network_client.deserialize(authorization_mapper, authorization, '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/get_express_route_circuit_authorization.rb
fog-azure-rm-0.1.0 lib/fog/azurerm/requests/network/get_express_route_circuit_authorization.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/network/get_express_route_circuit_authorization.rb