azure_mgmt_hybrid_compute 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute.rb +72 -0
  4. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/hybrid_compute_management_client.rb +139 -0
  5. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/machine_extensions.rb +805 -0
  6. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/machines.rb +630 -0
  7. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/azure_entity_resource.rb +75 -0
  8. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/error_additional_info.rb +59 -0
  9. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/error_detail.rb +90 -0
  10. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/error_response.rb +113 -0
  11. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/identity.rb +72 -0
  12. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/instance_view_types.rb +15 -0
  13. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/location_data.rb +84 -0
  14. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine.rb +287 -0
  15. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_extension.rb +195 -0
  16. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_extension_instance_view.rb +81 -0
  17. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_extension_instance_view_status.rb +92 -0
  18. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_extension_properties_instance_view.rb +68 -0
  19. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_extension_properties_model.rb +144 -0
  20. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_extension_update.rb +134 -0
  21. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_extension_update_properties_model.rb +118 -0
  22. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_extensions_list_result.rb +99 -0
  23. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_identity.rb +63 -0
  24. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_list_result.rb +99 -0
  25. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_properties.rb +224 -0
  26. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_properties_os_profile.rb +44 -0
  27. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_reconnect.rb +58 -0
  28. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_reconnect_properties.rb +58 -0
  29. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_update.rb +100 -0
  30. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/machine_update_properties.rb +47 -0
  31. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/operation_list_result.rb +56 -0
  32. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/operation_value.rb +108 -0
  33. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/operation_value_display_model.rb +84 -0
  34. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/osprofile.rb +47 -0
  35. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/plan.rb +95 -0
  36. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/proxy_resource.rb +63 -0
  37. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/resource.rb +83 -0
  38. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/resource_identity_type.rb +15 -0
  39. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/resource_model_with_allowed_property_set.rb +191 -0
  40. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/resource_model_with_allowed_property_set_identity.rb +64 -0
  41. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/resource_model_with_allowed_property_set_plan.rb +76 -0
  42. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/resource_model_with_allowed_property_set_sku.rb +77 -0
  43. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/sku.rb +99 -0
  44. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/sku_tier.rb +18 -0
  45. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/status_level_types.rb +17 -0
  46. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/status_types.rb +17 -0
  47. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/tracked_resource.rb +92 -0
  48. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/models/update_resource.rb +54 -0
  49. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/module_definition.rb +9 -0
  50. data/lib/2019-12-12/generated/azure_mgmt_hybrid_compute/operations.rb +110 -0
  51. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute.rb +61 -0
  52. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/hybrid_compute_management_client.rb +141 -0
  53. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/machine_extensions.rb +795 -0
  54. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/machines.rb +622 -0
  55. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/azure_entity_resource.rb +75 -0
  56. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/error_detail.rb +90 -0
  57. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/error_response.rb +49 -0
  58. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/identity.rb +71 -0
  59. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/instance_view_types.rb +15 -0
  60. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/location_data.rb +84 -0
  61. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine.rb +348 -0
  62. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_extension.rb +195 -0
  63. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_extension_instance_view.rb +84 -0
  64. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_extension_instance_view_status.rb +97 -0
  65. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_extension_properties_instance_view.rb +71 -0
  66. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_extension_properties_model.rb +144 -0
  67. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_extension_update.rb +134 -0
  68. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_extension_update_properties_model.rb +118 -0
  69. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_extensions_list_result.rb +99 -0
  70. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_identity.rb +62 -0
  71. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_list_result.rb +99 -0
  72. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_properties.rb +285 -0
  73. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_properties_os_profile.rb +44 -0
  74. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_update.rb +98 -0
  75. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/machine_update_properties.rb +47 -0
  76. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/operation_list_result.rb +56 -0
  77. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/operation_value.rb +108 -0
  78. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/operation_value_display_model.rb +84 -0
  79. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/osprofile.rb +47 -0
  80. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/proxy_resource.rb +63 -0
  81. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/resource.rb +83 -0
  82. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/status_level_types.rb +17 -0
  83. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/status_types.rb +17 -0
  84. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/tracked_resource.rb +92 -0
  85. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/models/update_resource.rb +54 -0
  86. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/module_definition.rb +9 -0
  87. data/lib/2020-08-02/generated/azure_mgmt_hybrid_compute/operations.rb +109 -0
  88. data/lib/azure_mgmt_hybrid_compute.rb +7 -0
  89. data/lib/module_definition.rb +7 -0
  90. data/lib/profiles/latest/hybridcompute_latest_profile_client.rb +40 -0
  91. data/lib/profiles/latest/hybridcompute_module_definition.rb +8 -0
  92. data/lib/profiles/latest/modules/hybridcompute_profile_module.rb +189 -0
  93. data/lib/version.rb +7 -0
  94. metadata +209 -0
@@ -0,0 +1,622 @@
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::HybridCompute::Mgmt::V2020_08_02
7
+ #
8
+ # The Hybrid Compute Management Client.
9
+ #
10
+ class Machines
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Machines class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [HybridComputeManagementClient] reference to the HybridComputeManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # The operation to remove a hybrid machine identity in Azure.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param name [String] The name of the hybrid machine.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ #
33
+ def delete(resource_group_name, name, custom_headers:nil)
34
+ response = delete_async(resource_group_name, name, custom_headers:custom_headers).value!
35
+ nil
36
+ end
37
+
38
+ #
39
+ # The operation to remove a hybrid machine identity in Azure.
40
+ #
41
+ # @param resource_group_name [String] The name of the resource group.
42
+ # @param name [String] The name of the hybrid machine.
43
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
44
+ # will be added to the HTTP request.
45
+ #
46
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
47
+ #
48
+ def delete_with_http_info(resource_group_name, name, custom_headers:nil)
49
+ delete_async(resource_group_name, name, custom_headers:custom_headers).value!
50
+ end
51
+
52
+ #
53
+ # The operation to remove a hybrid machine identity in Azure.
54
+ #
55
+ # @param resource_group_name [String] The name of the resource group.
56
+ # @param name [String] The name of the hybrid machine.
57
+ # @param [Hash{String => String}] A hash of custom headers that will be added
58
+ # to the HTTP request.
59
+ #
60
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
61
+ #
62
+ def delete_async(resource_group_name, name, custom_headers:nil)
63
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
64
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
65
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
66
+ fail ArgumentError, 'name is nil' if name.nil?
67
+
68
+
69
+ request_headers = {}
70
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
71
+
72
+ # Set Headers
73
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
74
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
75
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'
76
+
77
+ request_url = @base_url || @client.base_url
78
+
79
+ options = {
80
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
81
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
82
+ query_params: {'api-version' => @client.api_version},
83
+ headers: request_headers.merge(custom_headers || {}),
84
+ base_url: request_url
85
+ }
86
+ promise = @client.make_request_async(:delete, path_template, options)
87
+
88
+ promise = promise.then do |result|
89
+ http_response = result.response
90
+ status_code = http_response.status
91
+ response_content = http_response.body
92
+ unless status_code == 200 || status_code == 204
93
+ error_model = JSON.load(response_content)
94
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
95
+ end
96
+
97
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
98
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
99
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
100
+
101
+ result
102
+ end
103
+
104
+ promise.execute
105
+ end
106
+
107
+ #
108
+ # Retrieves information about the model view or the instance view of a hybrid
109
+ # machine.
110
+ #
111
+ # @param resource_group_name [String] The name of the resource group.
112
+ # @param name [String] The name of the hybrid machine.
113
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
114
+ # operation. Possible values include: 'instanceView'
115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
116
+ # will be added to the HTTP request.
117
+ #
118
+ # @return [Machine] operation results.
119
+ #
120
+ def get(resource_group_name, name, expand:nil, custom_headers:nil)
121
+ response = get_async(resource_group_name, name, expand:expand, custom_headers:custom_headers).value!
122
+ response.body unless response.nil?
123
+ end
124
+
125
+ #
126
+ # Retrieves information about the model view or the instance view of a hybrid
127
+ # machine.
128
+ #
129
+ # @param resource_group_name [String] The name of the resource group.
130
+ # @param name [String] The name of the hybrid machine.
131
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
132
+ # operation. Possible values include: 'instanceView'
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
137
+ #
138
+ def get_with_http_info(resource_group_name, name, expand:nil, custom_headers:nil)
139
+ get_async(resource_group_name, name, expand:expand, custom_headers:custom_headers).value!
140
+ end
141
+
142
+ #
143
+ # Retrieves information about the model view or the instance view of a hybrid
144
+ # machine.
145
+ #
146
+ # @param resource_group_name [String] The name of the resource group.
147
+ # @param name [String] The name of the hybrid machine.
148
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
149
+ # operation. Possible values include: 'instanceView'
150
+ # @param [Hash{String => String}] A hash of custom headers that will be added
151
+ # to the HTTP request.
152
+ #
153
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
154
+ #
155
+ def get_async(resource_group_name, name, expand:nil, custom_headers:nil)
156
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
157
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
158
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
159
+ fail ArgumentError, 'name is nil' if name.nil?
160
+
161
+
162
+ request_headers = {}
163
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
164
+
165
+ # Set Headers
166
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
167
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
168
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'
169
+
170
+ request_url = @base_url || @client.base_url
171
+
172
+ options = {
173
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
174
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
175
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
176
+ headers: request_headers.merge(custom_headers || {}),
177
+ base_url: request_url
178
+ }
179
+ promise = @client.make_request_async(:get, path_template, options)
180
+
181
+ promise = promise.then do |result|
182
+ http_response = result.response
183
+ status_code = http_response.status
184
+ response_content = http_response.body
185
+ unless status_code == 200
186
+ error_model = JSON.load(response_content)
187
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
188
+ end
189
+
190
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
191
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
192
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
193
+ # Deserialize Response
194
+ if status_code == 200
195
+ begin
196
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
197
+ result_mapper = Azure::HybridCompute::Mgmt::V2020_08_02::Models::Machine.mapper()
198
+ result.body = @client.deserialize(result_mapper, parsed_response)
199
+ rescue Exception => e
200
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
201
+ end
202
+ end
203
+
204
+ result
205
+ end
206
+
207
+ promise.execute
208
+ end
209
+
210
+ #
211
+ # Lists all the hybrid machines in the specified resource group. Use the
212
+ # nextLink property in the response to get the next page of hybrid machines.
213
+ #
214
+ # @param resource_group_name [String] The name of the resource group.
215
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
216
+ # will be added to the HTTP request.
217
+ #
218
+ # @return [Array<Machine>] operation results.
219
+ #
220
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
221
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
222
+ first_page.get_all_items
223
+ end
224
+
225
+ #
226
+ # Lists all the hybrid machines in the specified resource group. Use the
227
+ # nextLink property in the response to get the next page of hybrid machines.
228
+ #
229
+ # @param resource_group_name [String] The name of the resource group.
230
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
231
+ # will be added to the HTTP request.
232
+ #
233
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
234
+ #
235
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
236
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
237
+ end
238
+
239
+ #
240
+ # Lists all the hybrid machines in the specified resource group. Use the
241
+ # nextLink property in the response to get the next page of hybrid machines.
242
+ #
243
+ # @param resource_group_name [String] The name of the resource group.
244
+ # @param [Hash{String => String}] A hash of custom headers that will be added
245
+ # to the HTTP request.
246
+ #
247
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
248
+ #
249
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
250
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
251
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
252
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
253
+
254
+
255
+ request_headers = {}
256
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
257
+
258
+ # Set Headers
259
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
260
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
261
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines'
262
+
263
+ request_url = @base_url || @client.base_url
264
+
265
+ options = {
266
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
267
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
268
+ query_params: {'api-version' => @client.api_version},
269
+ headers: request_headers.merge(custom_headers || {}),
270
+ base_url: request_url
271
+ }
272
+ promise = @client.make_request_async(:get, path_template, options)
273
+
274
+ promise = promise.then do |result|
275
+ http_response = result.response
276
+ status_code = http_response.status
277
+ response_content = http_response.body
278
+ unless status_code == 200
279
+ error_model = JSON.load(response_content)
280
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
281
+ end
282
+
283
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
284
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
285
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
286
+ # Deserialize Response
287
+ if status_code == 200
288
+ begin
289
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
290
+ result_mapper = Azure::HybridCompute::Mgmt::V2020_08_02::Models::MachineListResult.mapper()
291
+ result.body = @client.deserialize(result_mapper, parsed_response)
292
+ rescue Exception => e
293
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
294
+ end
295
+ end
296
+
297
+ result
298
+ end
299
+
300
+ promise.execute
301
+ end
302
+
303
+ #
304
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
305
+ # property in the response to get the next page of hybrid machines.
306
+ #
307
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
308
+ # will be added to the HTTP request.
309
+ #
310
+ # @return [Array<Machine>] operation results.
311
+ #
312
+ def list_by_subscription(custom_headers:nil)
313
+ first_page = list_by_subscription_as_lazy(custom_headers:custom_headers)
314
+ first_page.get_all_items
315
+ end
316
+
317
+ #
318
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
319
+ # property in the response to get the next page of hybrid machines.
320
+ #
321
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
322
+ # will be added to the HTTP request.
323
+ #
324
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
325
+ #
326
+ def list_by_subscription_with_http_info(custom_headers:nil)
327
+ list_by_subscription_async(custom_headers:custom_headers).value!
328
+ end
329
+
330
+ #
331
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
332
+ # property in the response to get the next page of hybrid machines.
333
+ #
334
+ # @param [Hash{String => String}] A hash of custom headers that will be added
335
+ # to the HTTP request.
336
+ #
337
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
338
+ #
339
+ def list_by_subscription_async(custom_headers:nil)
340
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
341
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
342
+
343
+
344
+ request_headers = {}
345
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
346
+
347
+ # Set Headers
348
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
349
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
350
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'
351
+
352
+ request_url = @base_url || @client.base_url
353
+
354
+ options = {
355
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
356
+ path_params: {'subscriptionId' => @client.subscription_id},
357
+ query_params: {'api-version' => @client.api_version},
358
+ headers: request_headers.merge(custom_headers || {}),
359
+ base_url: request_url
360
+ }
361
+ promise = @client.make_request_async(:get, path_template, options)
362
+
363
+ promise = promise.then do |result|
364
+ http_response = result.response
365
+ status_code = http_response.status
366
+ response_content = http_response.body
367
+ unless status_code == 200
368
+ error_model = JSON.load(response_content)
369
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
370
+ end
371
+
372
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
373
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
374
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
375
+ # Deserialize Response
376
+ if status_code == 200
377
+ begin
378
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
379
+ result_mapper = Azure::HybridCompute::Mgmt::V2020_08_02::Models::MachineListResult.mapper()
380
+ result.body = @client.deserialize(result_mapper, parsed_response)
381
+ rescue Exception => e
382
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
383
+ end
384
+ end
385
+
386
+ result
387
+ end
388
+
389
+ promise.execute
390
+ end
391
+
392
+ #
393
+ # Lists all the hybrid machines in the specified resource group. Use the
394
+ # nextLink property in the response to get the next page of hybrid machines.
395
+ #
396
+ # @param next_page_link [String] The NextLink from the previous successful call
397
+ # to List operation.
398
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
399
+ # will be added to the HTTP request.
400
+ #
401
+ # @return [MachineListResult] operation results.
402
+ #
403
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
404
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
405
+ response.body unless response.nil?
406
+ end
407
+
408
+ #
409
+ # Lists all the hybrid machines in the specified resource group. Use the
410
+ # nextLink property in the response to get the next page of hybrid machines.
411
+ #
412
+ # @param next_page_link [String] The NextLink from the previous successful call
413
+ # to List operation.
414
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
415
+ # will be added to the HTTP request.
416
+ #
417
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
418
+ #
419
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
420
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
421
+ end
422
+
423
+ #
424
+ # Lists all the hybrid machines in the specified resource group. Use the
425
+ # nextLink property in the response to get the next page of hybrid machines.
426
+ #
427
+ # @param next_page_link [String] The NextLink from the previous successful call
428
+ # to List operation.
429
+ # @param [Hash{String => String}] A hash of custom headers that will be added
430
+ # to the HTTP request.
431
+ #
432
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
433
+ #
434
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
435
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
436
+
437
+
438
+ request_headers = {}
439
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
440
+
441
+ # Set Headers
442
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
443
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
444
+ path_template = '{nextLink}'
445
+
446
+ request_url = @base_url || @client.base_url
447
+
448
+ options = {
449
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
450
+ skip_encoding_path_params: {'nextLink' => next_page_link},
451
+ headers: request_headers.merge(custom_headers || {}),
452
+ base_url: request_url
453
+ }
454
+ promise = @client.make_request_async(:get, path_template, options)
455
+
456
+ promise = promise.then do |result|
457
+ http_response = result.response
458
+ status_code = http_response.status
459
+ response_content = http_response.body
460
+ unless status_code == 200
461
+ error_model = JSON.load(response_content)
462
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
463
+ end
464
+
465
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
466
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
467
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
468
+ # Deserialize Response
469
+ if status_code == 200
470
+ begin
471
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
472
+ result_mapper = Azure::HybridCompute::Mgmt::V2020_08_02::Models::MachineListResult.mapper()
473
+ result.body = @client.deserialize(result_mapper, parsed_response)
474
+ rescue Exception => e
475
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
476
+ end
477
+ end
478
+
479
+ result
480
+ end
481
+
482
+ promise.execute
483
+ end
484
+
485
+ #
486
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
487
+ # property in the response to get the next page of hybrid machines.
488
+ #
489
+ # @param next_page_link [String] The NextLink from the previous successful call
490
+ # to List operation.
491
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
492
+ # will be added to the HTTP request.
493
+ #
494
+ # @return [MachineListResult] operation results.
495
+ #
496
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
497
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
498
+ response.body unless response.nil?
499
+ end
500
+
501
+ #
502
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
503
+ # property in the response to get the next page of hybrid machines.
504
+ #
505
+ # @param next_page_link [String] The NextLink from the previous successful call
506
+ # to List operation.
507
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
508
+ # will be added to the HTTP request.
509
+ #
510
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
511
+ #
512
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
513
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
514
+ end
515
+
516
+ #
517
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
518
+ # property in the response to get the next page of hybrid machines.
519
+ #
520
+ # @param next_page_link [String] The NextLink from the previous successful call
521
+ # to List operation.
522
+ # @param [Hash{String => String}] A hash of custom headers that will be added
523
+ # to the HTTP request.
524
+ #
525
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
526
+ #
527
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
528
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
529
+
530
+
531
+ request_headers = {}
532
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
533
+
534
+ # Set Headers
535
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
536
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
537
+ path_template = '{nextLink}'
538
+
539
+ request_url = @base_url || @client.base_url
540
+
541
+ options = {
542
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
543
+ skip_encoding_path_params: {'nextLink' => next_page_link},
544
+ headers: request_headers.merge(custom_headers || {}),
545
+ base_url: request_url
546
+ }
547
+ promise = @client.make_request_async(:get, path_template, options)
548
+
549
+ promise = promise.then do |result|
550
+ http_response = result.response
551
+ status_code = http_response.status
552
+ response_content = http_response.body
553
+ unless status_code == 200
554
+ error_model = JSON.load(response_content)
555
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
556
+ end
557
+
558
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
559
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
560
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
561
+ # Deserialize Response
562
+ if status_code == 200
563
+ begin
564
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
565
+ result_mapper = Azure::HybridCompute::Mgmt::V2020_08_02::Models::MachineListResult.mapper()
566
+ result.body = @client.deserialize(result_mapper, parsed_response)
567
+ rescue Exception => e
568
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
569
+ end
570
+ end
571
+
572
+ result
573
+ end
574
+
575
+ promise.execute
576
+ end
577
+
578
+ #
579
+ # Lists all the hybrid machines in the specified resource group. Use the
580
+ # nextLink property in the response to get the next page of hybrid machines.
581
+ #
582
+ # @param resource_group_name [String] The name of the resource group.
583
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
584
+ # will be added to the HTTP request.
585
+ #
586
+ # @return [MachineListResult] which provide lazy access to pages of the
587
+ # response.
588
+ #
589
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
590
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
591
+ unless response.nil?
592
+ page = response.body
593
+ page.next_method = Proc.new do |next_page_link|
594
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
595
+ end
596
+ page
597
+ end
598
+ end
599
+
600
+ #
601
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
602
+ # property in the response to get the next page of hybrid machines.
603
+ #
604
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
605
+ # will be added to the HTTP request.
606
+ #
607
+ # @return [MachineListResult] which provide lazy access to pages of the
608
+ # response.
609
+ #
610
+ def list_by_subscription_as_lazy(custom_headers:nil)
611
+ response = list_by_subscription_async(custom_headers:custom_headers).value!
612
+ unless response.nil?
613
+ page = response.body
614
+ page.next_method = Proc.new do |next_page_link|
615
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
616
+ end
617
+ page
618
+ end
619
+ end
620
+
621
+ end
622
+ end