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,630 @@
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::V2019_12_12
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.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
67
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
68
+ fail ArgumentError, 'name is nil' if name.nil?
69
+
70
+
71
+ request_headers = {}
72
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
73
+
74
+ # Set Headers
75
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
76
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
77
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'
78
+
79
+ request_url = @base_url || @client.base_url
80
+
81
+ options = {
82
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
83
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
84
+ query_params: {'api-version' => @client.api_version},
85
+ headers: request_headers.merge(custom_headers || {}),
86
+ base_url: request_url
87
+ }
88
+ promise = @client.make_request_async(:delete, path_template, options)
89
+
90
+ promise = promise.then do |result|
91
+ http_response = result.response
92
+ status_code = http_response.status
93
+ response_content = http_response.body
94
+ unless status_code == 200 || status_code == 204
95
+ error_model = JSON.load(response_content)
96
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
97
+ end
98
+
99
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
100
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
101
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
102
+
103
+ result
104
+ end
105
+
106
+ promise.execute
107
+ end
108
+
109
+ #
110
+ # Retrieves information about the model view or the instance view of a hybrid
111
+ # machine.
112
+ #
113
+ # @param resource_group_name [String] The name of the resource group.
114
+ # @param name [String] The name of the hybrid machine.
115
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
116
+ # operation. Possible values include: 'instanceView'
117
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
118
+ # will be added to the HTTP request.
119
+ #
120
+ # @return [Machine] operation results.
121
+ #
122
+ def get(resource_group_name, name, expand:nil, custom_headers:nil)
123
+ response = get_async(resource_group_name, name, expand:expand, custom_headers:custom_headers).value!
124
+ response.body unless response.nil?
125
+ end
126
+
127
+ #
128
+ # Retrieves information about the model view or the instance view of a hybrid
129
+ # machine.
130
+ #
131
+ # @param resource_group_name [String] The name of the resource group.
132
+ # @param name [String] The name of the hybrid machine.
133
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
134
+ # operation. Possible values include: 'instanceView'
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
139
+ #
140
+ def get_with_http_info(resource_group_name, name, expand:nil, custom_headers:nil)
141
+ get_async(resource_group_name, name, expand:expand, custom_headers:custom_headers).value!
142
+ end
143
+
144
+ #
145
+ # Retrieves information about the model view or the instance view of a hybrid
146
+ # machine.
147
+ #
148
+ # @param resource_group_name [String] The name of the resource group.
149
+ # @param name [String] The name of the hybrid machine.
150
+ # @param expand [InstanceViewTypes] The expand expression to apply on the
151
+ # operation. Possible values include: 'instanceView'
152
+ # @param [Hash{String => String}] A hash of custom headers that will be added
153
+ # to the HTTP request.
154
+ #
155
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
156
+ #
157
+ def get_async(resource_group_name, name, expand:nil, custom_headers:nil)
158
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
159
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
160
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
161
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
162
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
163
+ fail ArgumentError, 'name is nil' if name.nil?
164
+
165
+
166
+ request_headers = {}
167
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
168
+
169
+ # Set Headers
170
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
171
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
172
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}'
173
+
174
+ request_url = @base_url || @client.base_url
175
+
176
+ options = {
177
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
178
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
179
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
180
+ headers: request_headers.merge(custom_headers || {}),
181
+ base_url: request_url
182
+ }
183
+ promise = @client.make_request_async(:get, path_template, options)
184
+
185
+ promise = promise.then do |result|
186
+ http_response = result.response
187
+ status_code = http_response.status
188
+ response_content = http_response.body
189
+ unless status_code == 200
190
+ error_model = JSON.load(response_content)
191
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
192
+ end
193
+
194
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
195
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
196
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
197
+ # Deserialize Response
198
+ if status_code == 200
199
+ begin
200
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
201
+ result_mapper = Azure::HybridCompute::Mgmt::V2019_12_12::Models::Machine.mapper()
202
+ result.body = @client.deserialize(result_mapper, parsed_response)
203
+ rescue Exception => e
204
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
205
+ end
206
+ end
207
+
208
+ result
209
+ end
210
+
211
+ promise.execute
212
+ end
213
+
214
+ #
215
+ # Lists all the hybrid machines in the specified resource group. Use the
216
+ # nextLink property in the response to get the next page of hybrid machines.
217
+ #
218
+ # @param resource_group_name [String] The name of the resource group.
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<Machine>] operation results.
223
+ #
224
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
225
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
226
+ first_page.get_all_items
227
+ end
228
+
229
+ #
230
+ # Lists all the hybrid machines in the specified resource group. Use the
231
+ # nextLink property in the response to get the next page of hybrid machines.
232
+ #
233
+ # @param resource_group_name [String] The name of the resource group.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
238
+ #
239
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
240
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
241
+ end
242
+
243
+ #
244
+ # Lists all the hybrid machines in the specified resource group. Use the
245
+ # nextLink property in the response to get the next page of hybrid machines.
246
+ #
247
+ # @param resource_group_name [String] The name of the resource group.
248
+ # @param [Hash{String => String}] A hash of custom headers that will be added
249
+ # to the HTTP request.
250
+ #
251
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
252
+ #
253
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
254
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
255
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
256
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
257
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
258
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.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}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines'
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,'resourceGroupName' => resource_group_name},
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 MsRest::HttpOperationError.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::HybridCompute::Mgmt::V2019_12_12::Models::MachineListResult.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
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
311
+ # property in the response to get the next page of hybrid machines.
312
+ #
313
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
314
+ # will be added to the HTTP request.
315
+ #
316
+ # @return [Array<Machine>] operation results.
317
+ #
318
+ def list_by_subscription(custom_headers:nil)
319
+ first_page = list_by_subscription_as_lazy(custom_headers:custom_headers)
320
+ first_page.get_all_items
321
+ end
322
+
323
+ #
324
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
325
+ # property in the response to get the next page of hybrid machines.
326
+ #
327
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
328
+ # will be added to the HTTP request.
329
+ #
330
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
331
+ #
332
+ def list_by_subscription_with_http_info(custom_headers:nil)
333
+ list_by_subscription_async(custom_headers:custom_headers).value!
334
+ end
335
+
336
+ #
337
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
338
+ # property in the response to get the next page of hybrid machines.
339
+ #
340
+ # @param [Hash{String => String}] A hash of custom headers that will be added
341
+ # to the HTTP request.
342
+ #
343
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
344
+ #
345
+ def list_by_subscription_async(custom_headers:nil)
346
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
347
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
348
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
349
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
350
+
351
+
352
+ request_headers = {}
353
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
354
+
355
+ # Set Headers
356
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
357
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
358
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines'
359
+
360
+ request_url = @base_url || @client.base_url
361
+
362
+ options = {
363
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
364
+ path_params: {'subscriptionId' => @client.subscription_id},
365
+ query_params: {'api-version' => @client.api_version},
366
+ headers: request_headers.merge(custom_headers || {}),
367
+ base_url: request_url
368
+ }
369
+ promise = @client.make_request_async(:get, path_template, options)
370
+
371
+ promise = promise.then do |result|
372
+ http_response = result.response
373
+ status_code = http_response.status
374
+ response_content = http_response.body
375
+ unless status_code == 200
376
+ error_model = JSON.load(response_content)
377
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
378
+ end
379
+
380
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
381
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
382
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
383
+ # Deserialize Response
384
+ if status_code == 200
385
+ begin
386
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
387
+ result_mapper = Azure::HybridCompute::Mgmt::V2019_12_12::Models::MachineListResult.mapper()
388
+ result.body = @client.deserialize(result_mapper, parsed_response)
389
+ rescue Exception => e
390
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
391
+ end
392
+ end
393
+
394
+ result
395
+ end
396
+
397
+ promise.execute
398
+ end
399
+
400
+ #
401
+ # Lists all the hybrid machines in the specified resource group. Use the
402
+ # nextLink property in the response to get the next page of hybrid machines.
403
+ #
404
+ # @param next_page_link [String] The NextLink from the previous successful call
405
+ # to List operation.
406
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
407
+ # will be added to the HTTP request.
408
+ #
409
+ # @return [MachineListResult] operation results.
410
+ #
411
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
412
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
413
+ response.body unless response.nil?
414
+ end
415
+
416
+ #
417
+ # Lists all the hybrid machines in the specified resource group. Use the
418
+ # nextLink property in the response to get the next page of hybrid machines.
419
+ #
420
+ # @param next_page_link [String] The NextLink from the previous successful call
421
+ # to List operation.
422
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
423
+ # will be added to the HTTP request.
424
+ #
425
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
426
+ #
427
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
428
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
429
+ end
430
+
431
+ #
432
+ # Lists all the hybrid machines in the specified resource group. Use the
433
+ # nextLink property in the response to get the next page of hybrid machines.
434
+ #
435
+ # @param next_page_link [String] The NextLink from the previous successful call
436
+ # to List operation.
437
+ # @param [Hash{String => String}] A hash of custom headers that will be added
438
+ # to the HTTP request.
439
+ #
440
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
441
+ #
442
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
443
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
444
+
445
+
446
+ request_headers = {}
447
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
448
+
449
+ # Set Headers
450
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
451
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
452
+ path_template = '{nextLink}'
453
+
454
+ request_url = @base_url || @client.base_url
455
+
456
+ options = {
457
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
458
+ skip_encoding_path_params: {'nextLink' => next_page_link},
459
+ headers: request_headers.merge(custom_headers || {}),
460
+ base_url: request_url
461
+ }
462
+ promise = @client.make_request_async(:get, path_template, options)
463
+
464
+ promise = promise.then do |result|
465
+ http_response = result.response
466
+ status_code = http_response.status
467
+ response_content = http_response.body
468
+ unless status_code == 200
469
+ error_model = JSON.load(response_content)
470
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
471
+ end
472
+
473
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
474
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
475
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
476
+ # Deserialize Response
477
+ if status_code == 200
478
+ begin
479
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
480
+ result_mapper = Azure::HybridCompute::Mgmt::V2019_12_12::Models::MachineListResult.mapper()
481
+ result.body = @client.deserialize(result_mapper, parsed_response)
482
+ rescue Exception => e
483
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
484
+ end
485
+ end
486
+
487
+ result
488
+ end
489
+
490
+ promise.execute
491
+ end
492
+
493
+ #
494
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
495
+ # property in the response to get the next page of hybrid machines.
496
+ #
497
+ # @param next_page_link [String] The NextLink from the previous successful call
498
+ # to List operation.
499
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
500
+ # will be added to the HTTP request.
501
+ #
502
+ # @return [MachineListResult] operation results.
503
+ #
504
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
505
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
506
+ response.body unless response.nil?
507
+ end
508
+
509
+ #
510
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
511
+ # property in the response to get the next page of hybrid machines.
512
+ #
513
+ # @param next_page_link [String] The NextLink from the previous successful call
514
+ # to List operation.
515
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
516
+ # will be added to the HTTP request.
517
+ #
518
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
519
+ #
520
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
521
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
522
+ end
523
+
524
+ #
525
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
526
+ # property in the response to get the next page of hybrid machines.
527
+ #
528
+ # @param next_page_link [String] The NextLink from the previous successful call
529
+ # to List operation.
530
+ # @param [Hash{String => String}] A hash of custom headers that will be added
531
+ # to the HTTP request.
532
+ #
533
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
534
+ #
535
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
536
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
537
+
538
+
539
+ request_headers = {}
540
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
541
+
542
+ # Set Headers
543
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
544
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
545
+ path_template = '{nextLink}'
546
+
547
+ request_url = @base_url || @client.base_url
548
+
549
+ options = {
550
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
551
+ skip_encoding_path_params: {'nextLink' => next_page_link},
552
+ headers: request_headers.merge(custom_headers || {}),
553
+ base_url: request_url
554
+ }
555
+ promise = @client.make_request_async(:get, path_template, options)
556
+
557
+ promise = promise.then do |result|
558
+ http_response = result.response
559
+ status_code = http_response.status
560
+ response_content = http_response.body
561
+ unless status_code == 200
562
+ error_model = JSON.load(response_content)
563
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
564
+ end
565
+
566
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
567
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
568
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
569
+ # Deserialize Response
570
+ if status_code == 200
571
+ begin
572
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
573
+ result_mapper = Azure::HybridCompute::Mgmt::V2019_12_12::Models::MachineListResult.mapper()
574
+ result.body = @client.deserialize(result_mapper, parsed_response)
575
+ rescue Exception => e
576
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
577
+ end
578
+ end
579
+
580
+ result
581
+ end
582
+
583
+ promise.execute
584
+ end
585
+
586
+ #
587
+ # Lists all the hybrid machines in the specified resource group. Use the
588
+ # nextLink property in the response to get the next page of hybrid machines.
589
+ #
590
+ # @param resource_group_name [String] The name of the resource group.
591
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
592
+ # will be added to the HTTP request.
593
+ #
594
+ # @return [MachineListResult] which provide lazy access to pages of the
595
+ # response.
596
+ #
597
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
598
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
599
+ unless response.nil?
600
+ page = response.body
601
+ page.next_method = Proc.new do |next_page_link|
602
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
603
+ end
604
+ page
605
+ end
606
+ end
607
+
608
+ #
609
+ # Lists all the hybrid machines in the specified subscription. Use the nextLink
610
+ # property in the response to get the next page of hybrid machines.
611
+ #
612
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
613
+ # will be added to the HTTP request.
614
+ #
615
+ # @return [MachineListResult] which provide lazy access to pages of the
616
+ # response.
617
+ #
618
+ def list_by_subscription_as_lazy(custom_headers:nil)
619
+ response = list_by_subscription_async(custom_headers:custom_headers).value!
620
+ unless response.nil?
621
+ page = response.body
622
+ page.next_method = Proc.new do |next_page_link|
623
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
624
+ end
625
+ page
626
+ end
627
+ end
628
+
629
+ end
630
+ end