Sha256: 7d1d5573b9869879f7344aeabe9d86cc6347be1912473f4bfd06d9b5a56f298d

Contents?: true

Size: 1.53 KB

Versions: 6

Compression:

Stored size: 1.53 KB

Contents

module Fog
  module TrafficManager
    class AzureRM
      # Real class for TrafficManager Request
      class Real
        def get_traffic_manager_end_point(resource_group, traffic_manager_profile_name, traffic_manager_end_point, type)
          msg = "Getting Traffic Manager Endpoint: #{traffic_manager_end_point} in Profile: #{traffic_manager_profile_name}."
          Fog::Logger.debug msg
          begin
            endpoint = @traffic_mgmt_client.endpoints.get(resource_group, traffic_manager_profile_name, type, traffic_manager_end_point)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          Fog::Logger.debug "Traffic Manager Endpoint fetched successfully in Resource Group: #{resource_group}"
          endpoint
        end
      end

      # Mock class for Network Request
      class Mock
        def get_traffic_manager_end_point(*)
          endpoint = {
            'name' => '{endpoint-name}',
            'type' => 'Microsoft.Network/trafficManagerProfiles/externalEndpoints',
            'properties' => {
              'target' => 'myendpoint.contoso.com',
              'endpointStatus' => 'Enabled',
              'weight' => 10,
              'priority' => 5,
              'endpointLocation' => 'northeurope'
            }
          }
          endpoint_mapper = Azure::ARM::TrafficManager::Models::Endpoint.mapper
          @traffic_mgmt_client.deserialize(endpoint_mapper, endpoint, 'result.body')
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/requests/traffic_manager/get_traffic_manager_endpoint.rb
fog-azure-rm-0.1.0 lib/fog/azurerm/requests/traffic_manager/get_traffic_manager_endpoint.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/requests/traffic_manager/get_traffic_manager_endpoint.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/requests/traffic_manager/get_traffic_manager_endpoint.rb
fog-azure-rm-0.0.6 lib/fog/azurerm/requests/traffic_manager/get_traffic_manager_endpoint.rb
fog-azure-rm-0.0.5 lib/fog/azurerm/requests/traffic_manager/get_traffic_manager_endpoint.rb