azure_mgmt_netapp 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp.rb +55 -0
  4. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/accounts.rb +597 -0
  5. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +153 -0
  6. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/capacity_pool.rb +154 -0
  7. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  8. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +46 -0
  9. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  10. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/error.rb +57 -0
  11. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  12. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/mount_target.rb +198 -0
  13. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/mount_target_list.rb +55 -0
  14. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/net_app_account.rb +105 -0
  15. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  16. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +46 -0
  17. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  18. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  19. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  20. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  21. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  22. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/snapshot.rb +150 -0
  23. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/snapshot_patch.rb +46 -0
  24. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  25. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/volume.rb +179 -0
  26. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/volume_list.rb +55 -0
  27. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/models/volume_patch.rb +126 -0
  28. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  29. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/mount_targets.rb +128 -0
  30. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/operations.rb +107 -0
  31. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/pools.rb +631 -0
  32. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/snapshots.rb +664 -0
  33. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/volumes.rb +650 -0
  34. data/lib/azure_mgmt_netapp.rb +6 -0
  35. data/lib/module_definition.rb +9 -0
  36. data/lib/profiles/latest/modules/netapp_profile_module.rb +159 -0
  37. data/lib/profiles/latest/netapp_latest_profile_client.rb +40 -0
  38. data/lib/profiles/latest/netapp_module_definition.rb +8 -0
  39. data/lib/version.rb +7 -0
  40. metadata +156 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 43cbf925304e8a4b8c0faaa16ac7c49f4a0ed3fe
4
+ data.tar.gz: 0052051a60b77c1ea53507dd59d0b00eaf9fea5d
5
+ SHA512:
6
+ metadata.gz: 55697257d853e7a9822d6d6e2037cac7420874855d401a7bfea00c1d9cf76b7cc2e8fdd58653f65625fc9fd6170bbbb6bc60ef64085ca45612a011a807e531f5
7
+ data.tar.gz: d53752ea3f2e25b615d821eb9efa798572dc5fd14cc68c9e7910cf2ab5c6ee9ee778f62dda20946e16a9accf78be0b81a7a1d280a2bec02e71c4454f9bf3487e
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,55 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2017-08-15-preview/generated/azure_mgmt_netapp/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::NetApp::Mgmt::V2017_08_15_preview
23
+ autoload :Operations, '2017-08-15-preview/generated/azure_mgmt_netapp/operations.rb'
24
+ autoload :Accounts, '2017-08-15-preview/generated/azure_mgmt_netapp/accounts.rb'
25
+ autoload :Pools, '2017-08-15-preview/generated/azure_mgmt_netapp/pools.rb'
26
+ autoload :Volumes, '2017-08-15-preview/generated/azure_mgmt_netapp/volumes.rb'
27
+ autoload :MountTargets, '2017-08-15-preview/generated/azure_mgmt_netapp/mount_targets.rb'
28
+ autoload :Snapshots, '2017-08-15-preview/generated/azure_mgmt_netapp/snapshots.rb'
29
+ autoload :AzureNetAppFilesManagementClient, '2017-08-15-preview/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb'
30
+
31
+ module Models
32
+ autoload :CapacityPoolList, '2017-08-15-preview/generated/azure_mgmt_netapp/models/capacity_pool_list.rb'
33
+ autoload :CapacityPoolPatch, '2017-08-15-preview/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb'
34
+ autoload :Dimension, '2017-08-15-preview/generated/azure_mgmt_netapp/models/dimension.rb'
35
+ autoload :Volume, '2017-08-15-preview/generated/azure_mgmt_netapp/models/volume.rb'
36
+ autoload :ServiceSpecification, '2017-08-15-preview/generated/azure_mgmt_netapp/models/service_specification.rb'
37
+ autoload :VolumeList, '2017-08-15-preview/generated/azure_mgmt_netapp/models/volume_list.rb'
38
+ autoload :OperationListResult, '2017-08-15-preview/generated/azure_mgmt_netapp/models/operation_list_result.rb'
39
+ autoload :VolumePatch, '2017-08-15-preview/generated/azure_mgmt_netapp/models/volume_patch.rb'
40
+ autoload :NetAppAccountList, '2017-08-15-preview/generated/azure_mgmt_netapp/models/net_app_account_list.rb'
41
+ autoload :MountTarget, '2017-08-15-preview/generated/azure_mgmt_netapp/models/mount_target.rb'
42
+ autoload :CapacityPool, '2017-08-15-preview/generated/azure_mgmt_netapp/models/capacity_pool.rb'
43
+ autoload :MountTargetList, '2017-08-15-preview/generated/azure_mgmt_netapp/models/mount_target_list.rb'
44
+ autoload :MetricSpecification, '2017-08-15-preview/generated/azure_mgmt_netapp/models/metric_specification.rb'
45
+ autoload :Snapshot, '2017-08-15-preview/generated/azure_mgmt_netapp/models/snapshot.rb'
46
+ autoload :NetAppAccount, '2017-08-15-preview/generated/azure_mgmt_netapp/models/net_app_account.rb'
47
+ autoload :SnapshotsList, '2017-08-15-preview/generated/azure_mgmt_netapp/models/snapshots_list.rb'
48
+ autoload :OperationDisplay, '2017-08-15-preview/generated/azure_mgmt_netapp/models/operation_display.rb'
49
+ autoload :SnapshotPatch, '2017-08-15-preview/generated/azure_mgmt_netapp/models/snapshot_patch.rb'
50
+ autoload :NetAppAccountPatch, '2017-08-15-preview/generated/azure_mgmt_netapp/models/net_app_account_patch.rb'
51
+ autoload :Error, '2017-08-15-preview/generated/azure_mgmt_netapp/models/error.rb'
52
+ autoload :Operation, '2017-08-15-preview/generated/azure_mgmt_netapp/models/operation.rb'
53
+ autoload :ServiceLevel, '2017-08-15-preview/generated/azure_mgmt_netapp/models/service_level.rb'
54
+ end
55
+ end
@@ -0,0 +1,597 @@
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::V2017_08_15_preview
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
+ # Lists all NetApp accounts in the resource group
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [NetAppAccountList] operation results.
32
+ #
33
+ def list(resource_group_name, custom_headers:nil)
34
+ response = list_async(resource_group_name, custom_headers:custom_headers).value!
35
+ response.body unless response.nil?
36
+ end
37
+
38
+ #
39
+ # Lists all NetApp accounts in the resource group
40
+ #
41
+ # @param resource_group_name [String] The name of the resource group.
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def list_with_http_info(resource_group_name, custom_headers:nil)
48
+ list_async(resource_group_name, custom_headers:custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Lists all NetApp accounts in the resource group
53
+ #
54
+ # @param resource_group_name [String] The name of the resource group.
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def list_async(resource_group_name, custom_headers:nil)
61
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
62
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
63
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
64
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
65
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
66
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
67
+
68
+
69
+ request_headers = {}
70
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
71
+
72
+ # Set Headers
73
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
74
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
75
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts'
76
+
77
+ request_url = @base_url || @client.base_url
78
+
79
+ options = {
80
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
81
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
82
+ query_params: {'api-version' => @client.api_version},
83
+ headers: request_headers.merge(custom_headers || {}),
84
+ base_url: request_url
85
+ }
86
+ promise = @client.make_request_async(:get, path_template, options)
87
+
88
+ promise = promise.then do |result|
89
+ http_response = result.response
90
+ status_code = http_response.status
91
+ response_content = http_response.body
92
+ unless status_code == 200
93
+ error_model = JSON.load(response_content)
94
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
95
+ end
96
+
97
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
98
+ # Deserialize Response
99
+ if status_code == 200
100
+ begin
101
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
102
+ result_mapper = Azure::NetApp::Mgmt::V2017_08_15_preview::Models::NetAppAccountList.mapper()
103
+ result.body = @client.deserialize(result_mapper, parsed_response)
104
+ rescue Exception => e
105
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
106
+ end
107
+ end
108
+
109
+ result
110
+ end
111
+
112
+ promise.execute
113
+ end
114
+
115
+ #
116
+ # Get the NetApp account
117
+ #
118
+ # @param resource_group_name [String] The name of the resource group.
119
+ # @param account_name [String] The name of the NetApp account
120
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
121
+ # will be added to the HTTP request.
122
+ #
123
+ # @return [NetAppAccount] operation results.
124
+ #
125
+ def get(resource_group_name, account_name, custom_headers:nil)
126
+ response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value!
127
+ response.body unless response.nil?
128
+ end
129
+
130
+ #
131
+ # Get the NetApp account
132
+ #
133
+ # @param resource_group_name [String] The name of the resource group.
134
+ # @param account_name [String] The name of the NetApp account
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
139
+ #
140
+ def get_with_http_info(resource_group_name, account_name, custom_headers:nil)
141
+ get_async(resource_group_name, account_name, custom_headers:custom_headers).value!
142
+ end
143
+
144
+ #
145
+ # Get the NetApp account
146
+ #
147
+ # @param resource_group_name [String] The name of the resource group.
148
+ # @param account_name [String] The name of the NetApp account
149
+ # @param [Hash{String => String}] A hash of custom headers that will be added
150
+ # to the HTTP request.
151
+ #
152
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
153
+ #
154
+ def get_async(resource_group_name, account_name, custom_headers:nil)
155
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
156
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
157
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
158
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
159
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
160
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
161
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
162
+
163
+
164
+ request_headers = {}
165
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
166
+
167
+ # Set Headers
168
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
169
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
170
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
171
+
172
+ request_url = @base_url || @client.base_url
173
+
174
+ options = {
175
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
176
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
177
+ query_params: {'api-version' => @client.api_version},
178
+ headers: request_headers.merge(custom_headers || {}),
179
+ base_url: request_url
180
+ }
181
+ promise = @client.make_request_async(:get, path_template, options)
182
+
183
+ promise = promise.then do |result|
184
+ http_response = result.response
185
+ status_code = http_response.status
186
+ response_content = http_response.body
187
+ unless status_code == 200
188
+ error_model = JSON.load(response_content)
189
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
190
+ end
191
+
192
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
193
+ # Deserialize Response
194
+ if status_code == 200
195
+ begin
196
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
197
+ result_mapper = Azure::NetApp::Mgmt::V2017_08_15_preview::Models::NetAppAccount.mapper()
198
+ result.body = @client.deserialize(result_mapper, parsed_response)
199
+ rescue Exception => e
200
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
201
+ end
202
+ end
203
+
204
+ result
205
+ end
206
+
207
+ promise.execute
208
+ end
209
+
210
+ #
211
+ # Create or update a NetApp account
212
+ #
213
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
214
+ # operation.
215
+ # @param resource_group_name [String] The name of the resource group.
216
+ # @param account_name [String] The name of the NetApp account
217
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
218
+ # will be added to the HTTP request.
219
+ #
220
+ # @return [NetAppAccount] operation results.
221
+ #
222
+ def create_or_update(body, resource_group_name, account_name, custom_headers:nil)
223
+ response = create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
224
+ response.body unless response.nil?
225
+ end
226
+
227
+ #
228
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
229
+ # operation.
230
+ # @param resource_group_name [String] The name of the resource group.
231
+ # @param account_name [String] The name of the NetApp account
232
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
233
+ # will be added to the HTTP request.
234
+ #
235
+ # @return [Concurrent::Promise] promise which provides async access to http
236
+ # response.
237
+ #
238
+ def create_or_update_async(body, resource_group_name, account_name, custom_headers:nil)
239
+ # Send request
240
+ promise = begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers)
241
+
242
+ promise = promise.then do |response|
243
+ # Defining deserialization method.
244
+ deserialize_method = lambda do |parsed_response|
245
+ result_mapper = Azure::NetApp::Mgmt::V2017_08_15_preview::Models::NetAppAccount.mapper()
246
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
247
+ end
248
+
249
+ # Waiting for response.
250
+ @client.get_long_running_operation_result(response, deserialize_method)
251
+ end
252
+
253
+ promise
254
+ end
255
+
256
+ #
257
+ # Delete a NetApp account
258
+ #
259
+ # @param resource_group_name [String] The name of the resource group.
260
+ # @param account_name [String] The name of the NetApp account
261
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
262
+ # will be added to the HTTP request.
263
+ #
264
+ def delete(resource_group_name, account_name, custom_headers:nil)
265
+ response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
266
+ nil
267
+ end
268
+
269
+ #
270
+ # @param resource_group_name [String] The name of the resource group.
271
+ # @param account_name [String] The name of the NetApp account
272
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
273
+ # will be added to the HTTP request.
274
+ #
275
+ # @return [Concurrent::Promise] promise which provides async access to http
276
+ # response.
277
+ #
278
+ def delete_async(resource_group_name, account_name, custom_headers:nil)
279
+ # Send request
280
+ promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers)
281
+
282
+ promise = promise.then do |response|
283
+ # Defining deserialization method.
284
+ deserialize_method = lambda do |parsed_response|
285
+ end
286
+
287
+ # Waiting for response.
288
+ @client.get_long_running_operation_result(response, deserialize_method)
289
+ end
290
+
291
+ promise
292
+ end
293
+
294
+ #
295
+ # Patch a NetApp account
296
+ #
297
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
298
+ # of the operation.
299
+ # @param resource_group_name [String] The name of the resource group.
300
+ # @param account_name [String] The name of the NetApp account
301
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
302
+ # will be added to the HTTP request.
303
+ #
304
+ # @return [NetAppAccount] operation results.
305
+ #
306
+ def update(body, resource_group_name, account_name, custom_headers:nil)
307
+ response = update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
308
+ response.body unless response.nil?
309
+ end
310
+
311
+ #
312
+ # Patch a NetApp account
313
+ #
314
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
315
+ # of the operation.
316
+ # @param resource_group_name [String] The name of the resource group.
317
+ # @param account_name [String] The name of the NetApp account
318
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
319
+ # will be added to the HTTP request.
320
+ #
321
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
322
+ #
323
+ def update_with_http_info(body, resource_group_name, account_name, custom_headers:nil)
324
+ update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
325
+ end
326
+
327
+ #
328
+ # Patch a NetApp account
329
+ #
330
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
331
+ # of the operation.
332
+ # @param resource_group_name [String] The name of the resource group.
333
+ # @param account_name [String] The name of the NetApp account
334
+ # @param [Hash{String => String}] A hash of custom headers that will be added
335
+ # to the HTTP request.
336
+ #
337
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
338
+ #
339
+ def update_async(body, resource_group_name, account_name, custom_headers:nil)
340
+ fail ArgumentError, 'body is nil' if body.nil?
341
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
342
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
343
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
344
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
345
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
346
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
347
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
348
+
349
+
350
+ request_headers = {}
351
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
352
+
353
+ # Set Headers
354
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
355
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
356
+
357
+ # Serialize Request
358
+ request_mapper = Azure::NetApp::Mgmt::V2017_08_15_preview::Models::NetAppAccountPatch.mapper()
359
+ request_content = @client.serialize(request_mapper, body)
360
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
361
+
362
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
363
+
364
+ request_url = @base_url || @client.base_url
365
+
366
+ options = {
367
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
368
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
369
+ query_params: {'api-version' => @client.api_version},
370
+ body: request_content,
371
+ headers: request_headers.merge(custom_headers || {}),
372
+ base_url: request_url
373
+ }
374
+ promise = @client.make_request_async(:patch, path_template, options)
375
+
376
+ promise = promise.then do |result|
377
+ http_response = result.response
378
+ status_code = http_response.status
379
+ response_content = http_response.body
380
+ unless status_code == 200
381
+ error_model = JSON.load(response_content)
382
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
383
+ end
384
+
385
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
386
+ # Deserialize Response
387
+ if status_code == 200
388
+ begin
389
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
390
+ result_mapper = Azure::NetApp::Mgmt::V2017_08_15_preview::Models::NetAppAccount.mapper()
391
+ result.body = @client.deserialize(result_mapper, parsed_response)
392
+ rescue Exception => e
393
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
394
+ end
395
+ end
396
+
397
+ result
398
+ end
399
+
400
+ promise.execute
401
+ end
402
+
403
+ #
404
+ # Create or update a NetApp account
405
+ #
406
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
407
+ # operation.
408
+ # @param resource_group_name [String] The name of the resource group.
409
+ # @param account_name [String] The name of the NetApp account
410
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
411
+ # will be added to the HTTP request.
412
+ #
413
+ # @return [NetAppAccount] operation results.
414
+ #
415
+ def begin_create_or_update(body, resource_group_name, account_name, custom_headers:nil)
416
+ response = begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
417
+ response.body unless response.nil?
418
+ end
419
+
420
+ #
421
+ # Create or update a NetApp account
422
+ #
423
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
424
+ # operation.
425
+ # @param resource_group_name [String] The name of the resource group.
426
+ # @param account_name [String] The name of the NetApp account
427
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
428
+ # will be added to the HTTP request.
429
+ #
430
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
431
+ #
432
+ def begin_create_or_update_with_http_info(body, resource_group_name, account_name, custom_headers:nil)
433
+ begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
434
+ end
435
+
436
+ #
437
+ # Create or update a NetApp account
438
+ #
439
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
440
+ # operation.
441
+ # @param resource_group_name [String] The name of the resource group.
442
+ # @param account_name [String] The name of the NetApp account
443
+ # @param [Hash{String => String}] A hash of custom headers that will be added
444
+ # to the HTTP request.
445
+ #
446
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
447
+ #
448
+ def begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:nil)
449
+ fail ArgumentError, 'body is nil' if body.nil?
450
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
451
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
452
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
453
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
454
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
455
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
456
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
457
+
458
+
459
+ request_headers = {}
460
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
461
+
462
+ # Set Headers
463
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
464
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
465
+
466
+ # Serialize Request
467
+ request_mapper = Azure::NetApp::Mgmt::V2017_08_15_preview::Models::NetAppAccount.mapper()
468
+ request_content = @client.serialize(request_mapper, body)
469
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
470
+
471
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
472
+
473
+ request_url = @base_url || @client.base_url
474
+
475
+ options = {
476
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
477
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
478
+ query_params: {'api-version' => @client.api_version},
479
+ body: request_content,
480
+ headers: request_headers.merge(custom_headers || {}),
481
+ base_url: request_url
482
+ }
483
+ promise = @client.make_request_async(:put, path_template, options)
484
+
485
+ promise = promise.then do |result|
486
+ http_response = result.response
487
+ status_code = http_response.status
488
+ response_content = http_response.body
489
+ unless status_code == 201 || status_code == 202
490
+ error_model = JSON.load(response_content)
491
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
492
+ end
493
+
494
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
495
+ # Deserialize Response
496
+ if status_code == 201
497
+ begin
498
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
499
+ result_mapper = Azure::NetApp::Mgmt::V2017_08_15_preview::Models::NetAppAccount.mapper()
500
+ result.body = @client.deserialize(result_mapper, parsed_response)
501
+ rescue Exception => e
502
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
503
+ end
504
+ end
505
+
506
+ result
507
+ end
508
+
509
+ promise.execute
510
+ end
511
+
512
+ #
513
+ # Delete a NetApp account
514
+ #
515
+ # @param resource_group_name [String] The name of the resource group.
516
+ # @param account_name [String] The name of the NetApp account
517
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
518
+ # will be added to the HTTP request.
519
+ #
520
+ #
521
+ def begin_delete(resource_group_name, account_name, custom_headers:nil)
522
+ response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
523
+ nil
524
+ end
525
+
526
+ #
527
+ # Delete a NetApp account
528
+ #
529
+ # @param resource_group_name [String] The name of the resource group.
530
+ # @param account_name [String] The name of the NetApp account
531
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
532
+ # will be added to the HTTP request.
533
+ #
534
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
535
+ #
536
+ def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil)
537
+ begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
538
+ end
539
+
540
+ #
541
+ # Delete a NetApp account
542
+ #
543
+ # @param resource_group_name [String] The name of the resource group.
544
+ # @param account_name [String] The name of the NetApp account
545
+ # @param [Hash{String => String}] A hash of custom headers that will be added
546
+ # to the HTTP request.
547
+ #
548
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
549
+ #
550
+ def begin_delete_async(resource_group_name, account_name, custom_headers:nil)
551
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
552
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
553
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
554
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
555
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
556
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
557
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
558
+
559
+
560
+ request_headers = {}
561
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
562
+
563
+ # Set Headers
564
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
565
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
566
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
567
+
568
+ request_url = @base_url || @client.base_url
569
+
570
+ options = {
571
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
572
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
573
+ query_params: {'api-version' => @client.api_version},
574
+ headers: request_headers.merge(custom_headers || {}),
575
+ base_url: request_url
576
+ }
577
+ promise = @client.make_request_async(:delete, path_template, options)
578
+
579
+ promise = promise.then do |result|
580
+ http_response = result.response
581
+ status_code = http_response.status
582
+ response_content = http_response.body
583
+ unless status_code == 202 || status_code == 204
584
+ error_model = JSON.load(response_content)
585
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
586
+ end
587
+
588
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
589
+
590
+ result
591
+ end
592
+
593
+ promise.execute
594
+ end
595
+
596
+ end
597
+ end