azure_mgmt_container_instance 0.15.2 → 0.16.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 (122) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/container_groups.rb +48 -43
  3. data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +4 -1
  4. data/lib/2017-08-01-preview/generated/azure_mgmt_container_instance/container_logs.rb +6 -5
  5. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance.rb +58 -0
  6. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/container_groups.rb +824 -0
  7. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +140 -0
  8. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/container_logs.rb +139 -0
  9. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/azure_file_volume.rb +84 -0
  10. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container.rb +168 -0
  11. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_group.rb +216 -0
  12. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +99 -0
  13. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb +16 -0
  14. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb +69 -0
  15. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb +17 -0
  16. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb +16 -0
  17. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_network_protocol.rb +16 -0
  18. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_port.rb +58 -0
  19. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb +95 -0
  20. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/container_state.rb +94 -0
  21. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/environment_variable.rb +57 -0
  22. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/event.rb +101 -0
  23. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/image_registry_credential.rb +69 -0
  24. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/ip_address.rb +80 -0
  25. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/logs.rb +46 -0
  26. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/operating_system_types.rb +16 -0
  27. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/operation.rb +70 -0
  28. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/operation_display.rb +79 -0
  29. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/operation_list_result.rb +56 -0
  30. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/port.rb +58 -0
  31. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/resource.rb +101 -0
  32. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/resource_limits.rb +57 -0
  33. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/resource_requests.rb +57 -0
  34. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/resource_requirements.rb +61 -0
  35. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/volume.rb +69 -0
  36. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/models/volume_mount.rb +70 -0
  37. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/module_definition.rb +9 -0
  38. data/lib/2017-10-01-preview/generated/azure_mgmt_container_instance/operations.rb +107 -0
  39. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance.rb +63 -0
  40. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_group_usage.rb +113 -0
  41. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_groups.rb +824 -0
  42. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +144 -0
  43. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/container_logs.rb +139 -0
  44. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/azure_file_volume.rb +84 -0
  45. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container.rb +168 -0
  46. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_group.rb +216 -0
  47. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +99 -0
  48. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb +16 -0
  49. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb +69 -0
  50. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb +17 -0
  51. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb +16 -0
  52. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_network_protocol.rb +16 -0
  53. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_port.rb +58 -0
  54. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb +95 -0
  55. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/container_state.rb +94 -0
  56. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/environment_variable.rb +57 -0
  57. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/event.rb +101 -0
  58. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/git_repo_volume.rb +72 -0
  59. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/image_registry_credential.rb +69 -0
  60. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/ip_address.rb +80 -0
  61. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/logs.rb +46 -0
  62. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/operating_system_types.rb +16 -0
  63. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/operation.rb +70 -0
  64. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/operation_display.rb +79 -0
  65. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/operation_list_result.rb +67 -0
  66. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/port.rb +58 -0
  67. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/resource.rb +101 -0
  68. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/resource_limits.rb +57 -0
  69. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/resource_requests.rb +57 -0
  70. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/resource_requirements.rb +61 -0
  71. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/usage.rb +84 -0
  72. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/usage_list_result.rb +56 -0
  73. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/usage_name.rb +59 -0
  74. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/volume.rb +100 -0
  75. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/models/volume_mount.rb +70 -0
  76. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/module_definition.rb +9 -0
  77. data/lib/2017-12-01-preview/generated/azure_mgmt_container_instance/operations.rb +107 -0
  78. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance.rb +63 -0
  79. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_group_usage.rb +113 -0
  80. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_groups.rb +935 -0
  81. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_instance_management_client.rb +144 -0
  82. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/container_logs.rb +139 -0
  83. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/azure_file_volume.rb +84 -0
  84. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container.rb +168 -0
  85. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_group.rb +216 -0
  86. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_group_list_result.rb +99 -0
  87. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_group_network_protocol.rb +16 -0
  88. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_group_properties_instance_view.rb +69 -0
  89. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_group_restart_policy.rb +17 -0
  90. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_instance_operations_origin.rb +16 -0
  91. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_network_protocol.rb +16 -0
  92. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_port.rb +58 -0
  93. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_properties_instance_view.rb +95 -0
  94. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/container_state.rb +94 -0
  95. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/environment_variable.rb +57 -0
  96. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/event.rb +101 -0
  97. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/git_repo_volume.rb +72 -0
  98. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/image_registry_credential.rb +69 -0
  99. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/ip_address.rb +103 -0
  100. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/logs.rb +46 -0
  101. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/operating_system_types.rb +16 -0
  102. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/operation.rb +70 -0
  103. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/operation_display.rb +79 -0
  104. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/operation_list_result.rb +67 -0
  105. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/port.rb +58 -0
  106. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/resource.rb +101 -0
  107. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/resource_limits.rb +57 -0
  108. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/resource_requests.rb +57 -0
  109. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/resource_requirements.rb +61 -0
  110. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/usage.rb +84 -0
  111. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/usage_list_result.rb +56 -0
  112. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/usage_name.rb +59 -0
  113. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/volume.rb +100 -0
  114. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/models/volume_mount.rb +70 -0
  115. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/module_definition.rb +9 -0
  116. data/lib/2018-02-01-preview/generated/azure_mgmt_container_instance/operations.rb +107 -0
  117. data/lib/azure_mgmt_container_instance.rb +3 -0
  118. data/lib/profiles/latest/containerinstance_latest_profile_client.rb +28 -9
  119. data/lib/profiles/latest/containerinstance_module_definition.rb +0 -1
  120. data/lib/profiles/latest/modules/containerinstance_profile_module.rb +164 -101
  121. data/lib/version.rb +1 -1
  122. metadata +114 -2
@@ -0,0 +1,935 @@
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::V2018_02_01_preview
7
+ #
8
+ # ContainerGroups
9
+ #
10
+ class ContainerGroups
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ContainerGroups 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 a list of container groups in the specified subscription.
26
+ #
27
+ # Get a list of container groups in the specified subscription. This operation
28
+ # returns properties of each container group including containers, image
29
+ # registry credentials, restart policy, IP address type, OS type, state, and
30
+ # volumes.
31
+ #
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Array<ContainerGroup>] operation results.
36
+ #
37
+ def list(custom_headers:nil)
38
+ first_page = list_as_lazy(custom_headers:custom_headers)
39
+ first_page.get_all_items
40
+ end
41
+
42
+ #
43
+ # Get a list of container groups in the specified subscription.
44
+ #
45
+ # Get a list of container groups in the specified subscription. This operation
46
+ # returns properties of each container group including containers, image
47
+ # registry credentials, restart policy, IP address type, OS type, state, and
48
+ # volumes.
49
+ #
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def list_with_http_info(custom_headers:nil)
56
+ list_async(custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Get a list of container groups in the specified subscription.
61
+ #
62
+ # Get a list of container groups in the specified subscription. This operation
63
+ # returns properties of each container group including containers, image
64
+ # registry credentials, restart policy, IP address type, OS type, state, and
65
+ # volumes.
66
+ #
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def list_async(custom_headers:nil)
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
75
+
76
+
77
+ request_headers = {}
78
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
79
+
80
+ # Set Headers
81
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups'
84
+
85
+ request_url = @base_url || @client.base_url
86
+
87
+ options = {
88
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
89
+ path_params: {'subscriptionId' => @client.subscription_id},
90
+ query_params: {'api-version' => @client.api_version},
91
+ headers: request_headers.merge(custom_headers || {}),
92
+ base_url: request_url
93
+ }
94
+ promise = @client.make_request_async(:get, path_template, options)
95
+
96
+ promise = promise.then do |result|
97
+ http_response = result.response
98
+ status_code = http_response.status
99
+ response_content = http_response.body
100
+ unless status_code == 200
101
+ error_model = JSON.load(response_content)
102
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
103
+ end
104
+
105
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
106
+ # Deserialize Response
107
+ if status_code == 200
108
+ begin
109
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
110
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper()
111
+ result.body = @client.deserialize(result_mapper, parsed_response)
112
+ rescue Exception => e
113
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
114
+ end
115
+ end
116
+
117
+ result
118
+ end
119
+
120
+ promise.execute
121
+ end
122
+
123
+ #
124
+ # Get a list of container groups in the specified subscription and resource
125
+ # group.
126
+ #
127
+ # Get a list of container groups in a specified subscription and resource
128
+ # group. This operation returns properties of each container group including
129
+ # containers, image registry credentials, restart policy, IP address type, OS
130
+ # type, state, and volumes.
131
+ #
132
+ # @param resource_group_name [String] The name of the resource group.
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [Array<ContainerGroup>] operation results.
137
+ #
138
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
139
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
140
+ first_page.get_all_items
141
+ end
142
+
143
+ #
144
+ # Get a list of container groups in the specified subscription and resource
145
+ # group.
146
+ #
147
+ # Get a list of container groups in a specified subscription and resource
148
+ # group. This operation returns properties of each container group including
149
+ # containers, image registry credentials, restart policy, IP address type, OS
150
+ # type, state, and volumes.
151
+ #
152
+ # @param resource_group_name [String] The name of the resource group.
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
157
+ #
158
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
159
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
160
+ end
161
+
162
+ #
163
+ # Get a list of container groups in the specified subscription and resource
164
+ # group.
165
+ #
166
+ # Get a list of container groups in a specified subscription and resource
167
+ # group. This operation returns properties of each container group including
168
+ # containers, image registry credentials, restart policy, IP address type, OS
169
+ # type, state, and volumes.
170
+ #
171
+ # @param resource_group_name [String] The name of the resource group.
172
+ # @param [Hash{String => String}] A hash of custom headers that will be added
173
+ # to the HTTP request.
174
+ #
175
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
176
+ #
177
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
178
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
179
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
180
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
181
+
182
+
183
+ request_headers = {}
184
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
185
+
186
+ # Set Headers
187
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
188
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
189
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups'
190
+
191
+ request_url = @base_url || @client.base_url
192
+
193
+ options = {
194
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
195
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
196
+ query_params: {'api-version' => @client.api_version},
197
+ headers: request_headers.merge(custom_headers || {}),
198
+ base_url: request_url
199
+ }
200
+ promise = @client.make_request_async(:get, path_template, options)
201
+
202
+ promise = promise.then do |result|
203
+ http_response = result.response
204
+ status_code = http_response.status
205
+ response_content = http_response.body
206
+ unless status_code == 200
207
+ error_model = JSON.load(response_content)
208
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
209
+ end
210
+
211
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
212
+ # Deserialize Response
213
+ if status_code == 200
214
+ begin
215
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
216
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper()
217
+ result.body = @client.deserialize(result_mapper, parsed_response)
218
+ rescue Exception => e
219
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
220
+ end
221
+ end
222
+
223
+ result
224
+ end
225
+
226
+ promise.execute
227
+ end
228
+
229
+ #
230
+ # Get the properties of the specified container group.
231
+ #
232
+ # Gets the properties of the specified container group in the specified
233
+ # subscription and resource group. The operation returns the properties of each
234
+ # container group including containers, image registry credentials, restart
235
+ # policy, IP address type, OS type, state, and volumes.
236
+ #
237
+ # @param resource_group_name [String] The name of the resource group.
238
+ # @param container_group_name [String] The name of the container group.
239
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
240
+ # will be added to the HTTP request.
241
+ #
242
+ # @return [ContainerGroup] operation results.
243
+ #
244
+ def get(resource_group_name, container_group_name, custom_headers:nil)
245
+ response = get_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
246
+ response.body unless response.nil?
247
+ end
248
+
249
+ #
250
+ # Get the properties of the specified container group.
251
+ #
252
+ # Gets the properties of the specified container group in the specified
253
+ # subscription and resource group. The operation returns the properties of each
254
+ # container group including containers, image registry credentials, restart
255
+ # policy, IP address type, OS type, state, and volumes.
256
+ #
257
+ # @param resource_group_name [String] The name of the resource group.
258
+ # @param container_group_name [String] The name of the container group.
259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
+ # will be added to the HTTP request.
261
+ #
262
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
263
+ #
264
+ def get_with_http_info(resource_group_name, container_group_name, custom_headers:nil)
265
+ get_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
266
+ end
267
+
268
+ #
269
+ # Get the properties of the specified container group.
270
+ #
271
+ # Gets the properties of the specified container group in the specified
272
+ # subscription and resource group. The operation returns the properties of each
273
+ # container group including containers, image registry credentials, restart
274
+ # policy, IP address type, OS type, state, and volumes.
275
+ #
276
+ # @param resource_group_name [String] The name of the resource group.
277
+ # @param container_group_name [String] The name of the container group.
278
+ # @param [Hash{String => String}] A hash of custom headers that will be added
279
+ # to the HTTP request.
280
+ #
281
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
282
+ #
283
+ def get_async(resource_group_name, container_group_name, custom_headers:nil)
284
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
285
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
286
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
287
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
288
+
289
+
290
+ request_headers = {}
291
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
292
+
293
+ # Set Headers
294
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
295
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
296
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'
297
+
298
+ request_url = @base_url || @client.base_url
299
+
300
+ options = {
301
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
302
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
303
+ query_params: {'api-version' => @client.api_version},
304
+ headers: request_headers.merge(custom_headers || {}),
305
+ base_url: request_url
306
+ }
307
+ promise = @client.make_request_async(:get, path_template, options)
308
+
309
+ promise = promise.then do |result|
310
+ http_response = result.response
311
+ status_code = http_response.status
312
+ response_content = http_response.body
313
+ unless status_code == 200
314
+ error_model = JSON.load(response_content)
315
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
316
+ end
317
+
318
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
319
+ # Deserialize Response
320
+ if status_code == 200
321
+ begin
322
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
323
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper()
324
+ result.body = @client.deserialize(result_mapper, parsed_response)
325
+ rescue Exception => e
326
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
327
+ end
328
+ end
329
+
330
+ result
331
+ end
332
+
333
+ promise.execute
334
+ end
335
+
336
+ #
337
+ # Create or update container groups.
338
+ #
339
+ # Create or update container groups with specified configurations.
340
+ #
341
+ # @param resource_group_name [String] The name of the resource group.
342
+ # @param container_group_name [String] The name of the container group.
343
+ # @param container_group [ContainerGroup] The properties of the container group
344
+ # to be created or updated.
345
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
346
+ # will be added to the HTTP request.
347
+ #
348
+ # @return [ContainerGroup] operation results.
349
+ #
350
+ def create_or_update(resource_group_name, container_group_name, container_group, custom_headers:nil)
351
+ response = create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:custom_headers).value!
352
+ response.body unless response.nil?
353
+ end
354
+
355
+ #
356
+ # Create or update container groups.
357
+ #
358
+ # Create or update container groups with specified configurations.
359
+ #
360
+ # @param resource_group_name [String] The name of the resource group.
361
+ # @param container_group_name [String] The name of the container group.
362
+ # @param container_group [ContainerGroup] The properties of the container group
363
+ # to be created or updated.
364
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
365
+ # will be added to the HTTP request.
366
+ #
367
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
368
+ #
369
+ def create_or_update_with_http_info(resource_group_name, container_group_name, container_group, custom_headers:nil)
370
+ create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:custom_headers).value!
371
+ end
372
+
373
+ #
374
+ # Create or update container groups.
375
+ #
376
+ # Create or update container groups with specified configurations.
377
+ #
378
+ # @param resource_group_name [String] The name of the resource group.
379
+ # @param container_group_name [String] The name of the container group.
380
+ # @param container_group [ContainerGroup] The properties of the container group
381
+ # to be created or updated.
382
+ # @param [Hash{String => String}] A hash of custom headers that will be added
383
+ # to the HTTP request.
384
+ #
385
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
386
+ #
387
+ def create_or_update_async(resource_group_name, container_group_name, container_group, custom_headers:nil)
388
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
389
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
390
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
391
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
392
+ fail ArgumentError, 'container_group is nil' if container_group.nil?
393
+
394
+
395
+ request_headers = {}
396
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
397
+
398
+ # Set Headers
399
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
400
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
401
+
402
+ # Serialize Request
403
+ request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper()
404
+ request_content = @client.serialize(request_mapper, container_group)
405
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
406
+
407
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'
408
+
409
+ request_url = @base_url || @client.base_url
410
+
411
+ options = {
412
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
413
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
414
+ query_params: {'api-version' => @client.api_version},
415
+ body: request_content,
416
+ headers: request_headers.merge(custom_headers || {}),
417
+ base_url: request_url
418
+ }
419
+ promise = @client.make_request_async(:put, path_template, options)
420
+
421
+ promise = promise.then do |result|
422
+ http_response = result.response
423
+ status_code = http_response.status
424
+ response_content = http_response.body
425
+ unless status_code == 200 || status_code == 201
426
+ error_model = JSON.load(response_content)
427
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
428
+ end
429
+
430
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
431
+ # Deserialize Response
432
+ if status_code == 200
433
+ begin
434
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
435
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper()
436
+ result.body = @client.deserialize(result_mapper, parsed_response)
437
+ rescue Exception => e
438
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
439
+ end
440
+ end
441
+ # Deserialize Response
442
+ if status_code == 201
443
+ begin
444
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
445
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper()
446
+ result.body = @client.deserialize(result_mapper, parsed_response)
447
+ rescue Exception => e
448
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
449
+ end
450
+ end
451
+
452
+ result
453
+ end
454
+
455
+ promise.execute
456
+ end
457
+
458
+ #
459
+ # Update container groups.
460
+ #
461
+ # Updates container group tags with specified values.
462
+ #
463
+ # @param resource_group_name [String] The name of the resource group.
464
+ # @param container_group_name [String] The name of the container group.
465
+ # @param resource [Resource] The container group resource with just the tags to
466
+ # be updated.
467
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
468
+ # will be added to the HTTP request.
469
+ #
470
+ # @return [ContainerGroup] operation results.
471
+ #
472
+ def update(resource_group_name, container_group_name, resource:nil, custom_headers:nil)
473
+ response = update_async(resource_group_name, container_group_name, resource:resource, custom_headers:custom_headers).value!
474
+ response.body unless response.nil?
475
+ end
476
+
477
+ #
478
+ # Update container groups.
479
+ #
480
+ # Updates container group tags with specified values.
481
+ #
482
+ # @param resource_group_name [String] The name of the resource group.
483
+ # @param container_group_name [String] The name of the container group.
484
+ # @param resource [Resource] The container group resource with just the tags to
485
+ # be updated.
486
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
487
+ # will be added to the HTTP request.
488
+ #
489
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
490
+ #
491
+ def update_with_http_info(resource_group_name, container_group_name, resource:nil, custom_headers:nil)
492
+ update_async(resource_group_name, container_group_name, resource:resource, custom_headers:custom_headers).value!
493
+ end
494
+
495
+ #
496
+ # Update container groups.
497
+ #
498
+ # Updates container group tags with specified values.
499
+ #
500
+ # @param resource_group_name [String] The name of the resource group.
501
+ # @param container_group_name [String] The name of the container group.
502
+ # @param resource [Resource] The container group resource with just the tags to
503
+ # be updated.
504
+ # @param [Hash{String => String}] A hash of custom headers that will be added
505
+ # to the HTTP request.
506
+ #
507
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
508
+ #
509
+ def update_async(resource_group_name, container_group_name, resource:nil, custom_headers:nil)
510
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
511
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
512
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
513
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
514
+
515
+
516
+ request_headers = {}
517
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
518
+
519
+ # Set Headers
520
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
521
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
522
+
523
+ # Serialize Request
524
+ request_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::Resource.mapper()
525
+ request_content = @client.serialize(request_mapper, resource)
526
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
527
+
528
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'
529
+
530
+ request_url = @base_url || @client.base_url
531
+
532
+ options = {
533
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
534
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
535
+ query_params: {'api-version' => @client.api_version},
536
+ body: request_content,
537
+ headers: request_headers.merge(custom_headers || {}),
538
+ base_url: request_url
539
+ }
540
+ promise = @client.make_request_async(:patch, path_template, options)
541
+
542
+ promise = promise.then do |result|
543
+ http_response = result.response
544
+ status_code = http_response.status
545
+ response_content = http_response.body
546
+ unless status_code == 200
547
+ error_model = JSON.load(response_content)
548
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
549
+ end
550
+
551
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
552
+ # Deserialize Response
553
+ if status_code == 200
554
+ begin
555
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
556
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper()
557
+ result.body = @client.deserialize(result_mapper, parsed_response)
558
+ rescue Exception => e
559
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
560
+ end
561
+ end
562
+
563
+ result
564
+ end
565
+
566
+ promise.execute
567
+ end
568
+
569
+ #
570
+ # Delete the specified container group.
571
+ #
572
+ # Delete the specified container group in the specified subscription and
573
+ # resource group. The operation does not delete other resources provided by the
574
+ # user, such as volumes.
575
+ #
576
+ # @param resource_group_name [String] The name of the resource group.
577
+ # @param container_group_name [String] The name of the container group.
578
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
579
+ # will be added to the HTTP request.
580
+ #
581
+ # @return [ContainerGroup] operation results.
582
+ #
583
+ def delete(resource_group_name, container_group_name, custom_headers:nil)
584
+ response = delete_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
585
+ response.body unless response.nil?
586
+ end
587
+
588
+ #
589
+ # Delete the specified container group.
590
+ #
591
+ # Delete the specified container group in the specified subscription and
592
+ # resource group. The operation does not delete other resources provided by the
593
+ # user, such as volumes.
594
+ #
595
+ # @param resource_group_name [String] The name of the resource group.
596
+ # @param container_group_name [String] The name of the container group.
597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
598
+ # will be added to the HTTP request.
599
+ #
600
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
601
+ #
602
+ def delete_with_http_info(resource_group_name, container_group_name, custom_headers:nil)
603
+ delete_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
604
+ end
605
+
606
+ #
607
+ # Delete the specified container group.
608
+ #
609
+ # Delete the specified container group in the specified subscription and
610
+ # resource group. The operation does not delete other resources provided by the
611
+ # user, such as volumes.
612
+ #
613
+ # @param resource_group_name [String] The name of the resource group.
614
+ # @param container_group_name [String] The name of the container group.
615
+ # @param [Hash{String => String}] A hash of custom headers that will be added
616
+ # to the HTTP request.
617
+ #
618
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
619
+ #
620
+ def delete_async(resource_group_name, container_group_name, custom_headers:nil)
621
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
622
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
623
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
624
+ fail ArgumentError, 'container_group_name is nil' if container_group_name.nil?
625
+
626
+
627
+ request_headers = {}
628
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
629
+
630
+ # Set Headers
631
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
632
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
633
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}'
634
+
635
+ request_url = @base_url || @client.base_url
636
+
637
+ options = {
638
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
639
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'containerGroupName' => container_group_name},
640
+ query_params: {'api-version' => @client.api_version},
641
+ headers: request_headers.merge(custom_headers || {}),
642
+ base_url: request_url
643
+ }
644
+ promise = @client.make_request_async(:delete, path_template, options)
645
+
646
+ promise = promise.then do |result|
647
+ http_response = result.response
648
+ status_code = http_response.status
649
+ response_content = http_response.body
650
+ unless status_code == 200 || status_code == 204
651
+ error_model = JSON.load(response_content)
652
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
653
+ end
654
+
655
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
656
+ # Deserialize Response
657
+ if status_code == 200
658
+ begin
659
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
660
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroup.mapper()
661
+ result.body = @client.deserialize(result_mapper, parsed_response)
662
+ rescue Exception => e
663
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
664
+ end
665
+ end
666
+
667
+ result
668
+ end
669
+
670
+ promise.execute
671
+ end
672
+
673
+ #
674
+ # Get a list of container groups in the specified subscription.
675
+ #
676
+ # Get a list of container groups in the specified subscription. This operation
677
+ # returns properties of each container group including containers, image
678
+ # registry credentials, restart policy, IP address type, OS type, state, and
679
+ # volumes.
680
+ #
681
+ # @param next_page_link [String] The NextLink from the previous successful call
682
+ # to List operation.
683
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
684
+ # will be added to the HTTP request.
685
+ #
686
+ # @return [ContainerGroupListResult] operation results.
687
+ #
688
+ def list_next(next_page_link, custom_headers:nil)
689
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
690
+ response.body unless response.nil?
691
+ end
692
+
693
+ #
694
+ # Get a list of container groups in the specified subscription.
695
+ #
696
+ # Get a list of container groups in the specified subscription. This operation
697
+ # returns properties of each container group including containers, image
698
+ # registry credentials, restart policy, IP address type, OS type, state, and
699
+ # volumes.
700
+ #
701
+ # @param next_page_link [String] The NextLink from the previous successful call
702
+ # to List operation.
703
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
704
+ # will be added to the HTTP request.
705
+ #
706
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
707
+ #
708
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
709
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
710
+ end
711
+
712
+ #
713
+ # Get a list of container groups in the specified subscription.
714
+ #
715
+ # Get a list of container groups in the specified subscription. This operation
716
+ # returns properties of each container group including containers, image
717
+ # registry credentials, restart policy, IP address type, OS type, state, and
718
+ # volumes.
719
+ #
720
+ # @param next_page_link [String] The NextLink from the previous successful call
721
+ # to List operation.
722
+ # @param [Hash{String => String}] A hash of custom headers that will be added
723
+ # to the HTTP request.
724
+ #
725
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
726
+ #
727
+ def list_next_async(next_page_link, custom_headers:nil)
728
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
729
+
730
+
731
+ request_headers = {}
732
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
733
+
734
+ # Set Headers
735
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
736
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
737
+ path_template = '{nextLink}'
738
+
739
+ request_url = @base_url || @client.base_url
740
+
741
+ options = {
742
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
743
+ skip_encoding_path_params: {'nextLink' => next_page_link},
744
+ headers: request_headers.merge(custom_headers || {}),
745
+ base_url: request_url
746
+ }
747
+ promise = @client.make_request_async(:get, path_template, options)
748
+
749
+ promise = promise.then do |result|
750
+ http_response = result.response
751
+ status_code = http_response.status
752
+ response_content = http_response.body
753
+ unless status_code == 200
754
+ error_model = JSON.load(response_content)
755
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
756
+ end
757
+
758
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
759
+ # Deserialize Response
760
+ if status_code == 200
761
+ begin
762
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
763
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper()
764
+ result.body = @client.deserialize(result_mapper, parsed_response)
765
+ rescue Exception => e
766
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
767
+ end
768
+ end
769
+
770
+ result
771
+ end
772
+
773
+ promise.execute
774
+ end
775
+
776
+ #
777
+ # Get a list of container groups in the specified subscription and resource
778
+ # group.
779
+ #
780
+ # Get a list of container groups in a specified subscription and resource
781
+ # group. This operation returns properties of each container group including
782
+ # containers, image registry credentials, restart policy, IP address type, OS
783
+ # type, state, and volumes.
784
+ #
785
+ # @param next_page_link [String] The NextLink from the previous successful call
786
+ # to List operation.
787
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
788
+ # will be added to the HTTP request.
789
+ #
790
+ # @return [ContainerGroupListResult] operation results.
791
+ #
792
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
793
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
794
+ response.body unless response.nil?
795
+ end
796
+
797
+ #
798
+ # Get a list of container groups in the specified subscription and resource
799
+ # group.
800
+ #
801
+ # Get a list of container groups in a specified subscription and resource
802
+ # group. This operation returns properties of each container group including
803
+ # containers, image registry credentials, restart policy, IP address type, OS
804
+ # type, state, and volumes.
805
+ #
806
+ # @param next_page_link [String] The NextLink from the previous successful call
807
+ # to List operation.
808
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
809
+ # will be added to the HTTP request.
810
+ #
811
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
812
+ #
813
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
814
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
815
+ end
816
+
817
+ #
818
+ # Get a list of container groups in the specified subscription and resource
819
+ # group.
820
+ #
821
+ # Get a list of container groups in a specified subscription and resource
822
+ # group. This operation returns properties of each container group including
823
+ # containers, image registry credentials, restart policy, IP address type, OS
824
+ # type, state, and volumes.
825
+ #
826
+ # @param next_page_link [String] The NextLink from the previous successful call
827
+ # to List operation.
828
+ # @param [Hash{String => String}] A hash of custom headers that will be added
829
+ # to the HTTP request.
830
+ #
831
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
832
+ #
833
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
834
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
835
+
836
+
837
+ request_headers = {}
838
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
839
+
840
+ # Set Headers
841
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
842
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
843
+ path_template = '{nextLink}'
844
+
845
+ request_url = @base_url || @client.base_url
846
+
847
+ options = {
848
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
849
+ skip_encoding_path_params: {'nextLink' => next_page_link},
850
+ headers: request_headers.merge(custom_headers || {}),
851
+ base_url: request_url
852
+ }
853
+ promise = @client.make_request_async(:get, path_template, options)
854
+
855
+ promise = promise.then do |result|
856
+ http_response = result.response
857
+ status_code = http_response.status
858
+ response_content = http_response.body
859
+ unless status_code == 200
860
+ error_model = JSON.load(response_content)
861
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
862
+ end
863
+
864
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
865
+ # Deserialize Response
866
+ if status_code == 200
867
+ begin
868
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
869
+ result_mapper = Azure::ContainerInstance::Mgmt::V2018_02_01_preview::Models::ContainerGroupListResult.mapper()
870
+ result.body = @client.deserialize(result_mapper, parsed_response)
871
+ rescue Exception => e
872
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
873
+ end
874
+ end
875
+
876
+ result
877
+ end
878
+
879
+ promise.execute
880
+ end
881
+
882
+ #
883
+ # Get a list of container groups in the specified subscription.
884
+ #
885
+ # Get a list of container groups in the specified subscription. This operation
886
+ # returns properties of each container group including containers, image
887
+ # registry credentials, restart policy, IP address type, OS type, state, and
888
+ # volumes.
889
+ #
890
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
891
+ # will be added to the HTTP request.
892
+ #
893
+ # @return [ContainerGroupListResult] which provide lazy access to pages of the
894
+ # response.
895
+ #
896
+ def list_as_lazy(custom_headers:nil)
897
+ response = list_async(custom_headers:custom_headers).value!
898
+ unless response.nil?
899
+ page = response.body
900
+ page.next_method = Proc.new do |next_page_link|
901
+ list_next_async(next_page_link, custom_headers:custom_headers)
902
+ end
903
+ page
904
+ end
905
+ end
906
+
907
+ #
908
+ # Get a list of container groups in the specified subscription and resource
909
+ # group.
910
+ #
911
+ # Get a list of container groups in a specified subscription and resource
912
+ # group. This operation returns properties of each container group including
913
+ # containers, image registry credentials, restart policy, IP address type, OS
914
+ # type, state, and volumes.
915
+ #
916
+ # @param resource_group_name [String] The name of the resource group.
917
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
918
+ # will be added to the HTTP request.
919
+ #
920
+ # @return [ContainerGroupListResult] which provide lazy access to pages of the
921
+ # response.
922
+ #
923
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
924
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
925
+ unless response.nil?
926
+ page = response.body
927
+ page.next_method = Proc.new do |next_page_link|
928
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
929
+ end
930
+ page
931
+ end
932
+ end
933
+
934
+ end
935
+ end