azure_mgmt_vmware_cloudsimple 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple.rb +82 -0
  4. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/dedicated_cloud_nodes.rb +945 -0
  5. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/dedicated_cloud_services.rb +932 -0
  6. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/aggregation_type.rb +16 -0
  7. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation.rb +99 -0
  8. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation_display.rb +79 -0
  9. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation_display_property_service_specification_metrics_item.rb +94 -0
  10. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation_display_property_service_specification_metrics_list.rb +60 -0
  11. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operations_list_response.rb +99 -0
  12. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/csrperror.rb +47 -0
  13. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/csrperror_body.rb +91 -0
  14. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_node.rb +293 -0
  15. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_node_list_response.rb +99 -0
  16. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_service.rb +154 -0
  17. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_service_list_response.rb +99 -0
  18. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/disk_independence_mode.rb +17 -0
  19. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/guest_ostype.rb +17 -0
  20. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/nictype.rb +20 -0
  21. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/node_status.rb +16 -0
  22. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/onboarding_status.rb +18 -0
  23. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/operation_error.rb +57 -0
  24. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/operation_origin.rb +17 -0
  25. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/operation_resource.rb +107 -0
  26. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/patch_payload.rb +54 -0
  27. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/private_cloud.rb +382 -0
  28. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/private_cloud_list.rb +98 -0
  29. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/private_cloud_resource_type.rb +15 -0
  30. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/resource_pool.rb +106 -0
  31. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/resource_pools_list_response.rb +98 -0
  32. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/sku.rb +93 -0
  33. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/sku_availability.rb +124 -0
  34. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/sku_availability_list_response.rb +99 -0
  35. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/stop_mode.rb +18 -0
  36. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage.rb +87 -0
  37. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage_count.rb +20 -0
  38. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage_list_response.rb +99 -0
  39. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage_name.rb +58 -0
  40. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_disk.rb +94 -0
  41. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_disk_controller.rb +84 -0
  42. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine.rb +388 -0
  43. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_list_response.rb +98 -0
  44. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_status.rb +20 -0
  45. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_stop_mode.rb +49 -0
  46. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_template.rb +283 -0
  47. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_template_list_response.rb +98 -0
  48. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_network.rb +106 -0
  49. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_network_list_response.rb +98 -0
  50. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_nic.rb +124 -0
  51. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/module_definition.rb +9 -0
  52. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/operations.rb +335 -0
  53. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/private_clouds.rb +340 -0
  54. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/resource_pools.rb +349 -0
  55. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/skus_availability.rb +248 -0
  56. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/usages.rb +248 -0
  57. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/virtual_machine_templates.rb +361 -0
  58. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/virtual_machines.rb +1326 -0
  59. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/virtual_networks.rb +358 -0
  60. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/vmware_cloud_simple_client.rb +170 -0
  61. data/lib/azure_mgmt_vmware_cloudsimple.rb +6 -0
  62. data/lib/module_definition.rb +7 -0
  63. data/lib/profiles/latest/modules/vmwarecloudsimple_profile_module.rb +259 -0
  64. data/lib/profiles/latest/vmwarecloudsimple_latest_profile_client.rb +40 -0
  65. data/lib/profiles/latest/vmwarecloudsimple_module_definition.rb +8 -0
  66. data/lib/version.rb +7 -0
  67. metadata +182 -0
@@ -0,0 +1,340 @@
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::VMwareCloudSimple::Mgmt::V2019_04_01
7
+ #
8
+ # Description of the new service
9
+ #
10
+ class PrivateClouds
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateClouds class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [VMwareCloudSimpleClient] reference to the VMwareCloudSimpleClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Implements private cloud list GET method
26
+ #
27
+ # Returns list of private clouds in particular region
28
+ #
29
+ # @param region_id [String] The region Id (westus, eastus)
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<PrivateCloud>] operation results.
34
+ #
35
+ def list(region_id, custom_headers:nil)
36
+ first_page = list_as_lazy(region_id, custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Implements private cloud list GET method
42
+ #
43
+ # Returns list of private clouds in particular region
44
+ #
45
+ # @param region_id [String] The region Id (westus, eastus)
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(region_id, custom_headers:nil)
52
+ list_async(region_id, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Implements private cloud list GET method
57
+ #
58
+ # Returns list of private clouds in particular region
59
+ #
60
+ # @param region_id [String] The region Id (westus, eastus)
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(region_id, custom_headers:nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ fail ArgumentError, 'region_id is nil' if region_id.nil?
69
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
70
+
71
+
72
+ request_headers = {}
73
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
74
+
75
+ # Set Headers
76
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds'
79
+
80
+ request_url = @base_url || @client.base_url
81
+
82
+ options = {
83
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
84
+ path_params: {'subscriptionId' => @client.subscription_id,'regionId' => region_id},
85
+ query_params: {'api-version' => @client.api_version},
86
+ headers: request_headers.merge(custom_headers || {}),
87
+ base_url: request_url
88
+ }
89
+ promise = @client.make_request_async(:get, path_template, options)
90
+
91
+ promise = promise.then do |result|
92
+ http_response = result.response
93
+ status_code = http_response.status
94
+ response_content = http_response.body
95
+ unless status_code == 200
96
+ error_model = JSON.load(response_content)
97
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
98
+ end
99
+
100
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
101
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
102
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
103
+ # Deserialize Response
104
+ if status_code == 200
105
+ begin
106
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
107
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::PrivateCloudList.mapper()
108
+ result.body = @client.deserialize(result_mapper, parsed_response)
109
+ rescue Exception => e
110
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
111
+ end
112
+ end
113
+
114
+ result
115
+ end
116
+
117
+ promise.execute
118
+ end
119
+
120
+ #
121
+ # Implements private cloud GET method
122
+ #
123
+ # Returns private cloud by its name
124
+ #
125
+ # @param pc_name [String] The private cloud name
126
+ # @param region_id [String] The region Id (westus, eastus)
127
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
128
+ # will be added to the HTTP request.
129
+ #
130
+ # @return [PrivateCloud] operation results.
131
+ #
132
+ def get(pc_name, region_id, custom_headers:nil)
133
+ response = get_async(pc_name, region_id, custom_headers:custom_headers).value!
134
+ response.body unless response.nil?
135
+ end
136
+
137
+ #
138
+ # Implements private cloud GET method
139
+ #
140
+ # Returns private cloud by its name
141
+ #
142
+ # @param pc_name [String] The private cloud name
143
+ # @param region_id [String] The region Id (westus, eastus)
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
148
+ #
149
+ def get_with_http_info(pc_name, region_id, custom_headers:nil)
150
+ get_async(pc_name, region_id, custom_headers:custom_headers).value!
151
+ end
152
+
153
+ #
154
+ # Implements private cloud GET method
155
+ #
156
+ # Returns private cloud by its name
157
+ #
158
+ # @param pc_name [String] The private cloud name
159
+ # @param region_id [String] The region Id (westus, eastus)
160
+ # @param [Hash{String => String}] A hash of custom headers that will be added
161
+ # to the HTTP request.
162
+ #
163
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
164
+ #
165
+ def get_async(pc_name, region_id, custom_headers:nil)
166
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
167
+ fail ArgumentError, 'pc_name is nil' if pc_name.nil?
168
+ fail ArgumentError, 'region_id is nil' if region_id.nil?
169
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
170
+
171
+
172
+ request_headers = {}
173
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
174
+
175
+ # Set Headers
176
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
177
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
178
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}'
179
+
180
+ request_url = @base_url || @client.base_url
181
+
182
+ options = {
183
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
184
+ path_params: {'subscriptionId' => @client.subscription_id,'pcName' => pc_name,'regionId' => region_id},
185
+ query_params: {'api-version' => @client.api_version},
186
+ headers: request_headers.merge(custom_headers || {}),
187
+ base_url: request_url
188
+ }
189
+ promise = @client.make_request_async(:get, path_template, options)
190
+
191
+ promise = promise.then do |result|
192
+ http_response = result.response
193
+ status_code = http_response.status
194
+ response_content = http_response.body
195
+ unless status_code == 200
196
+ error_model = JSON.load(response_content)
197
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
198
+ end
199
+
200
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
201
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
202
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
203
+ # Deserialize Response
204
+ if status_code == 200
205
+ begin
206
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
207
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::PrivateCloud.mapper()
208
+ result.body = @client.deserialize(result_mapper, parsed_response)
209
+ rescue Exception => e
210
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
211
+ end
212
+ end
213
+
214
+ result
215
+ end
216
+
217
+ promise.execute
218
+ end
219
+
220
+ #
221
+ # Implements private cloud list GET method
222
+ #
223
+ # Returns list of private clouds in particular region
224
+ #
225
+ # @param next_page_link [String] The NextLink from the previous successful call
226
+ # to List operation.
227
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
228
+ # will be added to the HTTP request.
229
+ #
230
+ # @return [PrivateCloudList] operation results.
231
+ #
232
+ def list_next(next_page_link, custom_headers:nil)
233
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
234
+ response.body unless response.nil?
235
+ end
236
+
237
+ #
238
+ # Implements private cloud list GET method
239
+ #
240
+ # Returns list of private clouds in particular region
241
+ #
242
+ # @param next_page_link [String] The NextLink from the previous successful call
243
+ # to List operation.
244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
245
+ # will be added to the HTTP request.
246
+ #
247
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
248
+ #
249
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
250
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
251
+ end
252
+
253
+ #
254
+ # Implements private cloud list GET method
255
+ #
256
+ # Returns list of private clouds in particular region
257
+ #
258
+ # @param next_page_link [String] The NextLink from the previous successful call
259
+ # to List operation.
260
+ # @param [Hash{String => String}] A hash of custom headers that will be added
261
+ # to the HTTP request.
262
+ #
263
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
264
+ #
265
+ def list_next_async(next_page_link, custom_headers:nil)
266
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
267
+
268
+
269
+ request_headers = {}
270
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
271
+
272
+ # Set Headers
273
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
274
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
275
+ path_template = '{nextLink}'
276
+
277
+ request_url = @base_url || @client.base_url
278
+
279
+ options = {
280
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
281
+ skip_encoding_path_params: {'nextLink' => next_page_link},
282
+ headers: request_headers.merge(custom_headers || {}),
283
+ base_url: request_url
284
+ }
285
+ promise = @client.make_request_async(:get, path_template, options)
286
+
287
+ promise = promise.then do |result|
288
+ http_response = result.response
289
+ status_code = http_response.status
290
+ response_content = http_response.body
291
+ unless status_code == 200
292
+ error_model = JSON.load(response_content)
293
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
294
+ end
295
+
296
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
297
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
298
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
299
+ # Deserialize Response
300
+ if status_code == 200
301
+ begin
302
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
303
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::PrivateCloudList.mapper()
304
+ result.body = @client.deserialize(result_mapper, parsed_response)
305
+ rescue Exception => e
306
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
307
+ end
308
+ end
309
+
310
+ result
311
+ end
312
+
313
+ promise.execute
314
+ end
315
+
316
+ #
317
+ # Implements private cloud list GET method
318
+ #
319
+ # Returns list of private clouds in particular region
320
+ #
321
+ # @param region_id [String] The region Id (westus, eastus)
322
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
323
+ # will be added to the HTTP request.
324
+ #
325
+ # @return [PrivateCloudList] which provide lazy access to pages of the
326
+ # response.
327
+ #
328
+ def list_as_lazy(region_id, custom_headers:nil)
329
+ response = list_async(region_id, custom_headers:custom_headers).value!
330
+ unless response.nil?
331
+ page = response.body
332
+ page.next_method = Proc.new do |next_page_link|
333
+ list_next_async(next_page_link, custom_headers:custom_headers)
334
+ end
335
+ page
336
+ end
337
+ end
338
+
339
+ end
340
+ end
@@ -0,0 +1,349 @@
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::VMwareCloudSimple::Mgmt::V2019_04_01
7
+ #
8
+ # Description of the new service
9
+ #
10
+ class ResourcePools
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ResourcePools class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [VMwareCloudSimpleClient] reference to the VMwareCloudSimpleClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Implements get of resource pools list
26
+ #
27
+ # Returns list of resource pools in region for private cloud
28
+ #
29
+ # @param region_id [String] The region Id (westus, eastus)
30
+ # @param pc_name [String] The private cloud name
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<ResourcePool>] operation results.
35
+ #
36
+ def list(region_id, pc_name, custom_headers:nil)
37
+ first_page = list_as_lazy(region_id, pc_name, custom_headers:custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Implements get of resource pools list
43
+ #
44
+ # Returns list of resource pools in region for private cloud
45
+ #
46
+ # @param region_id [String] The region Id (westus, eastus)
47
+ # @param pc_name [String] The private cloud name
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_with_http_info(region_id, pc_name, custom_headers:nil)
54
+ list_async(region_id, pc_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Implements get of resource pools list
59
+ #
60
+ # Returns list of resource pools in region for private cloud
61
+ #
62
+ # @param region_id [String] The region Id (westus, eastus)
63
+ # @param pc_name [String] The private cloud name
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_async(region_id, pc_name, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, 'region_id is nil' if region_id.nil?
72
+ fail ArgumentError, 'pc_name is nil' if pc_name.nil?
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+
75
+
76
+ request_headers = {}
77
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
78
+
79
+ # Set Headers
80
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
81
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
82
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools'
83
+
84
+ request_url = @base_url || @client.base_url
85
+
86
+ options = {
87
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
88
+ path_params: {'subscriptionId' => @client.subscription_id,'regionId' => region_id,'pcName' => pc_name},
89
+ query_params: {'api-version' => @client.api_version},
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:get, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
106
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
107
+ # Deserialize Response
108
+ if status_code == 200
109
+ begin
110
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
111
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::ResourcePoolsListResponse.mapper()
112
+ result.body = @client.deserialize(result_mapper, parsed_response)
113
+ rescue Exception => e
114
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
115
+ end
116
+ end
117
+
118
+ result
119
+ end
120
+
121
+ promise.execute
122
+ end
123
+
124
+ #
125
+ # Implements get of resource pool
126
+ #
127
+ # Returns resource pool templates by its name
128
+ #
129
+ # @param region_id [String] The region Id (westus, eastus)
130
+ # @param pc_name [String] The private cloud name
131
+ # @param resource_pool_name [String] resource pool id (vsphereId)
132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [ResourcePool] operation results.
136
+ #
137
+ def get(region_id, pc_name, resource_pool_name, custom_headers:nil)
138
+ response = get_async(region_id, pc_name, resource_pool_name, custom_headers:custom_headers).value!
139
+ response.body unless response.nil?
140
+ end
141
+
142
+ #
143
+ # Implements get of resource pool
144
+ #
145
+ # Returns resource pool templates by its name
146
+ #
147
+ # @param region_id [String] The region Id (westus, eastus)
148
+ # @param pc_name [String] The private cloud name
149
+ # @param resource_pool_name [String] resource pool id (vsphereId)
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
154
+ #
155
+ def get_with_http_info(region_id, pc_name, resource_pool_name, custom_headers:nil)
156
+ get_async(region_id, pc_name, resource_pool_name, custom_headers:custom_headers).value!
157
+ end
158
+
159
+ #
160
+ # Implements get of resource pool
161
+ #
162
+ # Returns resource pool templates by its name
163
+ #
164
+ # @param region_id [String] The region Id (westus, eastus)
165
+ # @param pc_name [String] The private cloud name
166
+ # @param resource_pool_name [String] resource pool id (vsphereId)
167
+ # @param [Hash{String => String}] A hash of custom headers that will be added
168
+ # to the HTTP request.
169
+ #
170
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
171
+ #
172
+ def get_async(region_id, pc_name, resource_pool_name, custom_headers:nil)
173
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
174
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
175
+ fail ArgumentError, 'region_id is nil' if region_id.nil?
176
+ fail ArgumentError, 'pc_name is nil' if pc_name.nil?
177
+ fail ArgumentError, 'resource_pool_name is nil' if resource_pool_name.nil?
178
+
179
+
180
+ request_headers = {}
181
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
182
+
183
+ # Set Headers
184
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
185
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
186
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/locations/{regionId}/privateClouds/{pcName}/resourcePools/{resourcePoolName}'
187
+
188
+ request_url = @base_url || @client.base_url
189
+
190
+ options = {
191
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
192
+ path_params: {'subscriptionId' => @client.subscription_id,'regionId' => region_id,'pcName' => pc_name,'resourcePoolName' => resource_pool_name},
193
+ query_params: {'api-version' => @client.api_version},
194
+ headers: request_headers.merge(custom_headers || {}),
195
+ base_url: request_url
196
+ }
197
+ promise = @client.make_request_async(:get, path_template, options)
198
+
199
+ promise = promise.then do |result|
200
+ http_response = result.response
201
+ status_code = http_response.status
202
+ response_content = http_response.body
203
+ unless status_code == 200
204
+ error_model = JSON.load(response_content)
205
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
206
+ end
207
+
208
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
209
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
210
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
211
+ # Deserialize Response
212
+ if status_code == 200
213
+ begin
214
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
215
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::ResourcePool.mapper()
216
+ result.body = @client.deserialize(result_mapper, parsed_response)
217
+ rescue Exception => e
218
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
219
+ end
220
+ end
221
+
222
+ result
223
+ end
224
+
225
+ promise.execute
226
+ end
227
+
228
+ #
229
+ # Implements get of resource pools list
230
+ #
231
+ # Returns list of resource pools in region for private cloud
232
+ #
233
+ # @param next_page_link [String] The NextLink from the previous successful call
234
+ # to List operation.
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ # @return [ResourcePoolsListResponse] operation results.
239
+ #
240
+ def list_next(next_page_link, custom_headers:nil)
241
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
242
+ response.body unless response.nil?
243
+ end
244
+
245
+ #
246
+ # Implements get of resource pools list
247
+ #
248
+ # Returns list of resource pools in region for private cloud
249
+ #
250
+ # @param next_page_link [String] The NextLink from the previous successful call
251
+ # to List operation.
252
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
253
+ # will be added to the HTTP request.
254
+ #
255
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
256
+ #
257
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
258
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
259
+ end
260
+
261
+ #
262
+ # Implements get of resource pools list
263
+ #
264
+ # Returns list of resource pools in region for private cloud
265
+ #
266
+ # @param next_page_link [String] The NextLink from the previous successful call
267
+ # to List operation.
268
+ # @param [Hash{String => String}] A hash of custom headers that will be added
269
+ # to the HTTP request.
270
+ #
271
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
272
+ #
273
+ def list_next_async(next_page_link, custom_headers:nil)
274
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
275
+
276
+
277
+ request_headers = {}
278
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
279
+
280
+ # Set Headers
281
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
282
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
283
+ path_template = '{nextLink}'
284
+
285
+ request_url = @base_url || @client.base_url
286
+
287
+ options = {
288
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
289
+ skip_encoding_path_params: {'nextLink' => next_page_link},
290
+ headers: request_headers.merge(custom_headers || {}),
291
+ base_url: request_url
292
+ }
293
+ promise = @client.make_request_async(:get, path_template, options)
294
+
295
+ promise = promise.then do |result|
296
+ http_response = result.response
297
+ status_code = http_response.status
298
+ response_content = http_response.body
299
+ unless status_code == 200
300
+ error_model = JSON.load(response_content)
301
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
302
+ end
303
+
304
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
305
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
306
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
307
+ # Deserialize Response
308
+ if status_code == 200
309
+ begin
310
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
311
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::ResourcePoolsListResponse.mapper()
312
+ result.body = @client.deserialize(result_mapper, parsed_response)
313
+ rescue Exception => e
314
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
315
+ end
316
+ end
317
+
318
+ result
319
+ end
320
+
321
+ promise.execute
322
+ end
323
+
324
+ #
325
+ # Implements get of resource pools list
326
+ #
327
+ # Returns list of resource pools in region for private cloud
328
+ #
329
+ # @param region_id [String] The region Id (westus, eastus)
330
+ # @param pc_name [String] The private cloud name
331
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
332
+ # will be added to the HTTP request.
333
+ #
334
+ # @return [ResourcePoolsListResponse] which provide lazy access to pages of the
335
+ # response.
336
+ #
337
+ def list_as_lazy(region_id, pc_name, custom_headers:nil)
338
+ response = list_async(region_id, pc_name, custom_headers:custom_headers).value!
339
+ unless response.nil?
340
+ page = response.body
341
+ page.next_method = Proc.new do |next_page_link|
342
+ list_next_async(next_page_link, custom_headers:custom_headers)
343
+ end
344
+ page
345
+ end
346
+ end
347
+
348
+ end
349
+ end