azure_mgmt_netapp 0.17.2 → 0.17.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  3. data/lib/2019-05-01/generated/azure_mgmt_netapp/accounts.rb +641 -0
  4. data/lib/2019-05-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +415 -0
  5. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/active_directory.rb +127 -0
  6. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/capacity_pool.rb +154 -0
  7. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  8. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +125 -0
  9. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb +18 -0
  10. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  11. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb +113 -0
  12. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb +16 -0
  13. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  14. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/mount_target.rb +210 -0
  15. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/mount_target_list.rb +55 -0
  16. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/net_app_account.rb +125 -0
  17. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  18. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +125 -0
  19. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  20. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  21. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  22. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/resource_name_availability.rb +78 -0
  23. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb +72 -0
  24. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  25. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  26. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/snapshot.rb +150 -0
  27. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/snapshot_patch.rb +46 -0
  28. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  29. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/volume.rb +226 -0
  30. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/volume_list.rb +55 -0
  31. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/volume_patch.rb +139 -0
  32. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb +58 -0
  33. data/lib/2019-05-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb +58 -0
  34. data/lib/2019-05-01/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  35. data/lib/2019-05-01/generated/azure_mgmt_netapp/mount_targets.rb +134 -0
  36. data/lib/2019-05-01/generated/azure_mgmt_netapp/operations.rb +113 -0
  37. data/lib/2019-05-01/generated/azure_mgmt_netapp/pools.rb +665 -0
  38. data/lib/2019-05-01/generated/azure_mgmt_netapp/snapshots.rb +698 -0
  39. data/lib/2019-05-01/generated/azure_mgmt_netapp/volumes.rb +684 -0
  40. data/lib/2019-05-01/generated/azure_mgmt_netapp.rb +62 -0
  41. data/lib/azure_mgmt_netapp.rb +1 -0
  42. data/lib/profiles/latest/modules/netapp_profile_module.rb +84 -72
  43. data/lib/version.rb +1 -1
  44. metadata +41 -3
@@ -0,0 +1,665 @@
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::NetApp::Mgmt::V2019_05_01
7
+ #
8
+ # Microsoft NetApp Azure Resource Provider specification
9
+ #
10
+ class Pools
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Pools class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AzureNetAppFilesManagementClient] reference to the AzureNetAppFilesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Describe all Capacity Pools
26
+ #
27
+ # List all capacity pools in the NetApp Account
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group.
30
+ # @param account_name [String] The name of the NetApp account
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [CapacityPoolList] operation results.
35
+ #
36
+ def list(resource_group_name, account_name, custom_headers:nil)
37
+ response = list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Describe all Capacity Pools
43
+ #
44
+ # List all capacity pools in the NetApp Account
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group.
47
+ # @param account_name [String] The name of the NetApp account
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(resource_group_name, account_name, custom_headers:nil)
54
+ list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Describe all Capacity Pools
59
+ #
60
+ # List all capacity pools in the NetApp Account
61
+ #
62
+ # @param resource_group_name [String] The name of the resource group.
63
+ # @param account_name [String] The name of the NetApp account
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(resource_group_name, account_name, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
73
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
74
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
75
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+
78
+
79
+ request_headers = {}
80
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
92
+ query_params: {'api-version' => @client.api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:get, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ # Deserialize Response
109
+ if status_code == 200
110
+ begin
111
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
+ result_mapper = Azure::NetApp::Mgmt::V2019_05_01::Models::CapacityPoolList.mapper()
113
+ result.body = @client.deserialize(result_mapper, parsed_response)
114
+ rescue Exception => e
115
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
116
+ end
117
+ end
118
+
119
+ result
120
+ end
121
+
122
+ promise.execute
123
+ end
124
+
125
+ #
126
+ # Describe a Capacity Pool
127
+ #
128
+ # Get details of the specified capacity pool
129
+ #
130
+ # @param resource_group_name [String] The name of the resource group.
131
+ # @param account_name [String] The name of the NetApp account
132
+ # @param pool_name [String] The name of the capacity pool
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [CapacityPool] operation results.
137
+ #
138
+ def get(resource_group_name, account_name, pool_name, custom_headers:nil)
139
+ response = get_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
140
+ response.body unless response.nil?
141
+ end
142
+
143
+ #
144
+ # Describe a Capacity Pool
145
+ #
146
+ # Get details of the specified capacity pool
147
+ #
148
+ # @param resource_group_name [String] The name of the resource group.
149
+ # @param account_name [String] The name of the NetApp account
150
+ # @param pool_name [String] The name of the capacity pool
151
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
152
+ # will be added to the HTTP request.
153
+ #
154
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
155
+ #
156
+ def get_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
157
+ get_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
158
+ end
159
+
160
+ #
161
+ # Describe a Capacity Pool
162
+ #
163
+ # Get details of the specified capacity pool
164
+ #
165
+ # @param resource_group_name [String] The name of the resource group.
166
+ # @param account_name [String] The name of the NetApp account
167
+ # @param pool_name [String] The name of the capacity pool
168
+ # @param [Hash{String => String}] A hash of custom headers that will be added
169
+ # to the HTTP request.
170
+ #
171
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
172
+ #
173
+ def get_async(resource_group_name, account_name, pool_name, custom_headers:nil)
174
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
175
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
176
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
177
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
178
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
179
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
180
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
181
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
182
+
183
+
184
+ request_headers = {}
185
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
186
+
187
+ # Set Headers
188
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
189
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
190
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
191
+
192
+ request_url = @base_url || @client.base_url
193
+
194
+ options = {
195
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
196
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
197
+ query_params: {'api-version' => @client.api_version},
198
+ headers: request_headers.merge(custom_headers || {}),
199
+ base_url: request_url
200
+ }
201
+ promise = @client.make_request_async(:get, path_template, options)
202
+
203
+ promise = promise.then do |result|
204
+ http_response = result.response
205
+ status_code = http_response.status
206
+ response_content = http_response.body
207
+ unless status_code == 200
208
+ error_model = JSON.load(response_content)
209
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
210
+ end
211
+
212
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
213
+ # Deserialize Response
214
+ if status_code == 200
215
+ begin
216
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
217
+ result_mapper = Azure::NetApp::Mgmt::V2019_05_01::Models::CapacityPool.mapper()
218
+ result.body = @client.deserialize(result_mapper, parsed_response)
219
+ rescue Exception => e
220
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
221
+ end
222
+ end
223
+
224
+ result
225
+ end
226
+
227
+ promise.execute
228
+ end
229
+
230
+ #
231
+ # Create or Update the specified capacity pool within the resource group
232
+ #
233
+ # Create or Update a capacity pool
234
+ #
235
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
236
+ # operation.
237
+ # @param resource_group_name [String] The name of the resource group.
238
+ # @param account_name [String] The name of the NetApp account
239
+ # @param pool_name [String] The name of the capacity pool
240
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
241
+ # will be added to the HTTP request.
242
+ #
243
+ # @return [CapacityPool] operation results.
244
+ #
245
+ def create_or_update(body, resource_group_name, account_name, pool_name, custom_headers:nil)
246
+ response = create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
247
+ response.body unless response.nil?
248
+ end
249
+
250
+ #
251
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
252
+ # operation.
253
+ # @param resource_group_name [String] The name of the resource group.
254
+ # @param account_name [String] The name of the NetApp account
255
+ # @param pool_name [String] The name of the capacity pool
256
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
257
+ # will be added to the HTTP request.
258
+ #
259
+ # @return [Concurrent::Promise] promise which provides async access to http
260
+ # response.
261
+ #
262
+ def create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:nil)
263
+ # Send request
264
+ promise = begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers)
265
+
266
+ promise = promise.then do |response|
267
+ # Defining deserialization method.
268
+ deserialize_method = lambda do |parsed_response|
269
+ result_mapper = Azure::NetApp::Mgmt::V2019_05_01::Models::CapacityPool.mapper()
270
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
271
+ end
272
+
273
+ # Waiting for response.
274
+ @client.get_long_running_operation_result(response, deserialize_method)
275
+ end
276
+
277
+ promise
278
+ end
279
+
280
+ #
281
+ # Update a capacity pool
282
+ #
283
+ # Patch the specified capacity pool
284
+ #
285
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
286
+ # the operation.
287
+ # @param resource_group_name [String] The name of the resource group.
288
+ # @param account_name [String] The name of the NetApp account
289
+ # @param pool_name [String] The name of the capacity pool
290
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
291
+ # will be added to the HTTP request.
292
+ #
293
+ # @return [CapacityPool] operation results.
294
+ #
295
+ def update(body, resource_group_name, account_name, pool_name, custom_headers:nil)
296
+ response = update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
297
+ response.body unless response.nil?
298
+ end
299
+
300
+ #
301
+ # Update a capacity pool
302
+ #
303
+ # Patch the specified capacity pool
304
+ #
305
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
306
+ # the operation.
307
+ # @param resource_group_name [String] The name of the resource group.
308
+ # @param account_name [String] The name of the NetApp account
309
+ # @param pool_name [String] The name of the capacity pool
310
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
311
+ # will be added to the HTTP request.
312
+ #
313
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
314
+ #
315
+ def update_with_http_info(body, resource_group_name, account_name, pool_name, custom_headers:nil)
316
+ update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
317
+ end
318
+
319
+ #
320
+ # Update a capacity pool
321
+ #
322
+ # Patch the specified capacity pool
323
+ #
324
+ # @param body [CapacityPoolPatch] Capacity pool object supplied in the body of
325
+ # the operation.
326
+ # @param resource_group_name [String] The name of the resource group.
327
+ # @param account_name [String] The name of the NetApp account
328
+ # @param pool_name [String] The name of the capacity pool
329
+ # @param [Hash{String => String}] A hash of custom headers that will be added
330
+ # to the HTTP request.
331
+ #
332
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
333
+ #
334
+ def update_async(body, resource_group_name, account_name, pool_name, custom_headers:nil)
335
+ fail ArgumentError, 'body is nil' if body.nil?
336
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
337
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
338
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
339
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
340
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
341
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
342
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
343
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
344
+
345
+
346
+ request_headers = {}
347
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
348
+
349
+ # Set Headers
350
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
351
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
352
+
353
+ # Serialize Request
354
+ request_mapper = Azure::NetApp::Mgmt::V2019_05_01::Models::CapacityPoolPatch.mapper()
355
+ request_content = @client.serialize(request_mapper, body)
356
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
357
+
358
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
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,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
365
+ query_params: {'api-version' => @client.api_version},
366
+ body: request_content,
367
+ headers: request_headers.merge(custom_headers || {}),
368
+ base_url: request_url
369
+ }
370
+ promise = @client.make_request_async(:patch, path_template, options)
371
+
372
+ promise = promise.then do |result|
373
+ http_response = result.response
374
+ status_code = http_response.status
375
+ response_content = http_response.body
376
+ unless status_code == 200
377
+ error_model = JSON.load(response_content)
378
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
379
+ end
380
+
381
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
382
+ # Deserialize Response
383
+ if status_code == 200
384
+ begin
385
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
386
+ result_mapper = Azure::NetApp::Mgmt::V2019_05_01::Models::CapacityPool.mapper()
387
+ result.body = @client.deserialize(result_mapper, parsed_response)
388
+ rescue Exception => e
389
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
390
+ end
391
+ end
392
+
393
+ result
394
+ end
395
+
396
+ promise.execute
397
+ end
398
+
399
+ #
400
+ # Delete a capacity pool
401
+ #
402
+ # Delete the specified capacity pool
403
+ #
404
+ # @param resource_group_name [String] The name of the resource group.
405
+ # @param account_name [String] The name of the NetApp account
406
+ # @param pool_name [String] The name of the capacity pool
407
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
408
+ # will be added to the HTTP request.
409
+ #
410
+ def delete(resource_group_name, account_name, pool_name, custom_headers:nil)
411
+ response = delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
412
+ nil
413
+ end
414
+
415
+ #
416
+ # @param resource_group_name [String] The name of the resource group.
417
+ # @param account_name [String] The name of the NetApp account
418
+ # @param pool_name [String] The name of the capacity pool
419
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
420
+ # will be added to the HTTP request.
421
+ #
422
+ # @return [Concurrent::Promise] promise which provides async access to http
423
+ # response.
424
+ #
425
+ def delete_async(resource_group_name, account_name, pool_name, custom_headers:nil)
426
+ # Send request
427
+ promise = begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers)
428
+
429
+ promise = promise.then do |response|
430
+ # Defining deserialization method.
431
+ deserialize_method = lambda do |parsed_response|
432
+ end
433
+
434
+ # Waiting for response.
435
+ @client.get_long_running_operation_result(response, deserialize_method)
436
+ end
437
+
438
+ promise
439
+ end
440
+
441
+ #
442
+ # Create or Update the specified capacity pool within the resource group
443
+ #
444
+ # Create or Update a capacity pool
445
+ #
446
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
447
+ # operation.
448
+ # @param resource_group_name [String] The name of the resource group.
449
+ # @param account_name [String] The name of the NetApp account
450
+ # @param pool_name [String] The name of the capacity pool
451
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
452
+ # will be added to the HTTP request.
453
+ #
454
+ # @return [CapacityPool] operation results.
455
+ #
456
+ def begin_create_or_update(body, resource_group_name, account_name, pool_name, custom_headers:nil)
457
+ response = begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
458
+ response.body unless response.nil?
459
+ end
460
+
461
+ #
462
+ # Create or Update the specified capacity pool within the resource group
463
+ #
464
+ # Create or Update a capacity pool
465
+ #
466
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
467
+ # operation.
468
+ # @param resource_group_name [String] The name of the resource group.
469
+ # @param account_name [String] The name of the NetApp account
470
+ # @param pool_name [String] The name of the capacity pool
471
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
472
+ # will be added to the HTTP request.
473
+ #
474
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
475
+ #
476
+ def begin_create_or_update_with_http_info(body, resource_group_name, account_name, pool_name, custom_headers:nil)
477
+ begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
478
+ end
479
+
480
+ #
481
+ # Create or Update the specified capacity pool within the resource group
482
+ #
483
+ # Create or Update a capacity pool
484
+ #
485
+ # @param body [CapacityPool] Capacity pool object supplied in the body of the
486
+ # operation.
487
+ # @param resource_group_name [String] The name of the resource group.
488
+ # @param account_name [String] The name of the NetApp account
489
+ # @param pool_name [String] The name of the capacity pool
490
+ # @param [Hash{String => String}] A hash of custom headers that will be added
491
+ # to the HTTP request.
492
+ #
493
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
494
+ #
495
+ def begin_create_or_update_async(body, resource_group_name, account_name, pool_name, custom_headers:nil)
496
+ fail ArgumentError, 'body is nil' if body.nil?
497
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
498
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
499
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
500
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
501
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
502
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
503
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
504
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
505
+
506
+
507
+ request_headers = {}
508
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
509
+
510
+ # Set Headers
511
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
512
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
513
+
514
+ # Serialize Request
515
+ request_mapper = Azure::NetApp::Mgmt::V2019_05_01::Models::CapacityPool.mapper()
516
+ request_content = @client.serialize(request_mapper, body)
517
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
518
+
519
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
520
+
521
+ request_url = @base_url || @client.base_url
522
+
523
+ options = {
524
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
525
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
526
+ query_params: {'api-version' => @client.api_version},
527
+ body: request_content,
528
+ headers: request_headers.merge(custom_headers || {}),
529
+ base_url: request_url
530
+ }
531
+ promise = @client.make_request_async(:put, path_template, options)
532
+
533
+ promise = promise.then do |result|
534
+ http_response = result.response
535
+ status_code = http_response.status
536
+ response_content = http_response.body
537
+ unless status_code == 200 || status_code == 201 || status_code == 202
538
+ error_model = JSON.load(response_content)
539
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
540
+ end
541
+
542
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
543
+ # Deserialize Response
544
+ if status_code == 200
545
+ begin
546
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
547
+ result_mapper = Azure::NetApp::Mgmt::V2019_05_01::Models::CapacityPool.mapper()
548
+ result.body = @client.deserialize(result_mapper, parsed_response)
549
+ rescue Exception => e
550
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
551
+ end
552
+ end
553
+ # Deserialize Response
554
+ if status_code == 201
555
+ begin
556
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
557
+ result_mapper = Azure::NetApp::Mgmt::V2019_05_01::Models::CapacityPool.mapper()
558
+ result.body = @client.deserialize(result_mapper, parsed_response)
559
+ rescue Exception => e
560
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
561
+ end
562
+ end
563
+
564
+ result
565
+ end
566
+
567
+ promise.execute
568
+ end
569
+
570
+ #
571
+ # Delete a capacity pool
572
+ #
573
+ # Delete the specified capacity pool
574
+ #
575
+ # @param resource_group_name [String] The name of the resource group.
576
+ # @param account_name [String] The name of the NetApp account
577
+ # @param pool_name [String] The name of the capacity pool
578
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
579
+ # will be added to the HTTP request.
580
+ #
581
+ #
582
+ def begin_delete(resource_group_name, account_name, pool_name, custom_headers:nil)
583
+ response = begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
584
+ nil
585
+ end
586
+
587
+ #
588
+ # Delete a capacity pool
589
+ #
590
+ # Delete the specified capacity pool
591
+ #
592
+ # @param resource_group_name [String] The name of the resource group.
593
+ # @param account_name [String] The name of the NetApp account
594
+ # @param pool_name [String] The name of the capacity pool
595
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
596
+ # will be added to the HTTP request.
597
+ #
598
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
599
+ #
600
+ def begin_delete_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
601
+ begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
602
+ end
603
+
604
+ #
605
+ # Delete a capacity pool
606
+ #
607
+ # Delete the specified capacity pool
608
+ #
609
+ # @param resource_group_name [String] The name of the resource group.
610
+ # @param account_name [String] The name of the NetApp account
611
+ # @param pool_name [String] The name of the capacity pool
612
+ # @param [Hash{String => String}] A hash of custom headers that will be added
613
+ # to the HTTP request.
614
+ #
615
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
616
+ #
617
+ def begin_delete_async(resource_group_name, account_name, pool_name, custom_headers:nil)
618
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
619
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
620
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
621
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
622
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
623
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
624
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
625
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
626
+
627
+
628
+ request_headers = {}
629
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
630
+
631
+ # Set Headers
632
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
633
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
634
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}'
635
+
636
+ request_url = @base_url || @client.base_url
637
+
638
+ options = {
639
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
640
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
641
+ query_params: {'api-version' => @client.api_version},
642
+ headers: request_headers.merge(custom_headers || {}),
643
+ base_url: request_url
644
+ }
645
+ promise = @client.make_request_async(:delete, path_template, options)
646
+
647
+ promise = promise.then do |result|
648
+ http_response = result.response
649
+ status_code = http_response.status
650
+ response_content = http_response.body
651
+ unless status_code == 202 || status_code == 204
652
+ error_model = JSON.load(response_content)
653
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
654
+ end
655
+
656
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
657
+
658
+ result
659
+ end
660
+
661
+ promise.execute
662
+ end
663
+
664
+ end
665
+ end