Sha256: 13367d7f434df7f036c6e9ae0c927b8460c0fc940d133ca6095ecee45075293c

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

module Fog
  module TrafficManager
    class AzureRM
      # Traffic Manager End Point Collection for TrafficManager Service
      class TrafficManagerEndPoints < Fog::Collection
        attribute :resource_group
        attribute :traffic_manager_profile_name
        model TrafficManagerEndPoint

        def all
          requires :resource_group, :traffic_manager_profile_name

          end_points = service.get_traffic_manager_profile(resource_group, traffic_manager_profile_name).endpoints
          traffic_manager_endpoints = end_points.map { |endpoint| TrafficManagerEndPoint.parse(endpoint) }
          load(traffic_manager_endpoints)
        end

        def get(resource_group, traffic_manager_profile_name, end_point_name, type)
          endpoint = service.get_traffic_manager_end_point(resource_group, traffic_manager_profile_name, end_point_name, type)
          endpoint_obj = TrafficManagerEndPoint.new(service: service)
          endpoint_obj.merge_attributes(TrafficManagerEndPoint.parse(endpoint))
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.0 lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb