azure_mgmt_netapp 0.18.1 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  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/azure_net_app_files_management_client.rb +1 -1
  4. data/lib/2019-06-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  5. data/lib/2019-07-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  6. data/lib/2019-08-01/generated/azure_mgmt_netapp.rb +65 -0
  7. data/lib/2019-08-01/generated/azure_mgmt_netapp/accounts.rb +651 -0
  8. data/lib/2019-08-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +157 -0
  9. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/active_directory.rb +127 -0
  10. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/capacity_pool.rb +161 -0
  11. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  12. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +133 -0
  13. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb +18 -0
  14. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  15. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb +113 -0
  16. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb +16 -0
  17. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  18. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/mount_target.rb +230 -0
  19. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/mount_target_list.rb +55 -0
  20. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/net_app_account.rb +133 -0
  21. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  22. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +133 -0
  23. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  24. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  25. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  26. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/replication_object.rb +81 -0
  27. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/resource_name_availability.rb +78 -0
  28. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb +72 -0
  29. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  30. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  31. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/snapshot.rb +158 -0
  32. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/snapshot_patch.rb +54 -0
  33. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  34. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/volume.rb +289 -0
  35. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/volume_list.rb +55 -0
  36. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/volume_patch.rb +147 -0
  37. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb +58 -0
  38. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/volume_properties_data_protection.rb +49 -0
  39. data/lib/2019-08-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb +58 -0
  40. data/lib/2019-08-01/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  41. data/lib/2019-08-01/generated/azure_mgmt_netapp/mount_targets.rb +136 -0
  42. data/lib/2019-08-01/generated/azure_mgmt_netapp/net_app_resource.rb +291 -0
  43. data/lib/2019-08-01/generated/azure_mgmt_netapp/operations.rb +115 -0
  44. data/lib/2019-08-01/generated/azure_mgmt_netapp/pools.rb +675 -0
  45. data/lib/2019-08-01/generated/azure_mgmt_netapp/snapshots.rb +708 -0
  46. data/lib/2019-08-01/generated/azure_mgmt_netapp/volumes.rb +694 -0
  47. data/lib/2019-10-01/generated/azure_mgmt_netapp.rb +71 -0
  48. data/lib/2019-10-01/generated/azure_mgmt_netapp/accounts.rb +651 -0
  49. data/lib/2019-10-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +157 -0
  50. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/active_directory.rb +127 -0
  51. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/authorize_request.rb +46 -0
  52. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/capacity_pool.rb +161 -0
  53. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  54. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +133 -0
  55. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb +18 -0
  56. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  57. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/endpoint_type.rb +16 -0
  58. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb +113 -0
  59. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb +16 -0
  60. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  61. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/mirror_state.rb +17 -0
  62. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/mount_target.rb +230 -0
  63. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/mount_target_list.rb +55 -0
  64. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/net_app_account.rb +133 -0
  65. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  66. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +133 -0
  67. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  68. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  69. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  70. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/relationship_status.rb +16 -0
  71. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/replication_object.rb +94 -0
  72. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/replication_schedule.rb +19 -0
  73. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/replication_status.rb +93 -0
  74. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/resource_name_availability.rb +78 -0
  75. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb +72 -0
  76. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  77. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  78. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/snapshot.rb +158 -0
  79. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/snapshot_patch.rb +54 -0
  80. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  81. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume.rb +300 -0
  82. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume_list.rb +55 -0
  83. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume_patch.rb +147 -0
  84. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb +58 -0
  85. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume_properties_data_protection.rb +50 -0
  86. data/lib/2019-10-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb +58 -0
  87. data/lib/2019-10-01/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  88. data/lib/2019-10-01/generated/azure_mgmt_netapp/mount_targets.rb +136 -0
  89. data/lib/2019-10-01/generated/azure_mgmt_netapp/net_app_resource.rb +291 -0
  90. data/lib/2019-10-01/generated/azure_mgmt_netapp/operations.rb +115 -0
  91. data/lib/2019-10-01/generated/azure_mgmt_netapp/pools.rb +675 -0
  92. data/lib/2019-10-01/generated/azure_mgmt_netapp/snapshots.rb +708 -0
  93. data/lib/2019-10-01/generated/azure_mgmt_netapp/volumes.rb +1228 -0
  94. data/lib/2019-11-01/generated/azure_mgmt_netapp.rb +70 -0
  95. data/lib/2019-11-01/generated/azure_mgmt_netapp/accounts.rb +651 -0
  96. data/lib/2019-11-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +153 -0
  97. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/active_directory.rb +139 -0
  98. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/authorize_request.rb +46 -0
  99. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/capacity_pool.rb +161 -0
  100. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  101. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +133 -0
  102. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb +18 -0
  103. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  104. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/endpoint_type.rb +16 -0
  105. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb +113 -0
  106. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb +16 -0
  107. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  108. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/mirror_state.rb +17 -0
  109. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/mount_target.rb +218 -0
  110. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/mount_target_properties.rb +152 -0
  111. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/net_app_account.rb +133 -0
  112. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  113. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +133 -0
  114. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  115. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  116. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  117. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/relationship_status.rb +16 -0
  118. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/replication_object.rb +94 -0
  119. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/replication_schedule.rb +19 -0
  120. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/replication_status.rb +93 -0
  121. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/resource_name_availability.rb +78 -0
  122. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb +72 -0
  123. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  124. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  125. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/snapshot.rb +139 -0
  126. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  127. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume.rb +315 -0
  128. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_list.rb +55 -0
  129. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_patch.rb +147 -0
  130. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb +58 -0
  131. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_properties_data_protection.rb +50 -0
  132. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb +58 -0
  133. data/lib/2019-11-01/generated/azure_mgmt_netapp/models/volume_revert.rb +46 -0
  134. data/lib/2019-11-01/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  135. data/lib/2019-11-01/generated/azure_mgmt_netapp/net_app_resource.rb +291 -0
  136. data/lib/2019-11-01/generated/azure_mgmt_netapp/operations.rb +115 -0
  137. data/lib/2019-11-01/generated/azure_mgmt_netapp/pools.rb +737 -0
  138. data/lib/2019-11-01/generated/azure_mgmt_netapp/snapshots.rb +794 -0
  139. data/lib/2019-11-01/generated/azure_mgmt_netapp/volumes.rb +1688 -0
  140. data/lib/azure_mgmt_netapp.rb +3 -0
  141. data/lib/profiles/latest/modules/netapp_profile_module.rb +113 -81
  142. data/lib/version.rb +1 -1
  143. metadata +138 -4
@@ -0,0 +1,1228 @@
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_10_01
7
+ #
8
+ # Microsoft NetApp Azure Resource Provider specification
9
+ #
10
+ class Volumes
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Volumes 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 volumes
26
+ #
27
+ # List all volumes within the capacity pool
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group.
30
+ # @param account_name [String] The name of the NetApp account
31
+ # @param pool_name [String] The name of the capacity pool
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [VolumeList] operation results.
36
+ #
37
+ def list(resource_group_name, account_name, pool_name, custom_headers:nil)
38
+ response = list_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Describe all volumes
44
+ #
45
+ # List all volumes within the capacity pool
46
+ #
47
+ # @param resource_group_name [String] The name of the resource group.
48
+ # @param account_name [String] The name of the NetApp account
49
+ # @param pool_name [String] The name of the capacity pool
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def list_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
56
+ list_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Describe all volumes
61
+ #
62
+ # List all volumes within the capacity pool
63
+ #
64
+ # @param resource_group_name [String] The name of the resource group.
65
+ # @param account_name [String] The name of the NetApp account
66
+ # @param pool_name [String] The name of the capacity pool
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def list_async(resource_group_name, account_name, pool_name, custom_headers:nil)
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
75
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
76
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
77
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
78
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
79
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
80
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
81
+
82
+
83
+ request_headers = {}
84
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
85
+
86
+ # Set Headers
87
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes'
90
+
91
+ request_url = @base_url || @client.base_url
92
+
93
+ options = {
94
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
95
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name},
96
+ query_params: {'api-version' => @client.api_version},
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:get, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 200
107
+ error_model = JSON.load(response_content)
108
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
113
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
114
+ # Deserialize Response
115
+ if status_code == 200
116
+ begin
117
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
118
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::VolumeList.mapper()
119
+ result.body = @client.deserialize(result_mapper, parsed_response)
120
+ rescue Exception => e
121
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
122
+ end
123
+ end
124
+
125
+ result
126
+ end
127
+
128
+ promise.execute
129
+ end
130
+
131
+ #
132
+ # Describe a volume
133
+ #
134
+ # Get the details of the specified volume
135
+ #
136
+ # @param resource_group_name [String] The name of the resource group.
137
+ # @param account_name [String] The name of the NetApp account
138
+ # @param pool_name [String] The name of the capacity pool
139
+ # @param volume_name [String] The name of the volume
140
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
+ # will be added to the HTTP request.
142
+ #
143
+ # @return [Volume] operation results.
144
+ #
145
+ def get(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
146
+ response = get_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
147
+ response.body unless response.nil?
148
+ end
149
+
150
+ #
151
+ # Describe a volume
152
+ #
153
+ # Get the details of the specified volume
154
+ #
155
+ # @param resource_group_name [String] The name of the resource group.
156
+ # @param account_name [String] The name of the NetApp account
157
+ # @param pool_name [String] The name of the capacity pool
158
+ # @param volume_name [String] The name of the volume
159
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
160
+ # will be added to the HTTP request.
161
+ #
162
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
163
+ #
164
+ def get_with_http_info(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
165
+ get_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
166
+ end
167
+
168
+ #
169
+ # Describe a volume
170
+ #
171
+ # Get the details of the specified volume
172
+ #
173
+ # @param resource_group_name [String] The name of the resource group.
174
+ # @param account_name [String] The name of the NetApp account
175
+ # @param pool_name [String] The name of the capacity pool
176
+ # @param volume_name [String] The name of the volume
177
+ # @param [Hash{String => String}] A hash of custom headers that will be added
178
+ # to the HTTP request.
179
+ #
180
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
181
+ #
182
+ def get_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
183
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
184
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
185
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
186
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
187
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
188
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
189
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
190
+ fail ArgumentError, 'volume_name is nil' if volume_name.nil?
191
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
192
+
193
+
194
+ request_headers = {}
195
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
196
+
197
+ # Set Headers
198
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
199
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
200
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'
201
+
202
+ request_url = @base_url || @client.base_url
203
+
204
+ options = {
205
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
206
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name,'volumeName' => volume_name},
207
+ query_params: {'api-version' => @client.api_version},
208
+ headers: request_headers.merge(custom_headers || {}),
209
+ base_url: request_url
210
+ }
211
+ promise = @client.make_request_async(:get, path_template, options)
212
+
213
+ promise = promise.then do |result|
214
+ http_response = result.response
215
+ status_code = http_response.status
216
+ response_content = http_response.body
217
+ unless status_code == 200
218
+ error_model = JSON.load(response_content)
219
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
220
+ end
221
+
222
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
223
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
224
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
225
+ # Deserialize Response
226
+ if status_code == 200
227
+ begin
228
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
229
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::Volume.mapper()
230
+ result.body = @client.deserialize(result_mapper, parsed_response)
231
+ rescue Exception => e
232
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
233
+ end
234
+ end
235
+
236
+ result
237
+ end
238
+
239
+ promise.execute
240
+ end
241
+
242
+ #
243
+ # Create or Update a volume
244
+ #
245
+ # Create or update the specified volume within the capacity pool
246
+ #
247
+ # @param body [Volume] Volume object supplied in the body of the operation.
248
+ # @param resource_group_name [String] The name of the resource group.
249
+ # @param account_name [String] The name of the NetApp account
250
+ # @param pool_name [String] The name of the capacity pool
251
+ # @param volume_name [String] The name of the volume
252
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
253
+ # will be added to the HTTP request.
254
+ #
255
+ # @return [Volume] operation results.
256
+ #
257
+ def create_or_update(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
258
+ response = create_or_update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
259
+ response.body unless response.nil?
260
+ end
261
+
262
+ #
263
+ # @param body [Volume] Volume object supplied in the body of the operation.
264
+ # @param resource_group_name [String] The name of the resource group.
265
+ # @param account_name [String] The name of the NetApp account
266
+ # @param pool_name [String] The name of the capacity pool
267
+ # @param volume_name [String] The name of the volume
268
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
269
+ # will be added to the HTTP request.
270
+ #
271
+ # @return [Concurrent::Promise] promise which provides async access to http
272
+ # response.
273
+ #
274
+ def create_or_update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
275
+ # Send request
276
+ promise = begin_create_or_update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers)
277
+
278
+ promise = promise.then do |response|
279
+ # Defining deserialization method.
280
+ deserialize_method = lambda do |parsed_response|
281
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::Volume.mapper()
282
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
283
+ end
284
+
285
+ # Waiting for response.
286
+ @client.get_long_running_operation_result(response, deserialize_method)
287
+ end
288
+
289
+ promise
290
+ end
291
+
292
+ #
293
+ # Update a volume
294
+ #
295
+ # Patch the specified volume
296
+ #
297
+ # @param body [VolumePatch] Volume object supplied in the body of the
298
+ # 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 pool_name [String] The name of the capacity pool
302
+ # @param volume_name [String] The name of the volume
303
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
304
+ # will be added to the HTTP request.
305
+ #
306
+ # @return [Volume] operation results.
307
+ #
308
+ def update(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
309
+ response = update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
310
+ response.body unless response.nil?
311
+ end
312
+
313
+ #
314
+ # Update a volume
315
+ #
316
+ # Patch the specified volume
317
+ #
318
+ # @param body [VolumePatch] Volume object supplied in the body of the
319
+ # operation.
320
+ # @param resource_group_name [String] The name of the resource group.
321
+ # @param account_name [String] The name of the NetApp account
322
+ # @param pool_name [String] The name of the capacity pool
323
+ # @param volume_name [String] The name of the volume
324
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
325
+ # will be added to the HTTP request.
326
+ #
327
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
328
+ #
329
+ def update_with_http_info(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
330
+ update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
331
+ end
332
+
333
+ #
334
+ # Update a volume
335
+ #
336
+ # Patch the specified volume
337
+ #
338
+ # @param body [VolumePatch] Volume object supplied in the body of the
339
+ # operation.
340
+ # @param resource_group_name [String] The name of the resource group.
341
+ # @param account_name [String] The name of the NetApp account
342
+ # @param pool_name [String] The name of the capacity pool
343
+ # @param volume_name [String] The name of the volume
344
+ # @param [Hash{String => String}] A hash of custom headers that will be added
345
+ # to the HTTP request.
346
+ #
347
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
348
+ #
349
+ def update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
350
+ fail ArgumentError, 'body is nil' if body.nil?
351
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
352
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
353
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
354
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
355
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
356
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
357
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
358
+ fail ArgumentError, 'volume_name is nil' if volume_name.nil?
359
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
360
+
361
+
362
+ request_headers = {}
363
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
364
+
365
+ # Set Headers
366
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
367
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
368
+
369
+ # Serialize Request
370
+ request_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::VolumePatch.mapper()
371
+ request_content = @client.serialize(request_mapper, body)
372
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
373
+
374
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'
375
+
376
+ request_url = @base_url || @client.base_url
377
+
378
+ options = {
379
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
380
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name,'volumeName' => volume_name},
381
+ query_params: {'api-version' => @client.api_version},
382
+ body: request_content,
383
+ headers: request_headers.merge(custom_headers || {}),
384
+ base_url: request_url
385
+ }
386
+ promise = @client.make_request_async(:patch, path_template, options)
387
+
388
+ promise = promise.then do |result|
389
+ http_response = result.response
390
+ status_code = http_response.status
391
+ response_content = http_response.body
392
+ unless status_code == 200 || status_code == 202
393
+ error_model = JSON.load(response_content)
394
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
395
+ end
396
+
397
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
398
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
399
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
400
+ # Deserialize Response
401
+ if status_code == 200
402
+ begin
403
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
404
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::Volume.mapper()
405
+ result.body = @client.deserialize(result_mapper, parsed_response)
406
+ rescue Exception => e
407
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
408
+ end
409
+ end
410
+
411
+ result
412
+ end
413
+
414
+ promise.execute
415
+ end
416
+
417
+ #
418
+ # Delete a volume
419
+ #
420
+ # Delete the specified volume
421
+ #
422
+ # @param resource_group_name [String] The name of the resource group.
423
+ # @param account_name [String] The name of the NetApp account
424
+ # @param pool_name [String] The name of the capacity pool
425
+ # @param volume_name [String] The name of the volume
426
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
427
+ # will be added to the HTTP request.
428
+ #
429
+ def delete(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
430
+ response = delete_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
431
+ nil
432
+ end
433
+
434
+ #
435
+ # @param resource_group_name [String] The name of the resource group.
436
+ # @param account_name [String] The name of the NetApp account
437
+ # @param pool_name [String] The name of the capacity pool
438
+ # @param volume_name [String] The name of the volume
439
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
440
+ # will be added to the HTTP request.
441
+ #
442
+ # @return [Concurrent::Promise] promise which provides async access to http
443
+ # response.
444
+ #
445
+ def delete_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
446
+ # Send request
447
+ promise = begin_delete_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers)
448
+
449
+ promise = promise.then do |response|
450
+ # Defining deserialization method.
451
+ deserialize_method = lambda do |parsed_response|
452
+ end
453
+
454
+ # Waiting for response.
455
+ @client.get_long_running_operation_result(response, deserialize_method)
456
+ end
457
+
458
+ promise
459
+ end
460
+
461
+ #
462
+ # Break volume replication
463
+ #
464
+ # Break the replication connection on the destination volume
465
+ #
466
+ # @param resource_group_name [String] The name of the resource group.
467
+ # @param account_name [String] The name of the NetApp account
468
+ # @param pool_name [String] The name of the capacity pool
469
+ # @param volume_name [String] The name of the volume
470
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
471
+ # will be added to the HTTP request.
472
+ #
473
+ #
474
+ def break_replication(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
475
+ response = break_replication_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
476
+ nil
477
+ end
478
+
479
+ #
480
+ # Break volume replication
481
+ #
482
+ # Break the replication connection on the destination volume
483
+ #
484
+ # @param resource_group_name [String] The name of the resource group.
485
+ # @param account_name [String] The name of the NetApp account
486
+ # @param pool_name [String] The name of the capacity pool
487
+ # @param volume_name [String] The name of the volume
488
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
489
+ # will be added to the HTTP request.
490
+ #
491
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
492
+ #
493
+ def break_replication_with_http_info(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
494
+ break_replication_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
495
+ end
496
+
497
+ #
498
+ # Break volume replication
499
+ #
500
+ # Break the replication connection on the destination volume
501
+ #
502
+ # @param resource_group_name [String] The name of the resource group.
503
+ # @param account_name [String] The name of the NetApp account
504
+ # @param pool_name [String] The name of the capacity pool
505
+ # @param volume_name [String] The name of the volume
506
+ # @param [Hash{String => String}] A hash of custom headers that will be added
507
+ # to the HTTP request.
508
+ #
509
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
510
+ #
511
+ def break_replication_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
512
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
513
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
514
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
515
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
516
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
517
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
518
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
519
+ fail ArgumentError, 'volume_name is nil' if volume_name.nil?
520
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
521
+
522
+
523
+ request_headers = {}
524
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
525
+
526
+ # Set Headers
527
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
528
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
529
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication'
530
+
531
+ request_url = @base_url || @client.base_url
532
+
533
+ options = {
534
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
535
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name,'volumeName' => volume_name},
536
+ query_params: {'api-version' => @client.api_version},
537
+ headers: request_headers.merge(custom_headers || {}),
538
+ base_url: request_url
539
+ }
540
+ promise = @client.make_request_async(:post, path_template, options)
541
+
542
+ promise = promise.then do |result|
543
+ http_response = result.response
544
+ status_code = http_response.status
545
+ response_content = http_response.body
546
+ unless status_code == 202
547
+ error_model = JSON.load(response_content)
548
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
549
+ end
550
+
551
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
552
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
553
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
554
+
555
+ result
556
+ end
557
+
558
+ promise.execute
559
+ end
560
+
561
+ #
562
+ # Get volume replication status
563
+ #
564
+ # Get the status of the replication
565
+ #
566
+ # @param resource_group_name [String] The name of the resource group.
567
+ # @param account_name [String] The name of the NetApp account
568
+ # @param pool_name [String] The name of the capacity pool
569
+ # @param volume_name [String] The name of the volume
570
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
571
+ # will be added to the HTTP request.
572
+ #
573
+ # @return [ReplicationStatus] operation results.
574
+ #
575
+ def replication_status_method(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
576
+ response = replication_status_method_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
577
+ response.body unless response.nil?
578
+ end
579
+
580
+ #
581
+ # Get volume replication status
582
+ #
583
+ # Get the status of the replication
584
+ #
585
+ # @param resource_group_name [String] The name of the resource group.
586
+ # @param account_name [String] The name of the NetApp account
587
+ # @param pool_name [String] The name of the capacity pool
588
+ # @param volume_name [String] The name of the volume
589
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
590
+ # will be added to the HTTP request.
591
+ #
592
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
593
+ #
594
+ def replication_status_method_with_http_info(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
595
+ replication_status_method_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
596
+ end
597
+
598
+ #
599
+ # Get volume replication status
600
+ #
601
+ # Get the status of the replication
602
+ #
603
+ # @param resource_group_name [String] The name of the resource group.
604
+ # @param account_name [String] The name of the NetApp account
605
+ # @param pool_name [String] The name of the capacity pool
606
+ # @param volume_name [String] The name of the volume
607
+ # @param [Hash{String => String}] A hash of custom headers that will be added
608
+ # to the HTTP request.
609
+ #
610
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
611
+ #
612
+ def replication_status_method_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
613
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
614
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
615
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
616
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
617
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
618
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
619
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
620
+ fail ArgumentError, 'volume_name is nil' if volume_name.nil?
621
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
622
+
623
+
624
+ request_headers = {}
625
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
626
+
627
+ # Set Headers
628
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
629
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
630
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus'
631
+
632
+ request_url = @base_url || @client.base_url
633
+
634
+ options = {
635
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
636
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name,'volumeName' => volume_name},
637
+ query_params: {'api-version' => @client.api_version},
638
+ headers: request_headers.merge(custom_headers || {}),
639
+ base_url: request_url
640
+ }
641
+ promise = @client.make_request_async(:get, path_template, options)
642
+
643
+ promise = promise.then do |result|
644
+ http_response = result.response
645
+ status_code = http_response.status
646
+ response_content = http_response.body
647
+ unless status_code == 200
648
+ error_model = JSON.load(response_content)
649
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
650
+ end
651
+
652
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
653
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
654
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
655
+ # Deserialize Response
656
+ if status_code == 200
657
+ begin
658
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
659
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::ReplicationStatus.mapper()
660
+ result.body = @client.deserialize(result_mapper, parsed_response)
661
+ rescue Exception => e
662
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
663
+ end
664
+ end
665
+
666
+ result
667
+ end
668
+
669
+ promise.execute
670
+ end
671
+
672
+ #
673
+ # Resync volume replication
674
+ #
675
+ # Resync the connection on the destination volume. If the operation is ran on
676
+ # the source volume it will reverse-resync the connection and sync from source
677
+ # to destination.
678
+ #
679
+ # @param resource_group_name [String] The name of the resource group.
680
+ # @param account_name [String] The name of the NetApp account
681
+ # @param pool_name [String] The name of the capacity pool
682
+ # @param volume_name [String] The name of the volume
683
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
684
+ # will be added to the HTTP request.
685
+ #
686
+ #
687
+ def resync_replication(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
688
+ response = resync_replication_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
689
+ nil
690
+ end
691
+
692
+ #
693
+ # Resync volume replication
694
+ #
695
+ # Resync the connection on the destination volume. If the operation is ran on
696
+ # the source volume it will reverse-resync the connection and sync from source
697
+ # to destination.
698
+ #
699
+ # @param resource_group_name [String] The name of the resource group.
700
+ # @param account_name [String] The name of the NetApp account
701
+ # @param pool_name [String] The name of the capacity pool
702
+ # @param volume_name [String] The name of the volume
703
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
704
+ # will be added to the HTTP request.
705
+ #
706
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
707
+ #
708
+ def resync_replication_with_http_info(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
709
+ resync_replication_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
710
+ end
711
+
712
+ #
713
+ # Resync volume replication
714
+ #
715
+ # Resync the connection on the destination volume. If the operation is ran on
716
+ # the source volume it will reverse-resync the connection and sync from source
717
+ # to destination.
718
+ #
719
+ # @param resource_group_name [String] The name of the resource group.
720
+ # @param account_name [String] The name of the NetApp account
721
+ # @param pool_name [String] The name of the capacity pool
722
+ # @param volume_name [String] The name of the volume
723
+ # @param [Hash{String => String}] A hash of custom headers that will be added
724
+ # to the HTTP request.
725
+ #
726
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
727
+ #
728
+ def resync_replication_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
729
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
730
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
731
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
732
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
733
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
734
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
735
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
736
+ fail ArgumentError, 'volume_name is nil' if volume_name.nil?
737
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
738
+
739
+
740
+ request_headers = {}
741
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
742
+
743
+ # Set Headers
744
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
745
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
746
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication'
747
+
748
+ request_url = @base_url || @client.base_url
749
+
750
+ options = {
751
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
752
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name,'volumeName' => volume_name},
753
+ query_params: {'api-version' => @client.api_version},
754
+ headers: request_headers.merge(custom_headers || {}),
755
+ base_url: request_url
756
+ }
757
+ promise = @client.make_request_async(:post, path_template, options)
758
+
759
+ promise = promise.then do |result|
760
+ http_response = result.response
761
+ status_code = http_response.status
762
+ response_content = http_response.body
763
+ unless status_code == 202
764
+ error_model = JSON.load(response_content)
765
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
766
+ end
767
+
768
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
769
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
770
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
771
+
772
+ result
773
+ end
774
+
775
+ promise.execute
776
+ end
777
+
778
+ #
779
+ # Delete volume replication
780
+ #
781
+ # Delete the replication connection on the destination volume, and send release
782
+ # to the source replication
783
+ #
784
+ # @param resource_group_name [String] The name of the resource group.
785
+ # @param account_name [String] The name of the NetApp account
786
+ # @param pool_name [String] The name of the capacity pool
787
+ # @param volume_name [String] The name of the volume
788
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
789
+ # will be added to the HTTP request.
790
+ #
791
+ #
792
+ def delete_replication(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
793
+ response = delete_replication_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
794
+ nil
795
+ end
796
+
797
+ #
798
+ # Delete volume replication
799
+ #
800
+ # Delete the replication connection on the destination volume, and send release
801
+ # to the source replication
802
+ #
803
+ # @param resource_group_name [String] The name of the resource group.
804
+ # @param account_name [String] The name of the NetApp account
805
+ # @param pool_name [String] The name of the capacity pool
806
+ # @param volume_name [String] The name of the volume
807
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
808
+ # will be added to the HTTP request.
809
+ #
810
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
811
+ #
812
+ def delete_replication_with_http_info(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
813
+ delete_replication_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
814
+ end
815
+
816
+ #
817
+ # Delete volume replication
818
+ #
819
+ # Delete the replication connection on the destination volume, and send release
820
+ # to the source replication
821
+ #
822
+ # @param resource_group_name [String] The name of the resource group.
823
+ # @param account_name [String] The name of the NetApp account
824
+ # @param pool_name [String] The name of the capacity pool
825
+ # @param volume_name [String] The name of the volume
826
+ # @param [Hash{String => String}] A hash of custom headers that will be added
827
+ # to the HTTP request.
828
+ #
829
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
830
+ #
831
+ def delete_replication_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
832
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
833
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
834
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
835
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
836
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
837
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
838
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
839
+ fail ArgumentError, 'volume_name is nil' if volume_name.nil?
840
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
841
+
842
+
843
+ request_headers = {}
844
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
845
+
846
+ # Set Headers
847
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
848
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
849
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication'
850
+
851
+ request_url = @base_url || @client.base_url
852
+
853
+ options = {
854
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
855
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name,'volumeName' => volume_name},
856
+ query_params: {'api-version' => @client.api_version},
857
+ headers: request_headers.merge(custom_headers || {}),
858
+ base_url: request_url
859
+ }
860
+ promise = @client.make_request_async(:post, path_template, options)
861
+
862
+ promise = promise.then do |result|
863
+ http_response = result.response
864
+ status_code = http_response.status
865
+ response_content = http_response.body
866
+ unless status_code == 202
867
+ error_model = JSON.load(response_content)
868
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
869
+ end
870
+
871
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
872
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
873
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
874
+
875
+ result
876
+ end
877
+
878
+ promise.execute
879
+ end
880
+
881
+ #
882
+ # Authorize source volume replication
883
+ #
884
+ # Authorize the replication connection on the source volume
885
+ #
886
+ # @param resource_group_name [String] The name of the resource group.
887
+ # @param account_name [String] The name of the NetApp account
888
+ # @param pool_name [String] The name of the capacity pool
889
+ # @param volume_name [String] The name of the volume
890
+ # @param body [AuthorizeRequest] authorize request object supplied in the body
891
+ # of the operation.
892
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
893
+ # will be added to the HTTP request.
894
+ #
895
+ #
896
+ def authorize_replication(resource_group_name, account_name, pool_name, volume_name, body, custom_headers:nil)
897
+ response = authorize_replication_async(resource_group_name, account_name, pool_name, volume_name, body, custom_headers:custom_headers).value!
898
+ nil
899
+ end
900
+
901
+ #
902
+ # Authorize source volume replication
903
+ #
904
+ # Authorize the replication connection on the source volume
905
+ #
906
+ # @param resource_group_name [String] The name of the resource group.
907
+ # @param account_name [String] The name of the NetApp account
908
+ # @param pool_name [String] The name of the capacity pool
909
+ # @param volume_name [String] The name of the volume
910
+ # @param body [AuthorizeRequest] authorize request object supplied in the body
911
+ # of the operation.
912
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
913
+ # will be added to the HTTP request.
914
+ #
915
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
916
+ #
917
+ def authorize_replication_with_http_info(resource_group_name, account_name, pool_name, volume_name, body, custom_headers:nil)
918
+ authorize_replication_async(resource_group_name, account_name, pool_name, volume_name, body, custom_headers:custom_headers).value!
919
+ end
920
+
921
+ #
922
+ # Authorize source volume replication
923
+ #
924
+ # Authorize the replication connection on the source volume
925
+ #
926
+ # @param resource_group_name [String] The name of the resource group.
927
+ # @param account_name [String] The name of the NetApp account
928
+ # @param pool_name [String] The name of the capacity pool
929
+ # @param volume_name [String] The name of the volume
930
+ # @param body [AuthorizeRequest] authorize request object supplied in the body
931
+ # of the operation.
932
+ # @param [Hash{String => String}] A hash of custom headers that will be added
933
+ # to the HTTP request.
934
+ #
935
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
936
+ #
937
+ def authorize_replication_async(resource_group_name, account_name, pool_name, volume_name, body, custom_headers:nil)
938
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
939
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
940
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
941
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
942
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
943
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
944
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
945
+ fail ArgumentError, 'volume_name is nil' if volume_name.nil?
946
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
947
+ fail ArgumentError, 'body is nil' if body.nil?
948
+
949
+
950
+ request_headers = {}
951
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
952
+
953
+ # Set Headers
954
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
955
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
956
+
957
+ # Serialize Request
958
+ request_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::AuthorizeRequest.mapper()
959
+ request_content = @client.serialize(request_mapper, body)
960
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
961
+
962
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication'
963
+
964
+ request_url = @base_url || @client.base_url
965
+
966
+ options = {
967
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
968
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name,'volumeName' => volume_name},
969
+ query_params: {'api-version' => @client.api_version},
970
+ body: request_content,
971
+ headers: request_headers.merge(custom_headers || {}),
972
+ base_url: request_url
973
+ }
974
+ promise = @client.make_request_async(:post, path_template, options)
975
+
976
+ promise = promise.then do |result|
977
+ http_response = result.response
978
+ status_code = http_response.status
979
+ response_content = http_response.body
980
+ unless status_code == 202
981
+ error_model = JSON.load(response_content)
982
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
983
+ end
984
+
985
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
986
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
987
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
988
+
989
+ result
990
+ end
991
+
992
+ promise.execute
993
+ end
994
+
995
+ #
996
+ # Create or Update a volume
997
+ #
998
+ # Create or update the specified volume within the capacity pool
999
+ #
1000
+ # @param body [Volume] Volume object supplied in the body of the operation.
1001
+ # @param resource_group_name [String] The name of the resource group.
1002
+ # @param account_name [String] The name of the NetApp account
1003
+ # @param pool_name [String] The name of the capacity pool
1004
+ # @param volume_name [String] The name of the volume
1005
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1006
+ # will be added to the HTTP request.
1007
+ #
1008
+ # @return [Volume] operation results.
1009
+ #
1010
+ def begin_create_or_update(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
1011
+ response = begin_create_or_update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
1012
+ response.body unless response.nil?
1013
+ end
1014
+
1015
+ #
1016
+ # Create or Update a volume
1017
+ #
1018
+ # Create or update the specified volume within the capacity pool
1019
+ #
1020
+ # @param body [Volume] Volume object supplied in the body of the operation.
1021
+ # @param resource_group_name [String] The name of the resource group.
1022
+ # @param account_name [String] The name of the NetApp account
1023
+ # @param pool_name [String] The name of the capacity pool
1024
+ # @param volume_name [String] The name of the volume
1025
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1026
+ # will be added to the HTTP request.
1027
+ #
1028
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1029
+ #
1030
+ def begin_create_or_update_with_http_info(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
1031
+ begin_create_or_update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
1032
+ end
1033
+
1034
+ #
1035
+ # Create or Update a volume
1036
+ #
1037
+ # Create or update the specified volume within the capacity pool
1038
+ #
1039
+ # @param body [Volume] Volume object supplied in the body of the operation.
1040
+ # @param resource_group_name [String] The name of the resource group.
1041
+ # @param account_name [String] The name of the NetApp account
1042
+ # @param pool_name [String] The name of the capacity pool
1043
+ # @param volume_name [String] The name of the volume
1044
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1045
+ # to the HTTP request.
1046
+ #
1047
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1048
+ #
1049
+ def begin_create_or_update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
1050
+ fail ArgumentError, 'body is nil' if body.nil?
1051
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1052
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1053
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1054
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1055
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1056
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1057
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
1058
+ fail ArgumentError, 'volume_name is nil' if volume_name.nil?
1059
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1060
+
1061
+
1062
+ request_headers = {}
1063
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1064
+
1065
+ # Set Headers
1066
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1067
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1068
+
1069
+ # Serialize Request
1070
+ request_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::Volume.mapper()
1071
+ request_content = @client.serialize(request_mapper, body)
1072
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1073
+
1074
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'
1075
+
1076
+ request_url = @base_url || @client.base_url
1077
+
1078
+ options = {
1079
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1080
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name,'volumeName' => volume_name},
1081
+ query_params: {'api-version' => @client.api_version},
1082
+ body: request_content,
1083
+ headers: request_headers.merge(custom_headers || {}),
1084
+ base_url: request_url
1085
+ }
1086
+ promise = @client.make_request_async(:put, path_template, options)
1087
+
1088
+ promise = promise.then do |result|
1089
+ http_response = result.response
1090
+ status_code = http_response.status
1091
+ response_content = http_response.body
1092
+ unless status_code == 200 || status_code == 201 || status_code == 202
1093
+ error_model = JSON.load(response_content)
1094
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1095
+ end
1096
+
1097
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1098
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1099
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1100
+ # Deserialize Response
1101
+ if status_code == 200
1102
+ begin
1103
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1104
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::Volume.mapper()
1105
+ result.body = @client.deserialize(result_mapper, parsed_response)
1106
+ rescue Exception => e
1107
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1108
+ end
1109
+ end
1110
+ # Deserialize Response
1111
+ if status_code == 201
1112
+ begin
1113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1114
+ result_mapper = Azure::NetApp::Mgmt::V2019_10_01::Models::Volume.mapper()
1115
+ result.body = @client.deserialize(result_mapper, parsed_response)
1116
+ rescue Exception => e
1117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1118
+ end
1119
+ end
1120
+
1121
+ result
1122
+ end
1123
+
1124
+ promise.execute
1125
+ end
1126
+
1127
+ #
1128
+ # Delete a volume
1129
+ #
1130
+ # Delete the specified volume
1131
+ #
1132
+ # @param resource_group_name [String] The name of the resource group.
1133
+ # @param account_name [String] The name of the NetApp account
1134
+ # @param pool_name [String] The name of the capacity pool
1135
+ # @param volume_name [String] The name of the volume
1136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1137
+ # will be added to the HTTP request.
1138
+ #
1139
+ #
1140
+ def begin_delete(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
1141
+ response = begin_delete_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
1142
+ nil
1143
+ end
1144
+
1145
+ #
1146
+ # Delete a volume
1147
+ #
1148
+ # Delete the specified volume
1149
+ #
1150
+ # @param resource_group_name [String] The name of the resource group.
1151
+ # @param account_name [String] The name of the NetApp account
1152
+ # @param pool_name [String] The name of the capacity pool
1153
+ # @param volume_name [String] The name of the volume
1154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1155
+ # will be added to the HTTP request.
1156
+ #
1157
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1158
+ #
1159
+ def begin_delete_with_http_info(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
1160
+ begin_delete_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
1161
+ end
1162
+
1163
+ #
1164
+ # Delete a volume
1165
+ #
1166
+ # Delete the specified volume
1167
+ #
1168
+ # @param resource_group_name [String] The name of the resource group.
1169
+ # @param account_name [String] The name of the NetApp account
1170
+ # @param pool_name [String] The name of the capacity pool
1171
+ # @param volume_name [String] The name of the volume
1172
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1173
+ # to the HTTP request.
1174
+ #
1175
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1176
+ #
1177
+ def begin_delete_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
1178
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1179
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1180
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1181
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1182
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1183
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1184
+ fail ArgumentError, 'pool_name is nil' if pool_name.nil?
1185
+ fail ArgumentError, 'volume_name is nil' if volume_name.nil?
1186
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1187
+
1188
+
1189
+ request_headers = {}
1190
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1191
+
1192
+ # Set Headers
1193
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1194
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1195
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}'
1196
+
1197
+ request_url = @base_url || @client.base_url
1198
+
1199
+ options = {
1200
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1201
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'poolName' => pool_name,'volumeName' => volume_name},
1202
+ query_params: {'api-version' => @client.api_version},
1203
+ headers: request_headers.merge(custom_headers || {}),
1204
+ base_url: request_url
1205
+ }
1206
+ promise = @client.make_request_async(:delete, path_template, options)
1207
+
1208
+ promise = promise.then do |result|
1209
+ http_response = result.response
1210
+ status_code = http_response.status
1211
+ response_content = http_response.body
1212
+ unless status_code == 202 || status_code == 204
1213
+ error_model = JSON.load(response_content)
1214
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1215
+ end
1216
+
1217
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1218
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1219
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1220
+
1221
+ result
1222
+ end
1223
+
1224
+ promise.execute
1225
+ end
1226
+
1227
+ end
1228
+ end