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