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