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