Class: Fog::TrafficManager::AzureRM::TrafficManagerEndPoint

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/azurerm/models/traffic_manager/traffic_manager_end_point.rb

Overview

Traffic Manager End Point model for Traffic Manager Service

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse(endpoint) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/fog/azurerm/models/traffic_manager/traffic_manager_end_point.rb', line 20

def self.parse(endpoint)
  traffic_manager_endpoint = get_hash_from_object(endpoint)
  traffic_manager_endpoint['type'] = get_end_point_type(endpoint.type)
  traffic_manager_endpoint['resource_group'] = get_resource_group_from_id(endpoint.id)
  traffic_manager_endpoint['traffic_manager_profile_name'] = get_traffic_manager_profile_name_from_endpoint_id(endpoint.id)
  traffic_manager_endpoint
end

Instance Method Details

#destroyObject



37
38
39
# File 'lib/fog/azurerm/models/traffic_manager/traffic_manager_end_point.rb', line 37

def destroy
  service.delete_traffic_manager_endpoint(resource_group, name, traffic_manager_profile_name, type)
end

#saveObject



28
29
30
31
32
33
34
35
# File 'lib/fog/azurerm/models/traffic_manager/traffic_manager_end_point.rb', line 28

def save
  requires :name, :traffic_manager_profile_name, :resource_group, :type
  requires :target_resource_id if type.eql?(AZURE_ENDPOINTS)
  requires :target, :endpoint_location if type.eql?(EXTERNAL_ENDPOINTS)
  requires :target_resource_id, :endpoint_location, :min_child_endpoints if type.eql?(NESTED_ENDPOINTS)

  create_or_update
end

#update(endpoint_params) ⇒ Object



41
42
43
44
45
46
# File 'lib/fog/azurerm/models/traffic_manager/traffic_manager_end_point.rb', line 41

def update(endpoint_params)
  validate_input(endpoint_params)
  merge_attributes(endpoint_params)

  create_or_update
end