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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/cluster_versions.rb +51 -44
  3. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/clusters.rb +62 -58
  4. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/operations.rb +15 -13
  5. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +4 -1
  6. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric.rb +91 -0
  7. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application.rb +691 -0
  8. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application_type.rb +487 -0
  9. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/cluster_versions.rb +471 -0
  10. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb +778 -0
  11. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_health_policy.rb +104 -0
  12. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_metric_description.rb +113 -0
  13. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_parameter.rb +58 -0
  14. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource.rb +206 -0
  15. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_list.rb +55 -0
  16. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_update.rb +182 -0
  17. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource.rb +83 -0
  18. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource_list.rb +55 -0
  19. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_upgrade_policy.rb +81 -0
  20. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/available_operation_display.rb +79 -0
  21. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/azure_active_directory.rb +68 -0
  22. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/certificate_description.rb +70 -0
  23. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_common_name.rb +70 -0
  24. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_thumbprint.rb +59 -0
  25. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster.rb +398 -0
  26. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb +66 -0
  27. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_result.rb +102 -0
  28. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_health_policy.rb +70 -0
  29. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb +66 -0
  30. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_update_parameters.rb +246 -0
  31. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_delta_health_policy.rb +97 -0
  32. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_policy.rb +156 -0
  33. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_version_details.rb +69 -0
  34. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/diagnostics_storage_account_config.rb +91 -0
  35. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/endpoint_range_description.rb +57 -0
  36. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/error_model.rb +57 -0
  37. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/named_partition_scheme_description.rb +81 -0
  38. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/node_type_description.rb +189 -0
  39. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_list_result.rb +101 -0
  40. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_result.rb +81 -0
  41. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/partition_scheme_description.rb +48 -0
  42. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/provisioning_state.rb +18 -0
  43. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/proxy_resource.rb +82 -0
  44. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/resource.rb +101 -0
  45. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/rolling_upgrade_monitoring_policy.rb +90 -0
  46. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_correlation_description.rb +58 -0
  47. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_load_metric_description.rb +98 -0
  48. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_placement_policy_description.rb +46 -0
  49. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties.rb +151 -0
  50. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties_base.rb +123 -0
  51. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource.rb +207 -0
  52. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_list.rb +55 -0
  53. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_update.rb +169 -0
  54. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_delta_health_policy.rb +51 -0
  55. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy.rb +108 -0
  56. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy_map_item.rb +60 -0
  57. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_update_properties.rb +113 -0
  58. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_parameter_description.rb +57 -0
  59. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_section_description.rb +67 -0
  60. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/singleton_partition_scheme_description.rb +51 -0
  61. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_properties.rb +227 -0
  62. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_update_properties.rb +186 -0
  63. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_properties.rb +161 -0
  64. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_update_properties.rb +133 -0
  65. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/uniform_int64range_partition_scheme_description.rb +91 -0
  66. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource.rb +115 -0
  67. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource_list.rb +55 -0
  68. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/module_definition.rb +9 -0
  69. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/operations.rb +230 -0
  70. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service.rb +735 -0
  71. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +147 -0
  72. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/version.rb +559 -0
  73. data/lib/azure_mgmt_service_fabric.rb +1 -0
  74. data/lib/profiles/latest/modules/servicefabric_profile_module.rb +269 -114
  75. data/lib/profiles/latest/servicefabric_latest_profile_client.rb +28 -9
  76. data/lib/profiles/latest/servicefabric_module_definition.rb +0 -1
  77. data/lib/version.rb +1 -1
  78. metadata +70 -3
@@ -0,0 +1,471 @@
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 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
+ # Get cluster code versions
26
+ #
27
+ # Get cluster code versions by location
28
+ #
29
+ #
30
+ # @param location [String] The location for the cluster code versions, this is
31
+ # different from cluster location
32
+ # @param api_version [String] The version of the API.
33
+ # @param subscription_id [String] The customer subscription identifier
34
+ # @param cluster_version [String] The cluster code version
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [ClusterCodeVersionsListResult] operation results.
39
+ #
40
+ def get(location, api_version, subscription_id, cluster_version, custom_headers:nil)
41
+ response = get_async(location, api_version, subscription_id, cluster_version, custom_headers:custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # Get cluster code versions
47
+ #
48
+ # Get cluster code versions by location
49
+ #
50
+ #
51
+ # @param location [String] The location for the cluster code versions, this is
52
+ # different from cluster location
53
+ # @param api_version [String] The version of the API.
54
+ # @param subscription_id [String] The customer subscription identifier
55
+ # @param cluster_version [String] The cluster code version
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
+ #
61
+ def get_with_http_info(location, api_version, subscription_id, cluster_version, custom_headers:nil)
62
+ get_async(location, api_version, subscription_id, cluster_version, custom_headers:custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Get cluster code versions
67
+ #
68
+ # Get cluster code versions by location
69
+ #
70
+ #
71
+ # @param location [String] The location for the cluster code versions, this is
72
+ # different from cluster location
73
+ # @param api_version [String] The version of the API.
74
+ # @param subscription_id [String] The customer subscription identifier
75
+ # @param cluster_version [String] The cluster code version
76
+ # @param [Hash{String => String}] A hash of custom headers that will be added
77
+ # to the HTTP request.
78
+ #
79
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
+ #
81
+ def get_async(location, api_version, subscription_id, cluster_version, custom_headers:nil)
82
+ fail ArgumentError, 'location is nil' if location.nil?
83
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
84
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
85
+ fail ArgumentError, 'cluster_version is nil' if cluster_version.nil?
86
+
87
+
88
+ request_headers = {}
89
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
90
+
91
+ # Set Headers
92
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
93
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
94
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}'
95
+
96
+ request_url = @base_url || @client.base_url
97
+
98
+ options = {
99
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
100
+ path_params: {'location' => location,'subscriptionId' => subscription_id,'clusterVersion' => cluster_version},
101
+ query_params: {'api-version' => api_version},
102
+ headers: request_headers.merge(custom_headers || {}),
103
+ base_url: request_url
104
+ }
105
+ promise = @client.make_request_async(:get, path_template, options)
106
+
107
+ promise = promise.then do |result|
108
+ http_response = result.response
109
+ status_code = http_response.status
110
+ response_content = http_response.body
111
+ unless status_code == 200
112
+ error_model = JSON.load(response_content)
113
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
114
+ end
115
+
116
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
117
+ # Deserialize Response
118
+ if status_code == 200
119
+ begin
120
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
121
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ClusterCodeVersionsListResult.mapper()
122
+ result.body = @client.deserialize(result_mapper, parsed_response)
123
+ rescue Exception => e
124
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
125
+ end
126
+ end
127
+
128
+ result
129
+ end
130
+
131
+ promise.execute
132
+ end
133
+
134
+ #
135
+ # Get cluster code versions by environment
136
+ #
137
+ # Get cluster code versions by environment
138
+ #
139
+ #
140
+ # @param location [String] The location for the cluster code versions, this is
141
+ # different from cluster location
142
+ # @param environment [Enum] Cluster operating system, the default means all.
143
+ # Possible values include: 'Windows', 'Linux'
144
+ # @param api_version [String] The version of the API.
145
+ # @param subscription_id [String] The customer subscription identifier
146
+ # @param cluster_version [String] The cluster code version
147
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
148
+ # will be added to the HTTP request.
149
+ #
150
+ # @return [ClusterCodeVersionsListResult] operation results.
151
+ #
152
+ def get_by_environment(location, environment, api_version, subscription_id, cluster_version, custom_headers:nil)
153
+ response = get_by_environment_async(location, environment, api_version, subscription_id, cluster_version, custom_headers:custom_headers).value!
154
+ response.body unless response.nil?
155
+ end
156
+
157
+ #
158
+ # Get cluster code versions by environment
159
+ #
160
+ # Get cluster code versions by environment
161
+ #
162
+ #
163
+ # @param location [String] The location for the cluster code versions, this is
164
+ # different from cluster location
165
+ # @param environment [Enum] Cluster operating system, the default means all.
166
+ # Possible values include: 'Windows', 'Linux'
167
+ # @param api_version [String] The version of the API.
168
+ # @param subscription_id [String] The customer subscription identifier
169
+ # @param cluster_version [String] The cluster code version
170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
171
+ # will be added to the HTTP request.
172
+ #
173
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
174
+ #
175
+ def get_by_environment_with_http_info(location, environment, api_version, subscription_id, cluster_version, custom_headers:nil)
176
+ get_by_environment_async(location, environment, api_version, subscription_id, cluster_version, custom_headers:custom_headers).value!
177
+ end
178
+
179
+ #
180
+ # Get cluster code versions by environment
181
+ #
182
+ # Get cluster code versions by environment
183
+ #
184
+ #
185
+ # @param location [String] The location for the cluster code versions, this is
186
+ # different from cluster location
187
+ # @param environment [Enum] Cluster operating system, the default means all.
188
+ # Possible values include: 'Windows', 'Linux'
189
+ # @param api_version [String] The version of the API.
190
+ # @param subscription_id [String] The customer subscription identifier
191
+ # @param cluster_version [String] The cluster code version
192
+ # @param [Hash{String => String}] A hash of custom headers that will be added
193
+ # to the HTTP request.
194
+ #
195
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
196
+ #
197
+ def get_by_environment_async(location, environment, api_version, subscription_id, cluster_version, custom_headers:nil)
198
+ fail ArgumentError, 'location is nil' if location.nil?
199
+ fail ArgumentError, 'environment is nil' if environment.nil?
200
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
201
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
202
+ fail ArgumentError, 'cluster_version is nil' if cluster_version.nil?
203
+
204
+
205
+ request_headers = {}
206
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
207
+
208
+ # Set Headers
209
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
210
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
211
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}'
212
+
213
+ request_url = @base_url || @client.base_url
214
+
215
+ options = {
216
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
217
+ path_params: {'location' => location,'environment' => environment,'subscriptionId' => subscription_id,'clusterVersion' => cluster_version},
218
+ query_params: {'api-version' => api_version},
219
+ headers: request_headers.merge(custom_headers || {}),
220
+ base_url: request_url
221
+ }
222
+ promise = @client.make_request_async(:get, path_template, options)
223
+
224
+ promise = promise.then do |result|
225
+ http_response = result.response
226
+ status_code = http_response.status
227
+ response_content = http_response.body
228
+ unless status_code == 200
229
+ error_model = JSON.load(response_content)
230
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
231
+ end
232
+
233
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
234
+ # Deserialize Response
235
+ if status_code == 200
236
+ begin
237
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
238
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ClusterCodeVersionsListResult.mapper()
239
+ result.body = @client.deserialize(result_mapper, parsed_response)
240
+ rescue Exception => e
241
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
242
+ end
243
+ end
244
+
245
+ result
246
+ end
247
+
248
+ promise.execute
249
+ end
250
+
251
+ #
252
+ # List cluster code versions by location
253
+ #
254
+ # List cluster code versions by location
255
+ #
256
+ #
257
+ # @param location [String] The location for the cluster code versions, this is
258
+ # different from cluster location
259
+ # @param api_version [String] The version of the API.
260
+ # @param subscription_id [String] The customer subscription identifier
261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
262
+ # will be added to the HTTP request.
263
+ #
264
+ # @return [ClusterCodeVersionsListResult] operation results.
265
+ #
266
+ def list(location, api_version, subscription_id, custom_headers:nil)
267
+ response = list_async(location, api_version, subscription_id, custom_headers:custom_headers).value!
268
+ response.body unless response.nil?
269
+ end
270
+
271
+ #
272
+ # List cluster code versions by location
273
+ #
274
+ # List cluster code versions by location
275
+ #
276
+ #
277
+ # @param location [String] The location for the cluster code versions, this is
278
+ # different from cluster location
279
+ # @param api_version [String] The version of the API.
280
+ # @param subscription_id [String] The customer subscription identifier
281
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
282
+ # will be added to the HTTP request.
283
+ #
284
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
285
+ #
286
+ def list_with_http_info(location, api_version, subscription_id, custom_headers:nil)
287
+ list_async(location, api_version, subscription_id, custom_headers:custom_headers).value!
288
+ end
289
+
290
+ #
291
+ # List cluster code versions by location
292
+ #
293
+ # List cluster code versions by location
294
+ #
295
+ #
296
+ # @param location [String] The location for the cluster code versions, this is
297
+ # different from cluster location
298
+ # @param api_version [String] The version of the API.
299
+ # @param subscription_id [String] The customer subscription identifier
300
+ # @param [Hash{String => String}] A hash of custom headers that will be added
301
+ # to the HTTP request.
302
+ #
303
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
304
+ #
305
+ def list_async(location, api_version, subscription_id, custom_headers:nil)
306
+ fail ArgumentError, 'location is nil' if location.nil?
307
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
308
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
309
+
310
+
311
+ request_headers = {}
312
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
313
+
314
+ # Set Headers
315
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
316
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
317
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions'
318
+
319
+ request_url = @base_url || @client.base_url
320
+
321
+ options = {
322
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
323
+ path_params: {'location' => location,'subscriptionId' => subscription_id},
324
+ query_params: {'api-version' => api_version},
325
+ headers: request_headers.merge(custom_headers || {}),
326
+ base_url: request_url
327
+ }
328
+ promise = @client.make_request_async(:get, path_template, options)
329
+
330
+ promise = promise.then do |result|
331
+ http_response = result.response
332
+ status_code = http_response.status
333
+ response_content = http_response.body
334
+ unless status_code == 200
335
+ error_model = JSON.load(response_content)
336
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
337
+ end
338
+
339
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
340
+ # Deserialize Response
341
+ if status_code == 200
342
+ begin
343
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
344
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ClusterCodeVersionsListResult.mapper()
345
+ result.body = @client.deserialize(result_mapper, parsed_response)
346
+ rescue Exception => e
347
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
348
+ end
349
+ end
350
+
351
+ result
352
+ end
353
+
354
+ promise.execute
355
+ end
356
+
357
+ #
358
+ # List cluster code versions by environment
359
+ #
360
+ # List cluster code versions by environment
361
+ #
362
+ #
363
+ # @param location [String] The location for the cluster code versions, this is
364
+ # different from cluster location
365
+ # @param environment [Enum] Cluster operating system, the default means all.
366
+ # Possible values include: 'Windows', 'Linux'
367
+ # @param api_version [String] The version of the API.
368
+ # @param subscription_id [String] The customer subscription identifier
369
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
370
+ # will be added to the HTTP request.
371
+ #
372
+ # @return [ClusterCodeVersionsListResult] operation results.
373
+ #
374
+ def list_by_environment(location, environment, api_version, subscription_id, custom_headers:nil)
375
+ response = list_by_environment_async(location, environment, api_version, subscription_id, custom_headers:custom_headers).value!
376
+ response.body unless response.nil?
377
+ end
378
+
379
+ #
380
+ # List cluster code versions by environment
381
+ #
382
+ # List cluster code versions by environment
383
+ #
384
+ #
385
+ # @param location [String] The location for the cluster code versions, this is
386
+ # different from cluster location
387
+ # @param environment [Enum] Cluster operating system, the default means all.
388
+ # Possible values include: 'Windows', 'Linux'
389
+ # @param api_version [String] The version of the API.
390
+ # @param subscription_id [String] The customer subscription identifier
391
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
392
+ # will be added to the HTTP request.
393
+ #
394
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
395
+ #
396
+ def list_by_environment_with_http_info(location, environment, api_version, subscription_id, custom_headers:nil)
397
+ list_by_environment_async(location, environment, api_version, subscription_id, custom_headers:custom_headers).value!
398
+ end
399
+
400
+ #
401
+ # List cluster code versions by environment
402
+ #
403
+ # List cluster code versions by environment
404
+ #
405
+ #
406
+ # @param location [String] The location for the cluster code versions, this is
407
+ # different from cluster location
408
+ # @param environment [Enum] Cluster operating system, the default means all.
409
+ # Possible values include: 'Windows', 'Linux'
410
+ # @param api_version [String] The version of the API.
411
+ # @param subscription_id [String] The customer subscription identifier
412
+ # @param [Hash{String => String}] A hash of custom headers that will be added
413
+ # to the HTTP request.
414
+ #
415
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
416
+ #
417
+ def list_by_environment_async(location, environment, api_version, subscription_id, custom_headers:nil)
418
+ fail ArgumentError, 'location is nil' if location.nil?
419
+ fail ArgumentError, 'environment is nil' if environment.nil?
420
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
421
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
422
+
423
+
424
+ request_headers = {}
425
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
426
+
427
+ # Set Headers
428
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
429
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
430
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions'
431
+
432
+ request_url = @base_url || @client.base_url
433
+
434
+ options = {
435
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
436
+ path_params: {'location' => location,'environment' => environment,'subscriptionId' => subscription_id},
437
+ query_params: {'api-version' => api_version},
438
+ headers: request_headers.merge(custom_headers || {}),
439
+ base_url: request_url
440
+ }
441
+ promise = @client.make_request_async(:get, path_template, options)
442
+
443
+ promise = promise.then do |result|
444
+ http_response = result.response
445
+ status_code = http_response.status
446
+ response_content = http_response.body
447
+ unless status_code == 200
448
+ error_model = JSON.load(response_content)
449
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
450
+ end
451
+
452
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
453
+ # Deserialize Response
454
+ if status_code == 200
455
+ begin
456
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
457
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ClusterCodeVersionsListResult.mapper()
458
+ result.body = @client.deserialize(result_mapper, parsed_response)
459
+ rescue Exception => e
460
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
461
+ end
462
+ end
463
+
464
+ result
465
+ end
466
+
467
+ promise.execute
468
+ end
469
+
470
+ end
471
+ end