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