azure_mgmt_traffic_manager 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/2015-11-01/generated/azure_mgmt_traffic_manager/traffic_manager_management_client.rb +6 -5
- data/lib/2017-03-01/generated/azure_mgmt_traffic_manager/traffic_manager_management_client.rb +6 -5
- data/lib/2017-05-01/generated/azure_mgmt_traffic_manager/traffic_manager_management_client.rb +6 -5
- data/lib/2017-09-01-preview/generated/azure_mgmt_traffic_manager/traffic_manager_management_client.rb +6 -5
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager.rb +50 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/endpoints.rb +493 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/geographic_hierarchies.rb +110 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/check_traffic_manager_relative_dns_name_availability_parameters.rb +58 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/delete_operation_result.rb +47 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/dns_config.rb +76 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/endpoint.rb +188 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/endpoint_monitor_status.rb +20 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/endpoint_status.rb +16 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/monitor_config.rb +124 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/monitor_protocol.rb +17 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/profile.rb +172 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/profile_list_result.rb +55 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/profile_monitor_status.rb +19 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/profile_status.rb +16 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/proxy_resource.rb +63 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/region.rb +79 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/resource.rb +73 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/tracked_resource.rb +92 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/traffic_manager_geographic_hierarchy.rb +76 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/traffic_manager_name_availability.rb +93 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/traffic_routing_method.rb +18 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/models/traffic_view_enrollment_status.rb +16 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/module_definition.rb +9 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/profiles.rb +720 -0
- data/lib/2018-02-01/generated/azure_mgmt_traffic_manager/traffic_manager_management_client.rb +141 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager.rb +58 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/endpoints.rb +493 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/geographic_hierarchies.rb +110 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/heat_map.rb +137 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/check_traffic_manager_relative_dns_name_availability_parameters.rb +58 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/delete_operation_result.rb +47 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/dns_config.rb +76 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/endpoint.rb +206 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/endpoint_monitor_status.rb +20 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/endpoint_properties_custom_headers_item.rb +57 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/endpoint_status.rb +16 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/heat_map_endpoint.rb +58 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/heat_map_model.rb +125 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/monitor_config.rb +165 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/monitor_config_custom_headers_item.rb +57 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/monitor_config_expected_status_code_ranges_item.rb +58 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/monitor_protocol.rb +17 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/profile.rb +169 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/profile_list_result.rb +55 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/profile_monitor_status.rb +19 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/profile_status.rb +16 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/proxy_resource.rb +60 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/query_experience.rb +70 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/region.rb +79 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/resource.rb +70 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/tracked_resource.rb +89 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/traffic_flow.rb +92 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/traffic_manager_geographic_hierarchy.rb +73 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/traffic_manager_name_availability.rb +93 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/traffic_routing_method.rb +18 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/traffic_view_enrollment_status.rb +16 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/module_definition.rb +9 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/profiles.rb +720 -0
- data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/traffic_manager_management_client.rb +145 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager.rb +61 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/endpoints.rb +493 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/geographic_hierarchies.rb +110 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/heat_map.rb +137 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/check_traffic_manager_relative_dns_name_availability_parameters.rb +58 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/delete_operation_result.rb +47 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/dns_config.rb +76 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/endpoint.rb +232 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/endpoint_monitor_status.rb +20 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/endpoint_properties_custom_headers_item.rb +57 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/endpoint_properties_subnets_item.rb +69 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/endpoint_status.rb +16 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/heat_map_endpoint.rb +58 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/heat_map_model.rb +128 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/monitor_config.rb +165 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/monitor_config_custom_headers_item.rb +57 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/monitor_config_expected_status_code_ranges_item.rb +58 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/monitor_protocol.rb +17 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/profile.rb +184 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/profile_list_result.rb +55 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/profile_monitor_status.rb +19 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/profile_status.rb +16 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/proxy_resource.rb +63 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/query_experience.rb +70 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/region.rb +79 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/resource.rb +73 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/tracked_resource.rb +92 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/traffic_flow.rb +92 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/traffic_manager_geographic_hierarchy.rb +76 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/traffic_manager_name_availability.rb +93 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/traffic_routing_method.rb +20 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/traffic_view_enrollment_status.rb +16 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/models/user_metrics_model.rb +73 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/module_definition.rb +9 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/profiles.rb +720 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/traffic_manager_management_client.rb +149 -0
- data/lib/2018-04-01/generated/azure_mgmt_traffic_manager/traffic_manager_user_metrics_keys.rb +280 -0
- data/lib/azure_mgmt_traffic_manager.rb +4 -1
- data/lib/profiles/latest/modules/trafficmanager_profile_module.rb +98 -86
- data/lib/version.rb +1 -1
- metadata +102 -5
@@ -0,0 +1,18 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::TrafficManager::Mgmt::V2018_03_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Defines values for TrafficRoutingMethod
|
10
|
+
#
|
11
|
+
module TrafficRoutingMethod
|
12
|
+
Performance = "Performance"
|
13
|
+
Priority = "Priority"
|
14
|
+
Weighted = "Weighted"
|
15
|
+
Geographic = "Geographic"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/2018-03-01/generated/azure_mgmt_traffic_manager/models/traffic_view_enrollment_status.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::TrafficManager::Mgmt::V2018_03_01
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Defines values for TrafficViewEnrollmentStatus
|
10
|
+
#
|
11
|
+
module TrafficViewEnrollmentStatus
|
12
|
+
Enabled = "Enabled"
|
13
|
+
Disabled = "Disabled"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure end
|
7
|
+
module Azure::TrafficManager end
|
8
|
+
module Azure::TrafficManager::Mgmt end
|
9
|
+
module Azure::TrafficManager::Mgmt::V2018_03_01 end
|
@@ -0,0 +1,720 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::TrafficManager::Mgmt::V2018_03_01
|
7
|
+
#
|
8
|
+
# Profiles
|
9
|
+
#
|
10
|
+
class Profiles
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Profiles class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [TrafficManagerManagementClient] reference to the TrafficManagerManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Checks the availability of a Traffic Manager Relative DNS name.
|
26
|
+
#
|
27
|
+
# @param parameters [CheckTrafficManagerRelativeDnsNameAvailabilityParameters]
|
28
|
+
# The Traffic Manager name parameters supplied to the
|
29
|
+
# CheckTrafficManagerNameAvailability operation.
|
30
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
31
|
+
# will be added to the HTTP request.
|
32
|
+
#
|
33
|
+
# @return [TrafficManagerNameAvailability] operation results.
|
34
|
+
#
|
35
|
+
def check_traffic_manager_relative_dns_name_availability(parameters, custom_headers:nil)
|
36
|
+
response = check_traffic_manager_relative_dns_name_availability_async(parameters, custom_headers:custom_headers).value!
|
37
|
+
response.body unless response.nil?
|
38
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Checks the availability of a Traffic Manager Relative DNS name.
|
42
|
+
#
|
43
|
+
# @param parameters [CheckTrafficManagerRelativeDnsNameAvailabilityParameters]
|
44
|
+
# The Traffic Manager name parameters supplied to the
|
45
|
+
# CheckTrafficManagerNameAvailability operation.
|
46
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
47
|
+
# will be added to the HTTP request.
|
48
|
+
#
|
49
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
50
|
+
#
|
51
|
+
def check_traffic_manager_relative_dns_name_availability_with_http_info(parameters, custom_headers:nil)
|
52
|
+
check_traffic_manager_relative_dns_name_availability_async(parameters, custom_headers:custom_headers).value!
|
53
|
+
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# Checks the availability of a Traffic Manager Relative DNS name.
|
57
|
+
#
|
58
|
+
# @param parameters [CheckTrafficManagerRelativeDnsNameAvailabilityParameters]
|
59
|
+
# The Traffic Manager name parameters supplied to the
|
60
|
+
# CheckTrafficManagerNameAvailability operation.
|
61
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
62
|
+
# to the HTTP request.
|
63
|
+
#
|
64
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
65
|
+
#
|
66
|
+
def check_traffic_manager_relative_dns_name_availability_async(parameters, custom_headers:nil)
|
67
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
68
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
69
|
+
|
70
|
+
|
71
|
+
request_headers = {}
|
72
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
73
|
+
|
74
|
+
# Set Headers
|
75
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
76
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
77
|
+
|
78
|
+
# Serialize Request
|
79
|
+
request_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::CheckTrafficManagerRelativeDnsNameAvailabilityParameters.mapper()
|
80
|
+
request_content = @client.serialize(request_mapper, parameters)
|
81
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
82
|
+
|
83
|
+
path_template = 'providers/Microsoft.Network/checkTrafficManagerNameAvailability'
|
84
|
+
|
85
|
+
request_url = @base_url || @client.base_url
|
86
|
+
|
87
|
+
options = {
|
88
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
89
|
+
query_params: {'api-version' => @client.api_version},
|
90
|
+
body: request_content,
|
91
|
+
headers: request_headers.merge(custom_headers || {}),
|
92
|
+
base_url: request_url
|
93
|
+
}
|
94
|
+
promise = @client.make_request_async(:post, path_template, options)
|
95
|
+
|
96
|
+
promise = promise.then do |result|
|
97
|
+
http_response = result.response
|
98
|
+
status_code = http_response.status
|
99
|
+
response_content = http_response.body
|
100
|
+
unless status_code == 200
|
101
|
+
error_model = JSON.load(response_content)
|
102
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
103
|
+
end
|
104
|
+
|
105
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
106
|
+
# Deserialize Response
|
107
|
+
if status_code == 200
|
108
|
+
begin
|
109
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
110
|
+
result_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::TrafficManagerNameAvailability.mapper()
|
111
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
112
|
+
rescue Exception => e
|
113
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
result
|
118
|
+
end
|
119
|
+
|
120
|
+
promise.execute
|
121
|
+
end
|
122
|
+
|
123
|
+
#
|
124
|
+
# Lists all Traffic Manager profiles within a resource group.
|
125
|
+
#
|
126
|
+
# @param resource_group_name [String] The name of the resource group containing
|
127
|
+
# the Traffic Manager profiles to be listed.
|
128
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
129
|
+
# will be added to the HTTP request.
|
130
|
+
#
|
131
|
+
# @return [ProfileListResult] operation results.
|
132
|
+
#
|
133
|
+
def list_by_resource_group(resource_group_name, custom_headers:nil)
|
134
|
+
response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
|
135
|
+
response.body unless response.nil?
|
136
|
+
end
|
137
|
+
|
138
|
+
#
|
139
|
+
# Lists all Traffic Manager profiles within a resource group.
|
140
|
+
#
|
141
|
+
# @param resource_group_name [String] The name of the resource group containing
|
142
|
+
# the Traffic Manager profiles to be listed.
|
143
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
144
|
+
# will be added to the HTTP request.
|
145
|
+
#
|
146
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
147
|
+
#
|
148
|
+
def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
|
149
|
+
list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
|
150
|
+
end
|
151
|
+
|
152
|
+
#
|
153
|
+
# Lists all Traffic Manager profiles within a resource group.
|
154
|
+
#
|
155
|
+
# @param resource_group_name [String] The name of the resource group containing
|
156
|
+
# the Traffic Manager profiles to be listed.
|
157
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
158
|
+
# to the HTTP request.
|
159
|
+
#
|
160
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
161
|
+
#
|
162
|
+
def list_by_resource_group_async(resource_group_name, custom_headers:nil)
|
163
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
164
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
165
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
166
|
+
|
167
|
+
|
168
|
+
request_headers = {}
|
169
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
170
|
+
|
171
|
+
# Set Headers
|
172
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
173
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
174
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles'
|
175
|
+
|
176
|
+
request_url = @base_url || @client.base_url
|
177
|
+
|
178
|
+
options = {
|
179
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
180
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
181
|
+
query_params: {'api-version' => @client.api_version},
|
182
|
+
headers: request_headers.merge(custom_headers || {}),
|
183
|
+
base_url: request_url
|
184
|
+
}
|
185
|
+
promise = @client.make_request_async(:get, path_template, options)
|
186
|
+
|
187
|
+
promise = promise.then do |result|
|
188
|
+
http_response = result.response
|
189
|
+
status_code = http_response.status
|
190
|
+
response_content = http_response.body
|
191
|
+
unless status_code == 200
|
192
|
+
error_model = JSON.load(response_content)
|
193
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
194
|
+
end
|
195
|
+
|
196
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
197
|
+
# Deserialize Response
|
198
|
+
if status_code == 200
|
199
|
+
begin
|
200
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
201
|
+
result_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::ProfileListResult.mapper()
|
202
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
203
|
+
rescue Exception => e
|
204
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
result
|
209
|
+
end
|
210
|
+
|
211
|
+
promise.execute
|
212
|
+
end
|
213
|
+
|
214
|
+
#
|
215
|
+
# Lists all Traffic Manager profiles within a subscription.
|
216
|
+
#
|
217
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
218
|
+
# will be added to the HTTP request.
|
219
|
+
#
|
220
|
+
# @return [ProfileListResult] operation results.
|
221
|
+
#
|
222
|
+
def list_by_subscription(custom_headers:nil)
|
223
|
+
response = list_by_subscription_async(custom_headers:custom_headers).value!
|
224
|
+
response.body unless response.nil?
|
225
|
+
end
|
226
|
+
|
227
|
+
#
|
228
|
+
# Lists all Traffic Manager profiles within a subscription.
|
229
|
+
#
|
230
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
231
|
+
# will be added to the HTTP request.
|
232
|
+
#
|
233
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
234
|
+
#
|
235
|
+
def list_by_subscription_with_http_info(custom_headers:nil)
|
236
|
+
list_by_subscription_async(custom_headers:custom_headers).value!
|
237
|
+
end
|
238
|
+
|
239
|
+
#
|
240
|
+
# Lists all Traffic Manager profiles within a subscription.
|
241
|
+
#
|
242
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
243
|
+
# to the HTTP request.
|
244
|
+
#
|
245
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
246
|
+
#
|
247
|
+
def list_by_subscription_async(custom_headers:nil)
|
248
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
249
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
250
|
+
|
251
|
+
|
252
|
+
request_headers = {}
|
253
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
254
|
+
|
255
|
+
# Set Headers
|
256
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
257
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
258
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles'
|
259
|
+
|
260
|
+
request_url = @base_url || @client.base_url
|
261
|
+
|
262
|
+
options = {
|
263
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
264
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
265
|
+
query_params: {'api-version' => @client.api_version},
|
266
|
+
headers: request_headers.merge(custom_headers || {}),
|
267
|
+
base_url: request_url
|
268
|
+
}
|
269
|
+
promise = @client.make_request_async(:get, path_template, options)
|
270
|
+
|
271
|
+
promise = promise.then do |result|
|
272
|
+
http_response = result.response
|
273
|
+
status_code = http_response.status
|
274
|
+
response_content = http_response.body
|
275
|
+
unless status_code == 200
|
276
|
+
error_model = JSON.load(response_content)
|
277
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
278
|
+
end
|
279
|
+
|
280
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
281
|
+
# Deserialize Response
|
282
|
+
if status_code == 200
|
283
|
+
begin
|
284
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
285
|
+
result_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::ProfileListResult.mapper()
|
286
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
287
|
+
rescue Exception => e
|
288
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
result
|
293
|
+
end
|
294
|
+
|
295
|
+
promise.execute
|
296
|
+
end
|
297
|
+
|
298
|
+
#
|
299
|
+
# Gets a Traffic Manager profile.
|
300
|
+
#
|
301
|
+
# @param resource_group_name [String] The name of the resource group containing
|
302
|
+
# the Traffic Manager profile.
|
303
|
+
# @param profile_name [String] The name of the Traffic Manager profile.
|
304
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
305
|
+
# will be added to the HTTP request.
|
306
|
+
#
|
307
|
+
# @return [Profile] operation results.
|
308
|
+
#
|
309
|
+
def get(resource_group_name, profile_name, custom_headers:nil)
|
310
|
+
response = get_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
|
311
|
+
response.body unless response.nil?
|
312
|
+
end
|
313
|
+
|
314
|
+
#
|
315
|
+
# Gets a Traffic Manager profile.
|
316
|
+
#
|
317
|
+
# @param resource_group_name [String] The name of the resource group containing
|
318
|
+
# the Traffic Manager profile.
|
319
|
+
# @param profile_name [String] The name of the Traffic Manager profile.
|
320
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
321
|
+
# will be added to the HTTP request.
|
322
|
+
#
|
323
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
324
|
+
#
|
325
|
+
def get_with_http_info(resource_group_name, profile_name, custom_headers:nil)
|
326
|
+
get_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
|
327
|
+
end
|
328
|
+
|
329
|
+
#
|
330
|
+
# Gets a Traffic Manager profile.
|
331
|
+
#
|
332
|
+
# @param resource_group_name [String] The name of the resource group containing
|
333
|
+
# the Traffic Manager profile.
|
334
|
+
# @param profile_name [String] The name of the Traffic Manager profile.
|
335
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
336
|
+
# to the HTTP request.
|
337
|
+
#
|
338
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
339
|
+
#
|
340
|
+
def get_async(resource_group_name, profile_name, custom_headers:nil)
|
341
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
342
|
+
fail ArgumentError, 'profile_name is nil' if profile_name.nil?
|
343
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
344
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
345
|
+
|
346
|
+
|
347
|
+
request_headers = {}
|
348
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
349
|
+
|
350
|
+
# Set Headers
|
351
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
352
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
353
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}'
|
354
|
+
|
355
|
+
request_url = @base_url || @client.base_url
|
356
|
+
|
357
|
+
options = {
|
358
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
359
|
+
path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
|
360
|
+
query_params: {'api-version' => @client.api_version},
|
361
|
+
headers: request_headers.merge(custom_headers || {}),
|
362
|
+
base_url: request_url
|
363
|
+
}
|
364
|
+
promise = @client.make_request_async(:get, path_template, options)
|
365
|
+
|
366
|
+
promise = promise.then do |result|
|
367
|
+
http_response = result.response
|
368
|
+
status_code = http_response.status
|
369
|
+
response_content = http_response.body
|
370
|
+
unless status_code == 200
|
371
|
+
error_model = JSON.load(response_content)
|
372
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
373
|
+
end
|
374
|
+
|
375
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
376
|
+
# Deserialize Response
|
377
|
+
if status_code == 200
|
378
|
+
begin
|
379
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
380
|
+
result_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::Profile.mapper()
|
381
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
382
|
+
rescue Exception => e
|
383
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
384
|
+
end
|
385
|
+
end
|
386
|
+
|
387
|
+
result
|
388
|
+
end
|
389
|
+
|
390
|
+
promise.execute
|
391
|
+
end
|
392
|
+
|
393
|
+
#
|
394
|
+
# Create or update a Traffic Manager profile.
|
395
|
+
#
|
396
|
+
# @param resource_group_name [String] The name of the resource group containing
|
397
|
+
# the Traffic Manager profile.
|
398
|
+
# @param profile_name [String] The name of the Traffic Manager profile.
|
399
|
+
# @param parameters [Profile] The Traffic Manager profile parameters supplied
|
400
|
+
# to the CreateOrUpdate operation.
|
401
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
402
|
+
# will be added to the HTTP request.
|
403
|
+
#
|
404
|
+
# @return [Profile] operation results.
|
405
|
+
#
|
406
|
+
def create_or_update(resource_group_name, profile_name, parameters, custom_headers:nil)
|
407
|
+
response = create_or_update_async(resource_group_name, profile_name, parameters, custom_headers:custom_headers).value!
|
408
|
+
response.body unless response.nil?
|
409
|
+
end
|
410
|
+
|
411
|
+
#
|
412
|
+
# Create or update a Traffic Manager profile.
|
413
|
+
#
|
414
|
+
# @param resource_group_name [String] The name of the resource group containing
|
415
|
+
# the Traffic Manager profile.
|
416
|
+
# @param profile_name [String] The name of the Traffic Manager profile.
|
417
|
+
# @param parameters [Profile] The Traffic Manager profile parameters supplied
|
418
|
+
# to the CreateOrUpdate operation.
|
419
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
420
|
+
# will be added to the HTTP request.
|
421
|
+
#
|
422
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
423
|
+
#
|
424
|
+
def create_or_update_with_http_info(resource_group_name, profile_name, parameters, custom_headers:nil)
|
425
|
+
create_or_update_async(resource_group_name, profile_name, parameters, custom_headers:custom_headers).value!
|
426
|
+
end
|
427
|
+
|
428
|
+
#
|
429
|
+
# Create or update a Traffic Manager profile.
|
430
|
+
#
|
431
|
+
# @param resource_group_name [String] The name of the resource group containing
|
432
|
+
# the Traffic Manager profile.
|
433
|
+
# @param profile_name [String] The name of the Traffic Manager profile.
|
434
|
+
# @param parameters [Profile] The Traffic Manager profile parameters supplied
|
435
|
+
# to the CreateOrUpdate operation.
|
436
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
437
|
+
# to the HTTP request.
|
438
|
+
#
|
439
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
440
|
+
#
|
441
|
+
def create_or_update_async(resource_group_name, profile_name, parameters, custom_headers:nil)
|
442
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
443
|
+
fail ArgumentError, 'profile_name is nil' if profile_name.nil?
|
444
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
445
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
446
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
447
|
+
|
448
|
+
|
449
|
+
request_headers = {}
|
450
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
451
|
+
|
452
|
+
# Set Headers
|
453
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
454
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
455
|
+
|
456
|
+
# Serialize Request
|
457
|
+
request_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::Profile.mapper()
|
458
|
+
request_content = @client.serialize(request_mapper, parameters)
|
459
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
460
|
+
|
461
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}'
|
462
|
+
|
463
|
+
request_url = @base_url || @client.base_url
|
464
|
+
|
465
|
+
options = {
|
466
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
467
|
+
path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
|
468
|
+
query_params: {'api-version' => @client.api_version},
|
469
|
+
body: request_content,
|
470
|
+
headers: request_headers.merge(custom_headers || {}),
|
471
|
+
base_url: request_url
|
472
|
+
}
|
473
|
+
promise = @client.make_request_async(:put, path_template, options)
|
474
|
+
|
475
|
+
promise = promise.then do |result|
|
476
|
+
http_response = result.response
|
477
|
+
status_code = http_response.status
|
478
|
+
response_content = http_response.body
|
479
|
+
unless status_code == 200 || status_code == 201
|
480
|
+
error_model = JSON.load(response_content)
|
481
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
482
|
+
end
|
483
|
+
|
484
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
485
|
+
# Deserialize Response
|
486
|
+
if status_code == 200
|
487
|
+
begin
|
488
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
489
|
+
result_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::Profile.mapper()
|
490
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
491
|
+
rescue Exception => e
|
492
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
493
|
+
end
|
494
|
+
end
|
495
|
+
# Deserialize Response
|
496
|
+
if status_code == 201
|
497
|
+
begin
|
498
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
499
|
+
result_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::Profile.mapper()
|
500
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
501
|
+
rescue Exception => e
|
502
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
503
|
+
end
|
504
|
+
end
|
505
|
+
|
506
|
+
result
|
507
|
+
end
|
508
|
+
|
509
|
+
promise.execute
|
510
|
+
end
|
511
|
+
|
512
|
+
#
|
513
|
+
# Deletes a Traffic Manager profile.
|
514
|
+
#
|
515
|
+
# @param resource_group_name [String] The name of the resource group containing
|
516
|
+
# the Traffic Manager profile to be deleted.
|
517
|
+
# @param profile_name [String] The name of the Traffic Manager profile to be
|
518
|
+
# deleted.
|
519
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
520
|
+
# will be added to the HTTP request.
|
521
|
+
#
|
522
|
+
# @return [DeleteOperationResult] operation results.
|
523
|
+
#
|
524
|
+
def delete(resource_group_name, profile_name, custom_headers:nil)
|
525
|
+
response = delete_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
|
526
|
+
response.body unless response.nil?
|
527
|
+
end
|
528
|
+
|
529
|
+
#
|
530
|
+
# Deletes a Traffic Manager profile.
|
531
|
+
#
|
532
|
+
# @param resource_group_name [String] The name of the resource group containing
|
533
|
+
# the Traffic Manager profile to be deleted.
|
534
|
+
# @param profile_name [String] The name of the Traffic Manager profile to be
|
535
|
+
# deleted.
|
536
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
537
|
+
# will be added to the HTTP request.
|
538
|
+
#
|
539
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
540
|
+
#
|
541
|
+
def delete_with_http_info(resource_group_name, profile_name, custom_headers:nil)
|
542
|
+
delete_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
|
543
|
+
end
|
544
|
+
|
545
|
+
#
|
546
|
+
# Deletes a Traffic Manager profile.
|
547
|
+
#
|
548
|
+
# @param resource_group_name [String] The name of the resource group containing
|
549
|
+
# the Traffic Manager profile to be deleted.
|
550
|
+
# @param profile_name [String] The name of the Traffic Manager profile to be
|
551
|
+
# deleted.
|
552
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
553
|
+
# to the HTTP request.
|
554
|
+
#
|
555
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
556
|
+
#
|
557
|
+
def delete_async(resource_group_name, profile_name, custom_headers:nil)
|
558
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
559
|
+
fail ArgumentError, 'profile_name is nil' if profile_name.nil?
|
560
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
561
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
562
|
+
|
563
|
+
|
564
|
+
request_headers = {}
|
565
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
566
|
+
|
567
|
+
# Set Headers
|
568
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
569
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
570
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}'
|
571
|
+
|
572
|
+
request_url = @base_url || @client.base_url
|
573
|
+
|
574
|
+
options = {
|
575
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
576
|
+
path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
|
577
|
+
query_params: {'api-version' => @client.api_version},
|
578
|
+
headers: request_headers.merge(custom_headers || {}),
|
579
|
+
base_url: request_url
|
580
|
+
}
|
581
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
582
|
+
|
583
|
+
promise = promise.then do |result|
|
584
|
+
http_response = result.response
|
585
|
+
status_code = http_response.status
|
586
|
+
response_content = http_response.body
|
587
|
+
unless status_code == 200 || status_code == 204
|
588
|
+
error_model = JSON.load(response_content)
|
589
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
590
|
+
end
|
591
|
+
|
592
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
593
|
+
# Deserialize Response
|
594
|
+
if status_code == 200
|
595
|
+
begin
|
596
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
597
|
+
result_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::DeleteOperationResult.mapper()
|
598
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
599
|
+
rescue Exception => e
|
600
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
601
|
+
end
|
602
|
+
end
|
603
|
+
|
604
|
+
result
|
605
|
+
end
|
606
|
+
|
607
|
+
promise.execute
|
608
|
+
end
|
609
|
+
|
610
|
+
#
|
611
|
+
# Update a Traffic Manager profile.
|
612
|
+
#
|
613
|
+
# @param resource_group_name [String] The name of the resource group containing
|
614
|
+
# the Traffic Manager profile.
|
615
|
+
# @param profile_name [String] The name of the Traffic Manager profile.
|
616
|
+
# @param parameters [Profile] The Traffic Manager profile parameters supplied
|
617
|
+
# to the Update operation.
|
618
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
619
|
+
# will be added to the HTTP request.
|
620
|
+
#
|
621
|
+
# @return [Profile] operation results.
|
622
|
+
#
|
623
|
+
def update(resource_group_name, profile_name, parameters, custom_headers:nil)
|
624
|
+
response = update_async(resource_group_name, profile_name, parameters, custom_headers:custom_headers).value!
|
625
|
+
response.body unless response.nil?
|
626
|
+
end
|
627
|
+
|
628
|
+
#
|
629
|
+
# Update a Traffic Manager profile.
|
630
|
+
#
|
631
|
+
# @param resource_group_name [String] The name of the resource group containing
|
632
|
+
# the Traffic Manager profile.
|
633
|
+
# @param profile_name [String] The name of the Traffic Manager profile.
|
634
|
+
# @param parameters [Profile] The Traffic Manager profile parameters supplied
|
635
|
+
# to the Update operation.
|
636
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
637
|
+
# will be added to the HTTP request.
|
638
|
+
#
|
639
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
640
|
+
#
|
641
|
+
def update_with_http_info(resource_group_name, profile_name, parameters, custom_headers:nil)
|
642
|
+
update_async(resource_group_name, profile_name, parameters, custom_headers:custom_headers).value!
|
643
|
+
end
|
644
|
+
|
645
|
+
#
|
646
|
+
# Update a Traffic Manager profile.
|
647
|
+
#
|
648
|
+
# @param resource_group_name [String] The name of the resource group containing
|
649
|
+
# the Traffic Manager profile.
|
650
|
+
# @param profile_name [String] The name of the Traffic Manager profile.
|
651
|
+
# @param parameters [Profile] The Traffic Manager profile parameters supplied
|
652
|
+
# to the Update operation.
|
653
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
654
|
+
# to the HTTP request.
|
655
|
+
#
|
656
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
657
|
+
#
|
658
|
+
def update_async(resource_group_name, profile_name, parameters, custom_headers:nil)
|
659
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
660
|
+
fail ArgumentError, 'profile_name is nil' if profile_name.nil?
|
661
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
662
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
663
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
664
|
+
|
665
|
+
|
666
|
+
request_headers = {}
|
667
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
668
|
+
|
669
|
+
# Set Headers
|
670
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
671
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
672
|
+
|
673
|
+
# Serialize Request
|
674
|
+
request_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::Profile.mapper()
|
675
|
+
request_content = @client.serialize(request_mapper, parameters)
|
676
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
677
|
+
|
678
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}'
|
679
|
+
|
680
|
+
request_url = @base_url || @client.base_url
|
681
|
+
|
682
|
+
options = {
|
683
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
684
|
+
path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'subscriptionId' => @client.subscription_id},
|
685
|
+
query_params: {'api-version' => @client.api_version},
|
686
|
+
body: request_content,
|
687
|
+
headers: request_headers.merge(custom_headers || {}),
|
688
|
+
base_url: request_url
|
689
|
+
}
|
690
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
691
|
+
|
692
|
+
promise = promise.then do |result|
|
693
|
+
http_response = result.response
|
694
|
+
status_code = http_response.status
|
695
|
+
response_content = http_response.body
|
696
|
+
unless status_code == 200
|
697
|
+
error_model = JSON.load(response_content)
|
698
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
699
|
+
end
|
700
|
+
|
701
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
702
|
+
# Deserialize Response
|
703
|
+
if status_code == 200
|
704
|
+
begin
|
705
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
706
|
+
result_mapper = Azure::TrafficManager::Mgmt::V2018_03_01::Models::Profile.mapper()
|
707
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
708
|
+
rescue Exception => e
|
709
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
710
|
+
end
|
711
|
+
end
|
712
|
+
|
713
|
+
result
|
714
|
+
end
|
715
|
+
|
716
|
+
promise.execute
|
717
|
+
end
|
718
|
+
|
719
|
+
end
|
720
|
+
end
|