azure_mgmt_container_instance 0.17.6 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  3. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  4. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  5. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  6. data/lib/2018-04-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  7. data/lib/2018-06-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  8. data/lib/2018-09-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  9. data/lib/2018-10-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  10. data/lib/2019-12-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +1 -1
  11. data/lib/2020-11-01/generated/azure_mgmt_container_instance.rb +92 -0
  12. data/lib/2020-11-01/generated/azure_mgmt_container_instance/container_groups.rb +1404 -0
  13. data/lib/2020-11-01/generated/azure_mgmt_container_instance/container_instance_management_client.rb +145 -0
  14. data/lib/2020-11-01/generated/azure_mgmt_container_instance/containers.rb +375 -0
  15. data/lib/2020-11-01/generated/azure_mgmt_container_instance/location.rb +552 -0
  16. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/azure_file_volume.rb +84 -0
  17. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/cached_images.rb +57 -0
  18. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/cached_images_list_result.rb +98 -0
  19. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/capabilities.rb +108 -0
  20. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/capabilities_capabilities.rb +71 -0
  21. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/capabilities_list_result.rb +98 -0
  22. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container.rb +192 -0
  23. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_attach_response.rb +59 -0
  24. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_exec.rb +54 -0
  25. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_exec_request.rb +58 -0
  26. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_exec_request_terminal_size.rb +57 -0
  27. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_exec_response.rb +57 -0
  28. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group.rb +314 -0
  29. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group_diagnostics.rb +47 -0
  30. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group_identity.rb +102 -0
  31. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group_identity_user_assigned_identities_value.rb +61 -0
  32. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group_ip_address_type.rb +16 -0
  33. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +99 -0
  34. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group_network_profile.rb +46 -0
  35. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb +16 -0
  36. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb +69 -0
  37. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb +17 -0
  38. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_group_sku.rb +16 -0
  39. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_http_get.rb +80 -0
  40. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb +16 -0
  41. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_network_protocol.rb +16 -0
  42. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_port.rb +58 -0
  43. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_probe.rb +114 -0
  44. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb +95 -0
  45. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/container_state.rb +99 -0
  46. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/dns_configuration.rb +77 -0
  47. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/encryption_properties.rb +68 -0
  48. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/environment_variable.rb +68 -0
  49. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/event.rb +107 -0
  50. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/git_repo_volume.rb +72 -0
  51. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/gpu_resource.rb +58 -0
  52. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/gpu_sku.rb +17 -0
  53. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/http_headers.rb +57 -0
  54. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/image_registry_credential.rb +69 -0
  55. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/init_container_definition.rb +133 -0
  56. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/init_container_properties_definition_instance_view.rb +96 -0
  57. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/ip_address.rb +102 -0
  58. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/log_analytics.rb +108 -0
  59. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/log_analytics_log_type.rb +16 -0
  60. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/logs.rb +46 -0
  61. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/operating_system_types.rb +16 -0
  62. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/operation.rb +81 -0
  63. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/operation_display.rb +79 -0
  64. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/operation_list_result.rb +99 -0
  65. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/port.rb +58 -0
  66. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/resource.rb +110 -0
  67. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/resource_identity_type.rb +18 -0
  68. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/resource_limits.rb +69 -0
  69. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/resource_requests.rb +69 -0
  70. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/resource_requirements.rb +61 -0
  71. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/scheme.rb +16 -0
  72. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/usage.rb +84 -0
  73. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/usage_list_result.rb +56 -0
  74. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/usage_name.rb +59 -0
  75. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/volume.rb +100 -0
  76. data/lib/2020-11-01/generated/azure_mgmt_container_instance/models/volume_mount.rb +70 -0
  77. data/lib/2020-11-01/generated/azure_mgmt_container_instance/module_definition.rb +9 -0
  78. data/lib/2020-11-01/generated/azure_mgmt_container_instance/operations.rb +219 -0
  79. data/lib/azure_mgmt_container_instance.rb +6 -5
  80. data/lib/profiles/latest/modules/containerinstance_profile_module.rb +149 -141
  81. data/lib/version.rb +1 -1
  82. metadata +71 -3
@@ -0,0 +1,552 @@
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::ContainerInstance::Mgmt::V2020_11_01
7
+ #
8
+ # Location
9
+ #
10
+ class Location
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Location class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ContainerInstanceManagementClient] reference to the ContainerInstanceManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get the usage for a subscription
26
+ #
27
+ # @param location [String] The identifier for the physical azure location.
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [UsageListResult] operation results.
32
+ #
33
+ def list_usage(location, custom_headers:nil)
34
+ response = list_usage_async(location, custom_headers:custom_headers).value!
35
+ response.body unless response.nil?
36
+ end
37
+
38
+ #
39
+ # Get the usage for a subscription
40
+ #
41
+ # @param location [String] The identifier for the physical azure location.
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def list_usage_with_http_info(location, custom_headers:nil)
48
+ list_usage_async(location, custom_headers:custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Get the usage for a subscription
53
+ #
54
+ # @param location [String] The identifier for the physical azure location.
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def list_usage_async(location, custom_headers:nil)
61
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
62
+ fail ArgumentError, 'location is nil' if location.nil?
63
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
64
+
65
+
66
+ request_headers = {}
67
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
68
+
69
+ # Set Headers
70
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
71
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
72
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages'
73
+
74
+ request_url = @base_url || @client.base_url
75
+
76
+ options = {
77
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
78
+ path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
79
+ query_params: {'api-version' => @client.api_version},
80
+ headers: request_headers.merge(custom_headers || {}),
81
+ base_url: request_url
82
+ }
83
+ promise = @client.make_request_async(:get, path_template, options)
84
+
85
+ promise = promise.then do |result|
86
+ http_response = result.response
87
+ status_code = http_response.status
88
+ response_content = http_response.body
89
+ unless status_code == 200
90
+ error_model = JSON.load(response_content)
91
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
92
+ end
93
+
94
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
95
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
96
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::ContainerInstance::Mgmt::V2020_11_01::Models::UsageListResult.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
+ # Get the list of cached images.
116
+ #
117
+ # Get the list of cached images on specific OS type for a subscription in a
118
+ # region.
119
+ #
120
+ # @param location [String] The identifier for the physical azure location.
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<CachedImages>] operation results.
125
+ #
126
+ def list_cached_images(location, custom_headers:nil)
127
+ first_page = list_cached_images_as_lazy(location, custom_headers:custom_headers)
128
+ first_page.get_all_items
129
+ end
130
+
131
+ #
132
+ # Get the list of cached images.
133
+ #
134
+ # Get the list of cached images on specific OS type for a subscription in a
135
+ # region.
136
+ #
137
+ # @param location [String] The identifier for the physical azure location.
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_cached_images_with_http_info(location, custom_headers:nil)
144
+ list_cached_images_async(location, custom_headers:custom_headers).value!
145
+ end
146
+
147
+ #
148
+ # Get the list of cached images.
149
+ #
150
+ # Get the list of cached images on specific OS type for a subscription in a
151
+ # region.
152
+ #
153
+ # @param location [String] The identifier for the physical azure location.
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_cached_images_async(location, custom_headers:nil)
160
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
161
+ fail ArgumentError, 'location is nil' if location.nil?
162
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
163
+
164
+
165
+ request_headers = {}
166
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
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.ContainerInstance/locations/{location}/cachedImages'
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: {'subscriptionId' => @client.subscription_id,'location' => location},
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
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
195
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
196
+ # Deserialize Response
197
+ if status_code == 200
198
+ begin
199
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
200
+ result_mapper = Azure::ContainerInstance::Mgmt::V2020_11_01::Models::CachedImagesListResult.mapper()
201
+ result.body = @client.deserialize(result_mapper, parsed_response)
202
+ rescue Exception => e
203
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
204
+ end
205
+ end
206
+
207
+ result
208
+ end
209
+
210
+ promise.execute
211
+ end
212
+
213
+ #
214
+ # Get the list of capabilities of the location.
215
+ #
216
+ # Get the list of CPU/memory/GPU capabilities of a region.
217
+ #
218
+ # @param location [String] The identifier for the physical azure location.
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [Array<Capabilities>] operation results.
223
+ #
224
+ def list_capabilities(location, custom_headers:nil)
225
+ first_page = list_capabilities_as_lazy(location, custom_headers:custom_headers)
226
+ first_page.get_all_items
227
+ end
228
+
229
+ #
230
+ # Get the list of capabilities of the location.
231
+ #
232
+ # Get the list of CPU/memory/GPU capabilities of a region.
233
+ #
234
+ # @param location [String] The identifier for the physical azure location.
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
239
+ #
240
+ def list_capabilities_with_http_info(location, custom_headers:nil)
241
+ list_capabilities_async(location, custom_headers:custom_headers).value!
242
+ end
243
+
244
+ #
245
+ # Get the list of capabilities of the location.
246
+ #
247
+ # Get the list of CPU/memory/GPU capabilities of a region.
248
+ #
249
+ # @param location [String] The identifier for the physical azure location.
250
+ # @param [Hash{String => String}] A hash of custom headers that will be added
251
+ # to the HTTP request.
252
+ #
253
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
254
+ #
255
+ def list_capabilities_async(location, custom_headers:nil)
256
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
257
+ fail ArgumentError, 'location is nil' if location.nil?
258
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
259
+
260
+
261
+ request_headers = {}
262
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
263
+
264
+ # Set Headers
265
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
266
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
267
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities'
268
+
269
+ request_url = @base_url || @client.base_url
270
+
271
+ options = {
272
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
273
+ path_params: {'subscriptionId' => @client.subscription_id,'location' => location},
274
+ query_params: {'api-version' => @client.api_version},
275
+ headers: request_headers.merge(custom_headers || {}),
276
+ base_url: request_url
277
+ }
278
+ promise = @client.make_request_async(:get, path_template, options)
279
+
280
+ promise = promise.then do |result|
281
+ http_response = result.response
282
+ status_code = http_response.status
283
+ response_content = http_response.body
284
+ unless status_code == 200
285
+ error_model = JSON.load(response_content)
286
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
287
+ end
288
+
289
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
290
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
291
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
292
+ # Deserialize Response
293
+ if status_code == 200
294
+ begin
295
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
296
+ result_mapper = Azure::ContainerInstance::Mgmt::V2020_11_01::Models::CapabilitiesListResult.mapper()
297
+ result.body = @client.deserialize(result_mapper, parsed_response)
298
+ rescue Exception => e
299
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
300
+ end
301
+ end
302
+
303
+ result
304
+ end
305
+
306
+ promise.execute
307
+ end
308
+
309
+ #
310
+ # Get the list of cached images.
311
+ #
312
+ # Get the list of cached images on specific OS type for a subscription in a
313
+ # region.
314
+ #
315
+ # @param next_page_link [String] The NextLink from the previous successful call
316
+ # to List operation.
317
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
318
+ # will be added to the HTTP request.
319
+ #
320
+ # @return [CachedImagesListResult] operation results.
321
+ #
322
+ def list_cached_images_next(next_page_link, custom_headers:nil)
323
+ response = list_cached_images_next_async(next_page_link, custom_headers:custom_headers).value!
324
+ response.body unless response.nil?
325
+ end
326
+
327
+ #
328
+ # Get the list of cached images.
329
+ #
330
+ # Get the list of cached images on specific OS type for a subscription in a
331
+ # region.
332
+ #
333
+ # @param next_page_link [String] The NextLink from the previous successful call
334
+ # to List operation.
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_cached_images_next_with_http_info(next_page_link, custom_headers:nil)
341
+ list_cached_images_next_async(next_page_link, custom_headers:custom_headers).value!
342
+ end
343
+
344
+ #
345
+ # Get the list of cached images.
346
+ #
347
+ # Get the list of cached images on specific OS type for a subscription in a
348
+ # region.
349
+ #
350
+ # @param next_page_link [String] The NextLink from the previous successful call
351
+ # to List operation.
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_cached_images_next_async(next_page_link, custom_headers:nil)
358
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
359
+
360
+
361
+ request_headers = {}
362
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
363
+
364
+ # Set Headers
365
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
366
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
367
+ path_template = '{nextLink}'
368
+
369
+ request_url = @base_url || @client.base_url
370
+
371
+ options = {
372
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
373
+ skip_encoding_path_params: {'nextLink' => next_page_link},
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
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
390
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
391
+ # Deserialize Response
392
+ if status_code == 200
393
+ begin
394
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
395
+ result_mapper = Azure::ContainerInstance::Mgmt::V2020_11_01::Models::CachedImagesListResult.mapper()
396
+ result.body = @client.deserialize(result_mapper, parsed_response)
397
+ rescue Exception => e
398
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
399
+ end
400
+ end
401
+
402
+ result
403
+ end
404
+
405
+ promise.execute
406
+ end
407
+
408
+ #
409
+ # Get the list of capabilities of the location.
410
+ #
411
+ # Get the list of CPU/memory/GPU capabilities of a region.
412
+ #
413
+ # @param next_page_link [String] The NextLink from the previous successful call
414
+ # to List operation.
415
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
416
+ # will be added to the HTTP request.
417
+ #
418
+ # @return [CapabilitiesListResult] operation results.
419
+ #
420
+ def list_capabilities_next(next_page_link, custom_headers:nil)
421
+ response = list_capabilities_next_async(next_page_link, custom_headers:custom_headers).value!
422
+ response.body unless response.nil?
423
+ end
424
+
425
+ #
426
+ # Get the list of capabilities of the location.
427
+ #
428
+ # Get the list of CPU/memory/GPU capabilities of a region.
429
+ #
430
+ # @param next_page_link [String] The NextLink from the previous successful call
431
+ # to List operation.
432
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
433
+ # will be added to the HTTP request.
434
+ #
435
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
436
+ #
437
+ def list_capabilities_next_with_http_info(next_page_link, custom_headers:nil)
438
+ list_capabilities_next_async(next_page_link, custom_headers:custom_headers).value!
439
+ end
440
+
441
+ #
442
+ # Get the list of capabilities of the location.
443
+ #
444
+ # Get the list of CPU/memory/GPU capabilities of a region.
445
+ #
446
+ # @param next_page_link [String] The NextLink from the previous successful call
447
+ # to List operation.
448
+ # @param [Hash{String => String}] A hash of custom headers that will be added
449
+ # to the HTTP request.
450
+ #
451
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
452
+ #
453
+ def list_capabilities_next_async(next_page_link, custom_headers:nil)
454
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
455
+
456
+
457
+ request_headers = {}
458
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
459
+
460
+ # Set Headers
461
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
462
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
463
+ path_template = '{nextLink}'
464
+
465
+ request_url = @base_url || @client.base_url
466
+
467
+ options = {
468
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
469
+ skip_encoding_path_params: {'nextLink' => next_page_link},
470
+ headers: request_headers.merge(custom_headers || {}),
471
+ base_url: request_url
472
+ }
473
+ promise = @client.make_request_async(:get, path_template, options)
474
+
475
+ promise = promise.then do |result|
476
+ http_response = result.response
477
+ status_code = http_response.status
478
+ response_content = http_response.body
479
+ unless status_code == 200
480
+ error_model = JSON.load(response_content)
481
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
482
+ end
483
+
484
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
485
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
486
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
487
+ # Deserialize Response
488
+ if status_code == 200
489
+ begin
490
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
491
+ result_mapper = Azure::ContainerInstance::Mgmt::V2020_11_01::Models::CapabilitiesListResult.mapper()
492
+ result.body = @client.deserialize(result_mapper, parsed_response)
493
+ rescue Exception => e
494
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
495
+ end
496
+ end
497
+
498
+ result
499
+ end
500
+
501
+ promise.execute
502
+ end
503
+
504
+ #
505
+ # Get the list of cached images.
506
+ #
507
+ # Get the list of cached images on specific OS type for a subscription in a
508
+ # region.
509
+ #
510
+ # @param location [String] The identifier for the physical azure location.
511
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
512
+ # will be added to the HTTP request.
513
+ #
514
+ # @return [CachedImagesListResult] which provide lazy access to pages of the
515
+ # response.
516
+ #
517
+ def list_cached_images_as_lazy(location, custom_headers:nil)
518
+ response = list_cached_images_async(location, custom_headers:custom_headers).value!
519
+ unless response.nil?
520
+ page = response.body
521
+ page.next_method = Proc.new do |next_page_link|
522
+ list_cached_images_next_async(next_page_link, custom_headers:custom_headers)
523
+ end
524
+ page
525
+ end
526
+ end
527
+
528
+ #
529
+ # Get the list of capabilities of the location.
530
+ #
531
+ # Get the list of CPU/memory/GPU capabilities of a region.
532
+ #
533
+ # @param location [String] The identifier for the physical azure location.
534
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
535
+ # will be added to the HTTP request.
536
+ #
537
+ # @return [CapabilitiesListResult] which provide lazy access to pages of the
538
+ # response.
539
+ #
540
+ def list_capabilities_as_lazy(location, custom_headers:nil)
541
+ response = list_capabilities_async(location, custom_headers:custom_headers).value!
542
+ unless response.nil?
543
+ page = response.body
544
+ page.next_method = Proc.new do |next_page_link|
545
+ list_capabilities_next_async(next_page_link, custom_headers:custom_headers)
546
+ end
547
+ page
548
+ end
549
+ end
550
+
551
+ end
552
+ end