Sha256: 7457167960160d09a8fdfe27fffcb0de16d92a16ac11145b669c7f6c85a512d7

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 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 Fog::TrafficManager::AzureRM::TrafficManagerEndPoint

        def all
          requires :resource_group
          requires :traffic_manager_profile_name

          traffic_manager_endpoints = []
          profile = service.get_traffic_manager_profile(resource_group, traffic_manager_profile_name)
          end_points = profile.endpoints
          end_points.each do |endpoint|
            traffic_manager_endpoints << Fog::TrafficManager::AzureRM::TrafficManagerEndPoint.parse(endpoint)
          end
          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 = Fog::TrafficManager::AzureRM::TrafficManagerEndPoint.new(service: service)
          endpoint_obj.merge_attributes(Fog::TrafficManager::AzureRM::TrafficManagerEndPoint.parse(endpoint))
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fog-azure-rm-0.0.8 lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb
fog-azure-rm-0.0.6 lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb
fog-azure-rm-0.0.5 lib/fog/azurerm/models/traffic_manager/traffic_manager_end_points.rb