azure_mgmt_service_fabric 0.16.0 → 0.17.0

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