azure_mgmt_service_fabric 0.15.2 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/2016-09-01/generated/azure_mgmt_service_fabric/cluster_versions.rb +51 -44
- data/lib/2016-09-01/generated/azure_mgmt_service_fabric/clusters.rb +62 -58
- data/lib/2016-09-01/generated/azure_mgmt_service_fabric/operations.rb +15 -13
- data/lib/2016-09-01/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +4 -1
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric.rb +91 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application.rb +691 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application_type.rb +487 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/cluster_versions.rb +471 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb +778 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_health_policy.rb +104 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_metric_description.rb +113 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_parameter.rb +58 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource.rb +206 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_list.rb +55 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_update.rb +182 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource.rb +83 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource_list.rb +55 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_upgrade_policy.rb +81 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/available_operation_display.rb +79 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/azure_active_directory.rb +68 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/certificate_description.rb +70 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_common_name.rb +70 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_thumbprint.rb +59 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster.rb +398 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb +66 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_result.rb +102 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_health_policy.rb +70 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb +66 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_update_parameters.rb +246 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_delta_health_policy.rb +97 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_policy.rb +156 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_version_details.rb +69 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/diagnostics_storage_account_config.rb +91 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/endpoint_range_description.rb +57 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/error_model.rb +57 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/named_partition_scheme_description.rb +81 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/node_type_description.rb +189 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_list_result.rb +101 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_result.rb +81 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/partition_scheme_description.rb +48 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/provisioning_state.rb +18 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/proxy_resource.rb +82 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/resource.rb +101 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/rolling_upgrade_monitoring_policy.rb +90 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_correlation_description.rb +58 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_load_metric_description.rb +98 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_placement_policy_description.rb +46 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties.rb +151 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties_base.rb +123 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource.rb +207 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_list.rb +55 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_update.rb +169 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_delta_health_policy.rb +51 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy.rb +108 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy_map_item.rb +60 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_update_properties.rb +113 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_parameter_description.rb +57 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_section_description.rb +67 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/singleton_partition_scheme_description.rb +51 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_properties.rb +227 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_update_properties.rb +186 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_properties.rb +161 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_update_properties.rb +133 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/uniform_int64range_partition_scheme_description.rb +91 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource.rb +115 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource_list.rb +55 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/module_definition.rb +9 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/operations.rb +230 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service.rb +735 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +147 -0
- data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/version.rb +559 -0
- data/lib/azure_mgmt_service_fabric.rb +1 -0
- data/lib/profiles/latest/modules/servicefabric_profile_module.rb +269 -114
- data/lib/profiles/latest/servicefabric_latest_profile_client.rb +28 -9
- data/lib/profiles/latest/servicefabric_module_definition.rb +0 -1
- data/lib/version.rb +1 -1
- metadata +70 -3
@@ -0,0 +1,778 @@
|
|
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::ServiceFabric::Mgmt::V2017_07_01_preview
|
7
|
+
#
|
8
|
+
# Azure Service Fabric Resource Provider API Client
|
9
|
+
#
|
10
|
+
class Clusters
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Clusters class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [ServiceFabricManagementClient] reference to the ServiceFabricManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Create a ServiceFabric cluster
|
26
|
+
#
|
27
|
+
# Create cluster resource
|
28
|
+
#
|
29
|
+
#
|
30
|
+
# @param resource_group_name [String] The name of the resource group.
|
31
|
+
# @param cluster_name [String] The name of the cluster resource
|
32
|
+
# @param api_version [String] The version of the API.
|
33
|
+
# @param subscription_id [String] The customer subscription identifier
|
34
|
+
# @param parameters [Cluster] The cluster resource.
|
35
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
36
|
+
# will be added to the HTTP request.
|
37
|
+
#
|
38
|
+
# @return [Cluster] operation results.
|
39
|
+
#
|
40
|
+
def create(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
|
41
|
+
response = create_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:custom_headers).value!
|
42
|
+
response.body unless response.nil?
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# @param resource_group_name [String] The name of the resource group.
|
47
|
+
# @param cluster_name [String] The name of the cluster resource
|
48
|
+
# @param api_version [String] The version of the API.
|
49
|
+
# @param subscription_id [String] The customer subscription identifier
|
50
|
+
# @param parameters [Cluster] The cluster resource.
|
51
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
52
|
+
# will be added to the HTTP request.
|
53
|
+
#
|
54
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
55
|
+
# response.
|
56
|
+
#
|
57
|
+
def create_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
|
58
|
+
# Send request
|
59
|
+
promise = begin_create_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:custom_headers)
|
60
|
+
|
61
|
+
promise = promise.then do |response|
|
62
|
+
# Defining deserialization method.
|
63
|
+
deserialize_method = lambda do |parsed_response|
|
64
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::Cluster.mapper()
|
65
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Waiting for response.
|
69
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
70
|
+
end
|
71
|
+
|
72
|
+
promise
|
73
|
+
end
|
74
|
+
|
75
|
+
#
|
76
|
+
# Delete cluster resource
|
77
|
+
#
|
78
|
+
# Delete cluster resource
|
79
|
+
#
|
80
|
+
#
|
81
|
+
# @param resource_group_name [String] The name of the resource group.
|
82
|
+
# @param cluster_name [String] The name of the cluster resource
|
83
|
+
# @param api_version [String] The version of the API.
|
84
|
+
# @param subscription_id [String] The customer subscription identifier
|
85
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
86
|
+
# will be added to the HTTP request.
|
87
|
+
#
|
88
|
+
#
|
89
|
+
def delete(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:nil)
|
90
|
+
response = delete_async(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:custom_headers).value!
|
91
|
+
nil
|
92
|
+
end
|
93
|
+
|
94
|
+
#
|
95
|
+
# Delete cluster resource
|
96
|
+
#
|
97
|
+
# Delete cluster resource
|
98
|
+
#
|
99
|
+
#
|
100
|
+
# @param resource_group_name [String] The name of the resource group.
|
101
|
+
# @param cluster_name [String] The name of the cluster resource
|
102
|
+
# @param api_version [String] The version of the API.
|
103
|
+
# @param subscription_id [String] The customer subscription identifier
|
104
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
105
|
+
# will be added to the HTTP request.
|
106
|
+
#
|
107
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
108
|
+
#
|
109
|
+
def delete_with_http_info(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:nil)
|
110
|
+
delete_async(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:custom_headers).value!
|
111
|
+
end
|
112
|
+
|
113
|
+
#
|
114
|
+
# Delete cluster resource
|
115
|
+
#
|
116
|
+
# Delete cluster resource
|
117
|
+
#
|
118
|
+
#
|
119
|
+
# @param resource_group_name [String] The name of the resource group.
|
120
|
+
# @param cluster_name [String] The name of the cluster resource
|
121
|
+
# @param api_version [String] The version of the API.
|
122
|
+
# @param subscription_id [String] The customer subscription identifier
|
123
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
124
|
+
# to the HTTP request.
|
125
|
+
#
|
126
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
127
|
+
#
|
128
|
+
def delete_async(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:nil)
|
129
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
130
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
131
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
132
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
133
|
+
|
134
|
+
|
135
|
+
request_headers = {}
|
136
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
137
|
+
|
138
|
+
# Set Headers
|
139
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
140
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
141
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}'
|
142
|
+
|
143
|
+
request_url = @base_url || @client.base_url
|
144
|
+
|
145
|
+
options = {
|
146
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
147
|
+
path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => subscription_id},
|
148
|
+
query_params: {'api-version' => api_version},
|
149
|
+
headers: request_headers.merge(custom_headers || {}),
|
150
|
+
base_url: request_url
|
151
|
+
}
|
152
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
153
|
+
|
154
|
+
promise = promise.then do |result|
|
155
|
+
http_response = result.response
|
156
|
+
status_code = http_response.status
|
157
|
+
response_content = http_response.body
|
158
|
+
unless status_code == 200 || status_code == 204
|
159
|
+
error_model = JSON.load(response_content)
|
160
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
161
|
+
end
|
162
|
+
|
163
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
164
|
+
|
165
|
+
result
|
166
|
+
end
|
167
|
+
|
168
|
+
promise.execute
|
169
|
+
end
|
170
|
+
|
171
|
+
#
|
172
|
+
# Get cluster resource
|
173
|
+
#
|
174
|
+
# Get cluster resource
|
175
|
+
#
|
176
|
+
#
|
177
|
+
# @param resource_group_name [String] The name of the resource group.
|
178
|
+
# @param cluster_name [String] The name of the cluster resource
|
179
|
+
# @param api_version [String] The version of the API.
|
180
|
+
# @param subscription_id [String] The customer subscription identifier
|
181
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
182
|
+
# will be added to the HTTP request.
|
183
|
+
#
|
184
|
+
# @return [Cluster] operation results.
|
185
|
+
#
|
186
|
+
def get(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:nil)
|
187
|
+
response = get_async(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:custom_headers).value!
|
188
|
+
response.body unless response.nil?
|
189
|
+
end
|
190
|
+
|
191
|
+
#
|
192
|
+
# Get cluster resource
|
193
|
+
#
|
194
|
+
# Get cluster resource
|
195
|
+
#
|
196
|
+
#
|
197
|
+
# @param resource_group_name [String] The name of the resource group.
|
198
|
+
# @param cluster_name [String] The name of the cluster resource
|
199
|
+
# @param api_version [String] The version of the API.
|
200
|
+
# @param subscription_id [String] The customer subscription identifier
|
201
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
202
|
+
# will be added to the HTTP request.
|
203
|
+
#
|
204
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
205
|
+
#
|
206
|
+
def get_with_http_info(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:nil)
|
207
|
+
get_async(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:custom_headers).value!
|
208
|
+
end
|
209
|
+
|
210
|
+
#
|
211
|
+
# Get cluster resource
|
212
|
+
#
|
213
|
+
# Get cluster resource
|
214
|
+
#
|
215
|
+
#
|
216
|
+
# @param resource_group_name [String] The name of the resource group.
|
217
|
+
# @param cluster_name [String] The name of the cluster resource
|
218
|
+
# @param api_version [String] The version of the API.
|
219
|
+
# @param subscription_id [String] The customer subscription identifier
|
220
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
221
|
+
# to the HTTP request.
|
222
|
+
#
|
223
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
224
|
+
#
|
225
|
+
def get_async(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:nil)
|
226
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
227
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
228
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
229
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
230
|
+
|
231
|
+
|
232
|
+
request_headers = {}
|
233
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
234
|
+
|
235
|
+
# Set Headers
|
236
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
237
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
238
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}'
|
239
|
+
|
240
|
+
request_url = @base_url || @client.base_url
|
241
|
+
|
242
|
+
options = {
|
243
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
244
|
+
path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => subscription_id},
|
245
|
+
query_params: {'api-version' => api_version},
|
246
|
+
headers: request_headers.merge(custom_headers || {}),
|
247
|
+
base_url: request_url
|
248
|
+
}
|
249
|
+
promise = @client.make_request_async(:get, path_template, options)
|
250
|
+
|
251
|
+
promise = promise.then do |result|
|
252
|
+
http_response = result.response
|
253
|
+
status_code = http_response.status
|
254
|
+
response_content = http_response.body
|
255
|
+
unless status_code == 200
|
256
|
+
error_model = JSON.load(response_content)
|
257
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
258
|
+
end
|
259
|
+
|
260
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
261
|
+
# Deserialize Response
|
262
|
+
if status_code == 200
|
263
|
+
begin
|
264
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
265
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::Cluster.mapper()
|
266
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
267
|
+
rescue Exception => e
|
268
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
result
|
273
|
+
end
|
274
|
+
|
275
|
+
promise.execute
|
276
|
+
end
|
277
|
+
|
278
|
+
#
|
279
|
+
# Update cluster configuration
|
280
|
+
#
|
281
|
+
# Update cluster configuration
|
282
|
+
#
|
283
|
+
#
|
284
|
+
# @param resource_group_name [String] The name of the resource group.
|
285
|
+
# @param cluster_name [String] The name of the cluster resource
|
286
|
+
# @param api_version [String] The version of the API.
|
287
|
+
# @param subscription_id [String] The customer subscription identifier
|
288
|
+
# @param parameters [ClusterUpdateParameters] The parameters which contains the
|
289
|
+
# property value and property name which used to update the cluster
|
290
|
+
# configuration.
|
291
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
292
|
+
# will be added to the HTTP request.
|
293
|
+
#
|
294
|
+
# @return [Cluster] operation results.
|
295
|
+
#
|
296
|
+
def update(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
|
297
|
+
response = update_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:custom_headers).value!
|
298
|
+
response.body unless response.nil?
|
299
|
+
end
|
300
|
+
|
301
|
+
#
|
302
|
+
# @param resource_group_name [String] The name of the resource group.
|
303
|
+
# @param cluster_name [String] The name of the cluster resource
|
304
|
+
# @param api_version [String] The version of the API.
|
305
|
+
# @param subscription_id [String] The customer subscription identifier
|
306
|
+
# @param parameters [ClusterUpdateParameters] The parameters which contains the
|
307
|
+
# property value and property name which used to update the cluster
|
308
|
+
# configuration.
|
309
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
310
|
+
# will be added to the HTTP request.
|
311
|
+
#
|
312
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
313
|
+
# response.
|
314
|
+
#
|
315
|
+
def update_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
|
316
|
+
# Send request
|
317
|
+
promise = begin_update_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:custom_headers)
|
318
|
+
|
319
|
+
promise = promise.then do |response|
|
320
|
+
# Defining deserialization method.
|
321
|
+
deserialize_method = lambda do |parsed_response|
|
322
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::Cluster.mapper()
|
323
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
324
|
+
end
|
325
|
+
|
326
|
+
# Waiting for response.
|
327
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
328
|
+
end
|
329
|
+
|
330
|
+
promise
|
331
|
+
end
|
332
|
+
|
333
|
+
#
|
334
|
+
# List cluster resource by resource group
|
335
|
+
#
|
336
|
+
# List cluster resource by resource group
|
337
|
+
#
|
338
|
+
#
|
339
|
+
# @param resource_group_name [String] The name of the resource group.
|
340
|
+
# @param api_version [String] The version of the API.
|
341
|
+
# @param subscription_id [String] The customer subscription identifier
|
342
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
343
|
+
# will be added to the HTTP request.
|
344
|
+
#
|
345
|
+
# @return [ClusterListResult] operation results.
|
346
|
+
#
|
347
|
+
def list_by_resource_group(resource_group_name, api_version, subscription_id, custom_headers:nil)
|
348
|
+
response = list_by_resource_group_async(resource_group_name, api_version, subscription_id, custom_headers:custom_headers).value!
|
349
|
+
response.body unless response.nil?
|
350
|
+
end
|
351
|
+
|
352
|
+
#
|
353
|
+
# List cluster resource by resource group
|
354
|
+
#
|
355
|
+
# List cluster resource by resource group
|
356
|
+
#
|
357
|
+
#
|
358
|
+
# @param resource_group_name [String] The name of the resource group.
|
359
|
+
# @param api_version [String] The version of the API.
|
360
|
+
# @param subscription_id [String] The customer subscription identifier
|
361
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
362
|
+
# will be added to the HTTP request.
|
363
|
+
#
|
364
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
365
|
+
#
|
366
|
+
def list_by_resource_group_with_http_info(resource_group_name, api_version, subscription_id, custom_headers:nil)
|
367
|
+
list_by_resource_group_async(resource_group_name, api_version, subscription_id, custom_headers:custom_headers).value!
|
368
|
+
end
|
369
|
+
|
370
|
+
#
|
371
|
+
# List cluster resource by resource group
|
372
|
+
#
|
373
|
+
# List cluster resource by resource group
|
374
|
+
#
|
375
|
+
#
|
376
|
+
# @param resource_group_name [String] The name of the resource group.
|
377
|
+
# @param api_version [String] The version of the API.
|
378
|
+
# @param subscription_id [String] The customer subscription identifier
|
379
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
380
|
+
# to the HTTP request.
|
381
|
+
#
|
382
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
383
|
+
#
|
384
|
+
def list_by_resource_group_async(resource_group_name, api_version, subscription_id, custom_headers:nil)
|
385
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
386
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
387
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
388
|
+
|
389
|
+
|
390
|
+
request_headers = {}
|
391
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
392
|
+
|
393
|
+
# Set Headers
|
394
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
395
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
396
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters'
|
397
|
+
|
398
|
+
request_url = @base_url || @client.base_url
|
399
|
+
|
400
|
+
options = {
|
401
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
402
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => subscription_id},
|
403
|
+
query_params: {'api-version' => api_version},
|
404
|
+
headers: request_headers.merge(custom_headers || {}),
|
405
|
+
base_url: request_url
|
406
|
+
}
|
407
|
+
promise = @client.make_request_async(:get, path_template, options)
|
408
|
+
|
409
|
+
promise = promise.then do |result|
|
410
|
+
http_response = result.response
|
411
|
+
status_code = http_response.status
|
412
|
+
response_content = http_response.body
|
413
|
+
unless status_code == 200
|
414
|
+
error_model = JSON.load(response_content)
|
415
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
416
|
+
end
|
417
|
+
|
418
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
419
|
+
# Deserialize Response
|
420
|
+
if status_code == 200
|
421
|
+
begin
|
422
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
423
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ClusterListResult.mapper()
|
424
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
425
|
+
rescue Exception => e
|
426
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
427
|
+
end
|
428
|
+
end
|
429
|
+
|
430
|
+
result
|
431
|
+
end
|
432
|
+
|
433
|
+
promise.execute
|
434
|
+
end
|
435
|
+
|
436
|
+
#
|
437
|
+
# List cluster resource
|
438
|
+
#
|
439
|
+
# List cluster resource
|
440
|
+
#
|
441
|
+
#
|
442
|
+
# @param api_version [String] The version of the API.
|
443
|
+
# @param subscription_id [String] The customer subscription identifier
|
444
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
445
|
+
# will be added to the HTTP request.
|
446
|
+
#
|
447
|
+
# @return [ClusterListResult] operation results.
|
448
|
+
#
|
449
|
+
def list(api_version, subscription_id, custom_headers:nil)
|
450
|
+
response = list_async(api_version, subscription_id, custom_headers:custom_headers).value!
|
451
|
+
response.body unless response.nil?
|
452
|
+
end
|
453
|
+
|
454
|
+
#
|
455
|
+
# List cluster resource
|
456
|
+
#
|
457
|
+
# List cluster resource
|
458
|
+
#
|
459
|
+
#
|
460
|
+
# @param api_version [String] The version of the API.
|
461
|
+
# @param subscription_id [String] The customer subscription identifier
|
462
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
463
|
+
# will be added to the HTTP request.
|
464
|
+
#
|
465
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
466
|
+
#
|
467
|
+
def list_with_http_info(api_version, subscription_id, custom_headers:nil)
|
468
|
+
list_async(api_version, subscription_id, custom_headers:custom_headers).value!
|
469
|
+
end
|
470
|
+
|
471
|
+
#
|
472
|
+
# List cluster resource
|
473
|
+
#
|
474
|
+
# List cluster resource
|
475
|
+
#
|
476
|
+
#
|
477
|
+
# @param api_version [String] The version of the API.
|
478
|
+
# @param subscription_id [String] The customer subscription identifier
|
479
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
480
|
+
# to the HTTP request.
|
481
|
+
#
|
482
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
483
|
+
#
|
484
|
+
def list_async(api_version, subscription_id, custom_headers:nil)
|
485
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
486
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
487
|
+
|
488
|
+
|
489
|
+
request_headers = {}
|
490
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
491
|
+
|
492
|
+
# Set Headers
|
493
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
494
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
495
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters'
|
496
|
+
|
497
|
+
request_url = @base_url || @client.base_url
|
498
|
+
|
499
|
+
options = {
|
500
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
501
|
+
path_params: {'subscriptionId' => subscription_id},
|
502
|
+
query_params: {'api-version' => api_version},
|
503
|
+
headers: request_headers.merge(custom_headers || {}),
|
504
|
+
base_url: request_url
|
505
|
+
}
|
506
|
+
promise = @client.make_request_async(:get, path_template, options)
|
507
|
+
|
508
|
+
promise = promise.then do |result|
|
509
|
+
http_response = result.response
|
510
|
+
status_code = http_response.status
|
511
|
+
response_content = http_response.body
|
512
|
+
unless status_code == 200
|
513
|
+
error_model = JSON.load(response_content)
|
514
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
515
|
+
end
|
516
|
+
|
517
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
518
|
+
# Deserialize Response
|
519
|
+
if status_code == 200
|
520
|
+
begin
|
521
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
522
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ClusterListResult.mapper()
|
523
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
524
|
+
rescue Exception => e
|
525
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
526
|
+
end
|
527
|
+
end
|
528
|
+
|
529
|
+
result
|
530
|
+
end
|
531
|
+
|
532
|
+
promise.execute
|
533
|
+
end
|
534
|
+
|
535
|
+
#
|
536
|
+
# Create a ServiceFabric cluster
|
537
|
+
#
|
538
|
+
# Create cluster resource
|
539
|
+
#
|
540
|
+
#
|
541
|
+
# @param resource_group_name [String] The name of the resource group.
|
542
|
+
# @param cluster_name [String] The name of the cluster resource
|
543
|
+
# @param api_version [String] The version of the API.
|
544
|
+
# @param subscription_id [String] The customer subscription identifier
|
545
|
+
# @param parameters [Cluster] The cluster resource.
|
546
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
547
|
+
# will be added to the HTTP request.
|
548
|
+
#
|
549
|
+
# @return [Cluster] operation results.
|
550
|
+
#
|
551
|
+
def begin_create(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
|
552
|
+
response = begin_create_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:custom_headers).value!
|
553
|
+
response.body unless response.nil?
|
554
|
+
end
|
555
|
+
|
556
|
+
#
|
557
|
+
# Create a ServiceFabric cluster
|
558
|
+
#
|
559
|
+
# Create cluster resource
|
560
|
+
#
|
561
|
+
#
|
562
|
+
# @param resource_group_name [String] The name of the resource group.
|
563
|
+
# @param cluster_name [String] The name of the cluster resource
|
564
|
+
# @param api_version [String] The version of the API.
|
565
|
+
# @param subscription_id [String] The customer subscription identifier
|
566
|
+
# @param parameters [Cluster] The cluster resource.
|
567
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
568
|
+
# will be added to the HTTP request.
|
569
|
+
#
|
570
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
571
|
+
#
|
572
|
+
def begin_create_with_http_info(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
|
573
|
+
begin_create_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:custom_headers).value!
|
574
|
+
end
|
575
|
+
|
576
|
+
#
|
577
|
+
# Create a ServiceFabric cluster
|
578
|
+
#
|
579
|
+
# Create cluster resource
|
580
|
+
#
|
581
|
+
#
|
582
|
+
# @param resource_group_name [String] The name of the resource group.
|
583
|
+
# @param cluster_name [String] The name of the cluster resource
|
584
|
+
# @param api_version [String] The version of the API.
|
585
|
+
# @param subscription_id [String] The customer subscription identifier
|
586
|
+
# @param parameters [Cluster] The cluster resource.
|
587
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
588
|
+
# to the HTTP request.
|
589
|
+
#
|
590
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
591
|
+
#
|
592
|
+
def begin_create_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
|
593
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
594
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
595
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
596
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
597
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
598
|
+
|
599
|
+
|
600
|
+
request_headers = {}
|
601
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
602
|
+
|
603
|
+
# Set Headers
|
604
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
605
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
606
|
+
|
607
|
+
# Serialize Request
|
608
|
+
request_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::Cluster.mapper()
|
609
|
+
request_content = @client.serialize(request_mapper, parameters)
|
610
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
611
|
+
|
612
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}'
|
613
|
+
|
614
|
+
request_url = @base_url || @client.base_url
|
615
|
+
|
616
|
+
options = {
|
617
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
618
|
+
path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => subscription_id},
|
619
|
+
query_params: {'api-version' => api_version},
|
620
|
+
body: request_content,
|
621
|
+
headers: request_headers.merge(custom_headers || {}),
|
622
|
+
base_url: request_url
|
623
|
+
}
|
624
|
+
promise = @client.make_request_async(:put, path_template, options)
|
625
|
+
|
626
|
+
promise = promise.then do |result|
|
627
|
+
http_response = result.response
|
628
|
+
status_code = http_response.status
|
629
|
+
response_content = http_response.body
|
630
|
+
unless status_code == 200 || status_code == 202
|
631
|
+
error_model = JSON.load(response_content)
|
632
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
633
|
+
end
|
634
|
+
|
635
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
636
|
+
# Deserialize Response
|
637
|
+
if status_code == 200
|
638
|
+
begin
|
639
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
640
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::Cluster.mapper()
|
641
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
642
|
+
rescue Exception => e
|
643
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
644
|
+
end
|
645
|
+
end
|
646
|
+
|
647
|
+
result
|
648
|
+
end
|
649
|
+
|
650
|
+
promise.execute
|
651
|
+
end
|
652
|
+
|
653
|
+
#
|
654
|
+
# Update cluster configuration
|
655
|
+
#
|
656
|
+
# Update cluster configuration
|
657
|
+
#
|
658
|
+
#
|
659
|
+
# @param resource_group_name [String] The name of the resource group.
|
660
|
+
# @param cluster_name [String] The name of the cluster resource
|
661
|
+
# @param api_version [String] The version of the API.
|
662
|
+
# @param subscription_id [String] The customer subscription identifier
|
663
|
+
# @param parameters [ClusterUpdateParameters] The parameters which contains the
|
664
|
+
# property value and property name which used to update the cluster
|
665
|
+
# configuration.
|
666
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
667
|
+
# will be added to the HTTP request.
|
668
|
+
#
|
669
|
+
# @return [Cluster] operation results.
|
670
|
+
#
|
671
|
+
def begin_update(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
|
672
|
+
response = begin_update_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:custom_headers).value!
|
673
|
+
response.body unless response.nil?
|
674
|
+
end
|
675
|
+
|
676
|
+
#
|
677
|
+
# Update cluster configuration
|
678
|
+
#
|
679
|
+
# Update cluster configuration
|
680
|
+
#
|
681
|
+
#
|
682
|
+
# @param resource_group_name [String] The name of the resource group.
|
683
|
+
# @param cluster_name [String] The name of the cluster resource
|
684
|
+
# @param api_version [String] The version of the API.
|
685
|
+
# @param subscription_id [String] The customer subscription identifier
|
686
|
+
# @param parameters [ClusterUpdateParameters] The parameters which contains the
|
687
|
+
# property value and property name which used to update the cluster
|
688
|
+
# configuration.
|
689
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
690
|
+
# will be added to the HTTP request.
|
691
|
+
#
|
692
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
693
|
+
#
|
694
|
+
def begin_update_with_http_info(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
|
695
|
+
begin_update_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:custom_headers).value!
|
696
|
+
end
|
697
|
+
|
698
|
+
#
|
699
|
+
# Update cluster configuration
|
700
|
+
#
|
701
|
+
# Update cluster configuration
|
702
|
+
#
|
703
|
+
#
|
704
|
+
# @param resource_group_name [String] The name of the resource group.
|
705
|
+
# @param cluster_name [String] The name of the cluster resource
|
706
|
+
# @param api_version [String] The version of the API.
|
707
|
+
# @param subscription_id [String] The customer subscription identifier
|
708
|
+
# @param parameters [ClusterUpdateParameters] The parameters which contains the
|
709
|
+
# property value and property name which used to update the cluster
|
710
|
+
# configuration.
|
711
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
712
|
+
# to the HTTP request.
|
713
|
+
#
|
714
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
715
|
+
#
|
716
|
+
def begin_update_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
|
717
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
718
|
+
fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
|
719
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
720
|
+
fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
|
721
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
722
|
+
|
723
|
+
|
724
|
+
request_headers = {}
|
725
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
726
|
+
|
727
|
+
# Set Headers
|
728
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
729
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
730
|
+
|
731
|
+
# Serialize Request
|
732
|
+
request_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ClusterUpdateParameters.mapper()
|
733
|
+
request_content = @client.serialize(request_mapper, parameters)
|
734
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
735
|
+
|
736
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}'
|
737
|
+
|
738
|
+
request_url = @base_url || @client.base_url
|
739
|
+
|
740
|
+
options = {
|
741
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
742
|
+
path_params: {'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'subscriptionId' => subscription_id},
|
743
|
+
query_params: {'api-version' => api_version},
|
744
|
+
body: request_content,
|
745
|
+
headers: request_headers.merge(custom_headers || {}),
|
746
|
+
base_url: request_url
|
747
|
+
}
|
748
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
749
|
+
|
750
|
+
promise = promise.then do |result|
|
751
|
+
http_response = result.response
|
752
|
+
status_code = http_response.status
|
753
|
+
response_content = http_response.body
|
754
|
+
unless status_code == 200 || status_code == 202
|
755
|
+
error_model = JSON.load(response_content)
|
756
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
757
|
+
end
|
758
|
+
|
759
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
760
|
+
# Deserialize Response
|
761
|
+
if status_code == 200
|
762
|
+
begin
|
763
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
764
|
+
result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::Cluster.mapper()
|
765
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
766
|
+
rescue Exception => e
|
767
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
768
|
+
end
|
769
|
+
end
|
770
|
+
|
771
|
+
result
|
772
|
+
end
|
773
|
+
|
774
|
+
promise.execute
|
775
|
+
end
|
776
|
+
|
777
|
+
end
|
778
|
+
end
|