1package netapp 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "github.com/Azure/go-autorest/autorest" 12 "github.com/Azure/go-autorest/autorest/azure" 13 "github.com/Azure/go-autorest/autorest/validation" 14 "github.com/Azure/go-autorest/tracing" 15 "net/http" 16) 17 18// VolumesClient is the microsoft NetApp Files Azure Resource Provider specification 19type VolumesClient struct { 20 BaseClient 21} 22 23// NewVolumesClient creates an instance of the VolumesClient client. 24func NewVolumesClient(subscriptionID string) VolumesClient { 25 return NewVolumesClientWithBaseURI(DefaultBaseURI, subscriptionID) 26} 27 28// NewVolumesClientWithBaseURI creates an instance of the VolumesClient client using a custom endpoint. Use this when 29// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). 30func NewVolumesClientWithBaseURI(baseURI string, subscriptionID string) VolumesClient { 31 return VolumesClient{NewWithBaseURI(baseURI, subscriptionID)} 32} 33 34// AuthorizeReplication authorize the replication connection on the source volume 35// Parameters: 36// resourceGroupName - the name of the resource group. 37// accountName - the name of the NetApp account 38// poolName - the name of the capacity pool 39// volumeName - the name of the volume 40// body - authorize request object supplied in the body of the operation. 41func (client VolumesClient) AuthorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (result VolumesAuthorizeReplicationFuture, err error) { 42 if tracing.IsEnabled() { 43 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.AuthorizeReplication") 44 defer func() { 45 sc := -1 46 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 47 sc = result.FutureAPI.Response().StatusCode 48 } 49 tracing.EndSpan(ctx, sc, err) 50 }() 51 } 52 if err := validation.Validate([]validation.Validation{ 53 {TargetValue: resourceGroupName, 54 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 55 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 56 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 57 {TargetValue: poolName, 58 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 59 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 60 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 61 {TargetValue: volumeName, 62 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 63 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 64 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 65 return result, validation.NewError("netapp.VolumesClient", "AuthorizeReplication", err.Error()) 66 } 67 68 req, err := client.AuthorizeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) 69 if err != nil { 70 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", nil, "Failure preparing request") 71 return 72 } 73 74 result, err = client.AuthorizeReplicationSender(req) 75 if err != nil { 76 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "AuthorizeReplication", nil, "Failure sending request") 77 return 78 } 79 80 return 81} 82 83// AuthorizeReplicationPreparer prepares the AuthorizeReplication request. 84func (client VolumesClient) AuthorizeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest) (*http.Request, error) { 85 pathParameters := map[string]interface{}{ 86 "accountName": autorest.Encode("path", accountName), 87 "poolName": autorest.Encode("path", poolName), 88 "resourceGroupName": autorest.Encode("path", resourceGroupName), 89 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 90 "volumeName": autorest.Encode("path", volumeName), 91 } 92 93 const APIVersion = "2021-04-01" 94 queryParameters := map[string]interface{}{ 95 "api-version": APIVersion, 96 } 97 98 preparer := autorest.CreatePreparer( 99 autorest.AsContentType("application/json; charset=utf-8"), 100 autorest.AsPost(), 101 autorest.WithBaseURL(client.BaseURI), 102 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication", pathParameters), 103 autorest.WithJSON(body), 104 autorest.WithQueryParameters(queryParameters)) 105 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 106} 107 108// AuthorizeReplicationSender sends the AuthorizeReplication request. The method will close the 109// http.Response Body if it receives an error. 110func (client VolumesClient) AuthorizeReplicationSender(req *http.Request) (future VolumesAuthorizeReplicationFuture, err error) { 111 var resp *http.Response 112 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 113 if err != nil { 114 return 115 } 116 var azf azure.Future 117 azf, err = azure.NewFutureFromResponse(resp) 118 future.FutureAPI = &azf 119 future.Result = future.result 120 return 121} 122 123// AuthorizeReplicationResponder handles the response to the AuthorizeReplication request. The method always 124// closes the http.Response Body. 125func (client VolumesClient) AuthorizeReplicationResponder(resp *http.Response) (result autorest.Response, err error) { 126 err = autorest.Respond( 127 resp, 128 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 129 autorest.ByClosing()) 130 result.Response = resp 131 return 132} 133 134// BreakReplication break the replication connection on the destination volume 135// Parameters: 136// resourceGroupName - the name of the resource group. 137// accountName - the name of the NetApp account 138// poolName - the name of the capacity pool 139// volumeName - the name of the volume 140// body - optional body to force break the replication. 141func (client VolumesClient) BreakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (result VolumesBreakReplicationFuture, err error) { 142 if tracing.IsEnabled() { 143 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.BreakReplication") 144 defer func() { 145 sc := -1 146 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 147 sc = result.FutureAPI.Response().StatusCode 148 } 149 tracing.EndSpan(ctx, sc, err) 150 }() 151 } 152 if err := validation.Validate([]validation.Validation{ 153 {TargetValue: resourceGroupName, 154 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 155 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 156 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 157 {TargetValue: poolName, 158 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 159 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 160 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 161 {TargetValue: volumeName, 162 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 163 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 164 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 165 return result, validation.NewError("netapp.VolumesClient", "BreakReplication", err.Error()) 166 } 167 168 req, err := client.BreakReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) 169 if err != nil { 170 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", nil, "Failure preparing request") 171 return 172 } 173 174 result, err = client.BreakReplicationSender(req) 175 if err != nil { 176 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "BreakReplication", nil, "Failure sending request") 177 return 178 } 179 180 return 181} 182 183// BreakReplicationPreparer prepares the BreakReplication request. 184func (client VolumesClient) BreakReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body *BreakReplicationRequest) (*http.Request, error) { 185 pathParameters := map[string]interface{}{ 186 "accountName": autorest.Encode("path", accountName), 187 "poolName": autorest.Encode("path", poolName), 188 "resourceGroupName": autorest.Encode("path", resourceGroupName), 189 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 190 "volumeName": autorest.Encode("path", volumeName), 191 } 192 193 const APIVersion = "2021-04-01" 194 queryParameters := map[string]interface{}{ 195 "api-version": APIVersion, 196 } 197 198 preparer := autorest.CreatePreparer( 199 autorest.AsContentType("application/json; charset=utf-8"), 200 autorest.AsPost(), 201 autorest.WithBaseURL(client.BaseURI), 202 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication", pathParameters), 203 autorest.WithQueryParameters(queryParameters)) 204 if body != nil { 205 preparer = autorest.DecoratePreparer(preparer, 206 autorest.WithJSON(body)) 207 } 208 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 209} 210 211// BreakReplicationSender sends the BreakReplication request. The method will close the 212// http.Response Body if it receives an error. 213func (client VolumesClient) BreakReplicationSender(req *http.Request) (future VolumesBreakReplicationFuture, err error) { 214 var resp *http.Response 215 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 216 if err != nil { 217 return 218 } 219 var azf azure.Future 220 azf, err = azure.NewFutureFromResponse(resp) 221 future.FutureAPI = &azf 222 future.Result = future.result 223 return 224} 225 226// BreakReplicationResponder handles the response to the BreakReplication request. The method always 227// closes the http.Response Body. 228func (client VolumesClient) BreakReplicationResponder(resp *http.Response) (result autorest.Response, err error) { 229 err = autorest.Respond( 230 resp, 231 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 232 autorest.ByClosing()) 233 result.Response = resp 234 return 235} 236 237// CreateOrUpdate create or update the specified volume within the capacity pool 238// Parameters: 239// body - volume object supplied in the body of the operation. 240// resourceGroupName - the name of the resource group. 241// accountName - the name of the NetApp account 242// poolName - the name of the capacity pool 243// volumeName - the name of the volume 244func (client VolumesClient) CreateOrUpdate(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesCreateOrUpdateFuture, err error) { 245 if tracing.IsEnabled() { 246 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.CreateOrUpdate") 247 defer func() { 248 sc := -1 249 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 250 sc = result.FutureAPI.Response().StatusCode 251 } 252 tracing.EndSpan(ctx, sc, err) 253 }() 254 } 255 if err := validation.Validate([]validation.Validation{ 256 {TargetValue: body, 257 Constraints: []validation.Constraint{{Target: "body.Location", Name: validation.Null, Rule: true, Chain: nil}, 258 {Target: "body.VolumeProperties", Name: validation.Null, Rule: true, 259 Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.Null, Rule: false, 260 Chain: []validation.Constraint{{Target: "body.VolumeProperties.FileSystemID", Name: validation.MaxLength, Rule: 36, Chain: nil}, 261 {Target: "body.VolumeProperties.FileSystemID", Name: validation.MinLength, Rule: 36, Chain: nil}, 262 {Target: "body.VolumeProperties.FileSystemID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`, Chain: nil}, 263 }}, 264 {Target: "body.VolumeProperties.CreationToken", Name: validation.Null, Rule: true, 265 Chain: []validation.Constraint{{Target: "body.VolumeProperties.CreationToken", Name: validation.MaxLength, Rule: 80, Chain: nil}, 266 {Target: "body.VolumeProperties.CreationToken", Name: validation.MinLength, Rule: 1, Chain: nil}, 267 {Target: "body.VolumeProperties.CreationToken", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-]{0,79}$`, Chain: nil}, 268 }}, 269 {Target: "body.VolumeProperties.UsageThreshold", Name: validation.Null, Rule: true, 270 Chain: []validation.Constraint{{Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMaximum, Rule: int64(109951162777600), Chain: nil}, 271 {Target: "body.VolumeProperties.UsageThreshold", Name: validation.InclusiveMinimum, Rule: int64(107374182400), Chain: nil}, 272 }}, 273 {Target: "body.VolumeProperties.SnapshotID", Name: validation.Null, Rule: false, 274 Chain: []validation.Constraint{{Target: "body.VolumeProperties.SnapshotID", Name: validation.MaxLength, Rule: 36, Chain: nil}, 275 {Target: "body.VolumeProperties.SnapshotID", Name: validation.MinLength, Rule: 36, Chain: nil}, 276 {Target: "body.VolumeProperties.SnapshotID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil}, 277 }}, 278 {Target: "body.VolumeProperties.BackupID", Name: validation.Null, Rule: false, 279 Chain: []validation.Constraint{{Target: "body.VolumeProperties.BackupID", Name: validation.MaxLength, Rule: 36, Chain: nil}, 280 {Target: "body.VolumeProperties.BackupID", Name: validation.MinLength, Rule: 36, Chain: nil}, 281 {Target: "body.VolumeProperties.BackupID", Name: validation.Pattern, Rule: `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\?([^\/]*[\/])*)([^\/]+)$`, Chain: nil}, 282 }}, 283 {Target: "body.VolumeProperties.SubnetID", Name: validation.Null, Rule: true, Chain: nil}, 284 {Target: "body.VolumeProperties.DataProtection", Name: validation.Null, Rule: false, 285 Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication", Name: validation.Null, Rule: false, 286 Chain: []validation.Constraint{{Target: "body.VolumeProperties.DataProtection.Replication.RemoteVolumeResourceID", Name: validation.Null, Rule: true, Chain: nil}}}, 287 }}, 288 {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.Null, Rule: false, 289 Chain: []validation.Constraint{{Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMaximum, Rule: float64(4500), Chain: nil}, 290 {Target: "body.VolumeProperties.ThroughputMibps", Name: validation.InclusiveMinimum, Rule: float64(0), Chain: nil}, 291 }}, 292 {Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.Null, Rule: false, 293 Chain: []validation.Constraint{{Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMaximum, Rule: int64(63), Chain: nil}, 294 {Target: "body.VolumeProperties.CoolnessPeriod", Name: validation.InclusiveMinimum, Rule: int64(7), Chain: nil}, 295 }}, 296 {Target: "body.VolumeProperties.UnixPermissions", Name: validation.Null, Rule: false, 297 Chain: []validation.Constraint{{Target: "body.VolumeProperties.UnixPermissions", Name: validation.MaxLength, Rule: 4, Chain: nil}, 298 {Target: "body.VolumeProperties.UnixPermissions", Name: validation.MinLength, Rule: 4, Chain: nil}, 299 }}, 300 }}}}, 301 {TargetValue: resourceGroupName, 302 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 303 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 304 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 305 {TargetValue: poolName, 306 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 307 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 308 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 309 {TargetValue: volumeName, 310 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 311 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 312 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 313 return result, validation.NewError("netapp.VolumesClient", "CreateOrUpdate", err.Error()) 314 } 315 316 req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName) 317 if err != nil { 318 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure preparing request") 319 return 320 } 321 322 result, err = client.CreateOrUpdateSender(req) 323 if err != nil { 324 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "CreateOrUpdate", nil, "Failure sending request") 325 return 326 } 327 328 return 329} 330 331// CreateOrUpdatePreparer prepares the CreateOrUpdate request. 332func (client VolumesClient) CreateOrUpdatePreparer(ctx context.Context, body Volume, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { 333 pathParameters := map[string]interface{}{ 334 "accountName": autorest.Encode("path", accountName), 335 "poolName": autorest.Encode("path", poolName), 336 "resourceGroupName": autorest.Encode("path", resourceGroupName), 337 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 338 "volumeName": autorest.Encode("path", volumeName), 339 } 340 341 const APIVersion = "2021-04-01" 342 queryParameters := map[string]interface{}{ 343 "api-version": APIVersion, 344 } 345 346 body.ID = nil 347 body.Name = nil 348 body.Type = nil 349 preparer := autorest.CreatePreparer( 350 autorest.AsContentType("application/json; charset=utf-8"), 351 autorest.AsPut(), 352 autorest.WithBaseURL(client.BaseURI), 353 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), 354 autorest.WithJSON(body), 355 autorest.WithQueryParameters(queryParameters)) 356 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 357} 358 359// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the 360// http.Response Body if it receives an error. 361func (client VolumesClient) CreateOrUpdateSender(req *http.Request) (future VolumesCreateOrUpdateFuture, err error) { 362 var resp *http.Response 363 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 364 if err != nil { 365 return 366 } 367 var azf azure.Future 368 azf, err = azure.NewFutureFromResponse(resp) 369 future.FutureAPI = &azf 370 future.Result = future.result 371 return 372} 373 374// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always 375// closes the http.Response Body. 376func (client VolumesClient) CreateOrUpdateResponder(resp *http.Response) (result Volume, err error) { 377 err = autorest.Respond( 378 resp, 379 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), 380 autorest.ByUnmarshallingJSON(&result), 381 autorest.ByClosing()) 382 result.Response = autorest.Response{Response: resp} 383 return 384} 385 386// Delete delete the specified volume 387// Parameters: 388// resourceGroupName - the name of the resource group. 389// accountName - the name of the NetApp account 390// poolName - the name of the capacity pool 391// volumeName - the name of the volume 392func (client VolumesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteFuture, err error) { 393 if tracing.IsEnabled() { 394 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Delete") 395 defer func() { 396 sc := -1 397 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 398 sc = result.FutureAPI.Response().StatusCode 399 } 400 tracing.EndSpan(ctx, sc, err) 401 }() 402 } 403 if err := validation.Validate([]validation.Validation{ 404 {TargetValue: resourceGroupName, 405 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 406 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 407 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 408 {TargetValue: poolName, 409 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 410 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 411 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 412 {TargetValue: volumeName, 413 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 414 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 415 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 416 return result, validation.NewError("netapp.VolumesClient", "Delete", err.Error()) 417 } 418 419 req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, poolName, volumeName) 420 if err != nil { 421 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure preparing request") 422 return 423 } 424 425 result, err = client.DeleteSender(req) 426 if err != nil { 427 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Delete", nil, "Failure sending request") 428 return 429 } 430 431 return 432} 433 434// DeletePreparer prepares the Delete request. 435func (client VolumesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { 436 pathParameters := map[string]interface{}{ 437 "accountName": autorest.Encode("path", accountName), 438 "poolName": autorest.Encode("path", poolName), 439 "resourceGroupName": autorest.Encode("path", resourceGroupName), 440 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 441 "volumeName": autorest.Encode("path", volumeName), 442 } 443 444 const APIVersion = "2021-04-01" 445 queryParameters := map[string]interface{}{ 446 "api-version": APIVersion, 447 } 448 449 preparer := autorest.CreatePreparer( 450 autorest.AsDelete(), 451 autorest.WithBaseURL(client.BaseURI), 452 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), 453 autorest.WithQueryParameters(queryParameters)) 454 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 455} 456 457// DeleteSender sends the Delete request. The method will close the 458// http.Response Body if it receives an error. 459func (client VolumesClient) DeleteSender(req *http.Request) (future VolumesDeleteFuture, err error) { 460 var resp *http.Response 461 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 462 if err != nil { 463 return 464 } 465 var azf azure.Future 466 azf, err = azure.NewFutureFromResponse(resp) 467 future.FutureAPI = &azf 468 future.Result = future.result 469 return 470} 471 472// DeleteResponder handles the response to the Delete request. The method always 473// closes the http.Response Body. 474func (client VolumesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 475 err = autorest.Respond( 476 resp, 477 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 478 autorest.ByClosing()) 479 result.Response = resp 480 return 481} 482 483// DeleteReplication delete the replication connection on the destination volume, and send release to the source 484// replication 485// Parameters: 486// resourceGroupName - the name of the resource group. 487// accountName - the name of the NetApp account 488// poolName - the name of the capacity pool 489// volumeName - the name of the volume 490func (client VolumesClient) DeleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesDeleteReplicationFuture, err error) { 491 if tracing.IsEnabled() { 492 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.DeleteReplication") 493 defer func() { 494 sc := -1 495 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 496 sc = result.FutureAPI.Response().StatusCode 497 } 498 tracing.EndSpan(ctx, sc, err) 499 }() 500 } 501 if err := validation.Validate([]validation.Validation{ 502 {TargetValue: resourceGroupName, 503 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 504 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 505 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 506 {TargetValue: poolName, 507 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 508 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 509 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 510 {TargetValue: volumeName, 511 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 512 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 513 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 514 return result, validation.NewError("netapp.VolumesClient", "DeleteReplication", err.Error()) 515 } 516 517 req, err := client.DeleteReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) 518 if err != nil { 519 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure preparing request") 520 return 521 } 522 523 result, err = client.DeleteReplicationSender(req) 524 if err != nil { 525 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "DeleteReplication", nil, "Failure sending request") 526 return 527 } 528 529 return 530} 531 532// DeleteReplicationPreparer prepares the DeleteReplication request. 533func (client VolumesClient) DeleteReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { 534 pathParameters := map[string]interface{}{ 535 "accountName": autorest.Encode("path", accountName), 536 "poolName": autorest.Encode("path", poolName), 537 "resourceGroupName": autorest.Encode("path", resourceGroupName), 538 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 539 "volumeName": autorest.Encode("path", volumeName), 540 } 541 542 const APIVersion = "2021-04-01" 543 queryParameters := map[string]interface{}{ 544 "api-version": APIVersion, 545 } 546 547 preparer := autorest.CreatePreparer( 548 autorest.AsPost(), 549 autorest.WithBaseURL(client.BaseURI), 550 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication", pathParameters), 551 autorest.WithQueryParameters(queryParameters)) 552 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 553} 554 555// DeleteReplicationSender sends the DeleteReplication request. The method will close the 556// http.Response Body if it receives an error. 557func (client VolumesClient) DeleteReplicationSender(req *http.Request) (future VolumesDeleteReplicationFuture, err error) { 558 var resp *http.Response 559 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 560 if err != nil { 561 return 562 } 563 var azf azure.Future 564 azf, err = azure.NewFutureFromResponse(resp) 565 future.FutureAPI = &azf 566 future.Result = future.result 567 return 568} 569 570// DeleteReplicationResponder handles the response to the DeleteReplication request. The method always 571// closes the http.Response Body. 572func (client VolumesClient) DeleteReplicationResponder(resp *http.Response) (result autorest.Response, err error) { 573 err = autorest.Respond( 574 resp, 575 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 576 autorest.ByClosing()) 577 result.Response = resp 578 return 579} 580 581// Get get the details of the specified volume 582// Parameters: 583// resourceGroupName - the name of the resource group. 584// accountName - the name of the NetApp account 585// poolName - the name of the capacity pool 586// volumeName - the name of the volume 587func (client VolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result Volume, err error) { 588 if tracing.IsEnabled() { 589 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Get") 590 defer func() { 591 sc := -1 592 if result.Response.Response != nil { 593 sc = result.Response.Response.StatusCode 594 } 595 tracing.EndSpan(ctx, sc, err) 596 }() 597 } 598 if err := validation.Validate([]validation.Validation{ 599 {TargetValue: resourceGroupName, 600 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 601 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 602 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 603 {TargetValue: poolName, 604 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 605 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 606 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 607 {TargetValue: volumeName, 608 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 609 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 610 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 611 return result, validation.NewError("netapp.VolumesClient", "Get", err.Error()) 612 } 613 614 req, err := client.GetPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) 615 if err != nil { 616 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", nil, "Failure preparing request") 617 return 618 } 619 620 resp, err := client.GetSender(req) 621 if err != nil { 622 result.Response = autorest.Response{Response: resp} 623 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure sending request") 624 return 625 } 626 627 result, err = client.GetResponder(resp) 628 if err != nil { 629 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Get", resp, "Failure responding to request") 630 return 631 } 632 633 return 634} 635 636// GetPreparer prepares the Get request. 637func (client VolumesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { 638 pathParameters := map[string]interface{}{ 639 "accountName": autorest.Encode("path", accountName), 640 "poolName": autorest.Encode("path", poolName), 641 "resourceGroupName": autorest.Encode("path", resourceGroupName), 642 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 643 "volumeName": autorest.Encode("path", volumeName), 644 } 645 646 const APIVersion = "2021-04-01" 647 queryParameters := map[string]interface{}{ 648 "api-version": APIVersion, 649 } 650 651 preparer := autorest.CreatePreparer( 652 autorest.AsGet(), 653 autorest.WithBaseURL(client.BaseURI), 654 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), 655 autorest.WithQueryParameters(queryParameters)) 656 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 657} 658 659// GetSender sends the Get request. The method will close the 660// http.Response Body if it receives an error. 661func (client VolumesClient) GetSender(req *http.Request) (*http.Response, error) { 662 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 663} 664 665// GetResponder handles the response to the Get request. The method always 666// closes the http.Response Body. 667func (client VolumesClient) GetResponder(resp *http.Response) (result Volume, err error) { 668 err = autorest.Respond( 669 resp, 670 azure.WithErrorUnlessStatusCode(http.StatusOK), 671 autorest.ByUnmarshallingJSON(&result), 672 autorest.ByClosing()) 673 result.Response = autorest.Response{Response: resp} 674 return 675} 676 677// List list all volumes within the capacity pool 678// Parameters: 679// resourceGroupName - the name of the resource group. 680// accountName - the name of the NetApp account 681// poolName - the name of the capacity pool 682func (client VolumesClient) List(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListPage, err error) { 683 if tracing.IsEnabled() { 684 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List") 685 defer func() { 686 sc := -1 687 if result.vl.Response.Response != nil { 688 sc = result.vl.Response.Response.StatusCode 689 } 690 tracing.EndSpan(ctx, sc, err) 691 }() 692 } 693 if err := validation.Validate([]validation.Validation{ 694 {TargetValue: resourceGroupName, 695 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 696 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 697 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 698 {TargetValue: poolName, 699 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 700 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 701 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 702 return result, validation.NewError("netapp.VolumesClient", "List", err.Error()) 703 } 704 705 result.fn = client.listNextResults 706 req, err := client.ListPreparer(ctx, resourceGroupName, accountName, poolName) 707 if err != nil { 708 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", nil, "Failure preparing request") 709 return 710 } 711 712 resp, err := client.ListSender(req) 713 if err != nil { 714 result.vl.Response = autorest.Response{Response: resp} 715 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure sending request") 716 return 717 } 718 719 result.vl, err = client.ListResponder(resp) 720 if err != nil { 721 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "List", resp, "Failure responding to request") 722 return 723 } 724 if result.vl.hasNextLink() && result.vl.IsEmpty() { 725 err = result.NextWithContext(ctx) 726 return 727 } 728 729 return 730} 731 732// ListPreparer prepares the List request. 733func (client VolumesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string) (*http.Request, error) { 734 pathParameters := map[string]interface{}{ 735 "accountName": autorest.Encode("path", accountName), 736 "poolName": autorest.Encode("path", poolName), 737 "resourceGroupName": autorest.Encode("path", resourceGroupName), 738 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 739 } 740 741 const APIVersion = "2021-04-01" 742 queryParameters := map[string]interface{}{ 743 "api-version": APIVersion, 744 } 745 746 preparer := autorest.CreatePreparer( 747 autorest.AsGet(), 748 autorest.WithBaseURL(client.BaseURI), 749 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes", pathParameters), 750 autorest.WithQueryParameters(queryParameters)) 751 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 752} 753 754// ListSender sends the List request. The method will close the 755// http.Response Body if it receives an error. 756func (client VolumesClient) ListSender(req *http.Request) (*http.Response, error) { 757 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 758} 759 760// ListResponder handles the response to the List request. The method always 761// closes the http.Response Body. 762func (client VolumesClient) ListResponder(resp *http.Response) (result VolumeList, err error) { 763 err = autorest.Respond( 764 resp, 765 azure.WithErrorUnlessStatusCode(http.StatusOK), 766 autorest.ByUnmarshallingJSON(&result), 767 autorest.ByClosing()) 768 result.Response = autorest.Response{Response: resp} 769 return 770} 771 772// listNextResults retrieves the next set of results, if any. 773func (client VolumesClient) listNextResults(ctx context.Context, lastResults VolumeList) (result VolumeList, err error) { 774 req, err := lastResults.volumeListPreparer(ctx) 775 if err != nil { 776 return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", nil, "Failure preparing next results request") 777 } 778 if req == nil { 779 return 780 } 781 resp, err := client.ListSender(req) 782 if err != nil { 783 result.Response = autorest.Response{Response: resp} 784 return result, autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure sending next results request") 785 } 786 result, err = client.ListResponder(resp) 787 if err != nil { 788 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "listNextResults", resp, "Failure responding to next results request") 789 } 790 return 791} 792 793// ListComplete enumerates all values, automatically crossing page boundaries as required. 794func (client VolumesClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, poolName string) (result VolumeListIterator, err error) { 795 if tracing.IsEnabled() { 796 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.List") 797 defer func() { 798 sc := -1 799 if result.Response().Response.Response != nil { 800 sc = result.page.Response().Response.Response.StatusCode 801 } 802 tracing.EndSpan(ctx, sc, err) 803 }() 804 } 805 result.page, err = client.List(ctx, resourceGroupName, accountName, poolName) 806 return 807} 808 809// PoolChange moves volume to another pool 810// Parameters: 811// resourceGroupName - the name of the resource group. 812// accountName - the name of the NetApp account 813// poolName - the name of the capacity pool 814// volumeName - the name of the volume 815// body - move volume to the pool supplied in the body of the operation. 816func (client VolumesClient) PoolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (result VolumesPoolChangeFuture, err error) { 817 if tracing.IsEnabled() { 818 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.PoolChange") 819 defer func() { 820 sc := -1 821 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 822 sc = result.FutureAPI.Response().StatusCode 823 } 824 tracing.EndSpan(ctx, sc, err) 825 }() 826 } 827 if err := validation.Validate([]validation.Validation{ 828 {TargetValue: resourceGroupName, 829 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 830 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 831 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 832 {TargetValue: poolName, 833 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 834 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 835 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 836 {TargetValue: volumeName, 837 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 838 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 839 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 840 {TargetValue: body, 841 Constraints: []validation.Constraint{{Target: "body.NewPoolResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 842 return result, validation.NewError("netapp.VolumesClient", "PoolChange", err.Error()) 843 } 844 845 req, err := client.PoolChangePreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) 846 if err != nil { 847 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", nil, "Failure preparing request") 848 return 849 } 850 851 result, err = client.PoolChangeSender(req) 852 if err != nil { 853 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "PoolChange", nil, "Failure sending request") 854 return 855 } 856 857 return 858} 859 860// PoolChangePreparer prepares the PoolChange request. 861func (client VolumesClient) PoolChangePreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest) (*http.Request, error) { 862 pathParameters := map[string]interface{}{ 863 "accountName": autorest.Encode("path", accountName), 864 "poolName": autorest.Encode("path", poolName), 865 "resourceGroupName": autorest.Encode("path", resourceGroupName), 866 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 867 "volumeName": autorest.Encode("path", volumeName), 868 } 869 870 const APIVersion = "2021-04-01" 871 queryParameters := map[string]interface{}{ 872 "api-version": APIVersion, 873 } 874 875 preparer := autorest.CreatePreparer( 876 autorest.AsContentType("application/json; charset=utf-8"), 877 autorest.AsPost(), 878 autorest.WithBaseURL(client.BaseURI), 879 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange", pathParameters), 880 autorest.WithJSON(body), 881 autorest.WithQueryParameters(queryParameters)) 882 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 883} 884 885// PoolChangeSender sends the PoolChange request. The method will close the 886// http.Response Body if it receives an error. 887func (client VolumesClient) PoolChangeSender(req *http.Request) (future VolumesPoolChangeFuture, err error) { 888 var resp *http.Response 889 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 890 if err != nil { 891 return 892 } 893 var azf azure.Future 894 azf, err = azure.NewFutureFromResponse(resp) 895 future.FutureAPI = &azf 896 future.Result = future.result 897 return 898} 899 900// PoolChangeResponder handles the response to the PoolChange request. The method always 901// closes the http.Response Body. 902func (client VolumesClient) PoolChangeResponder(resp *http.Response) (result autorest.Response, err error) { 903 err = autorest.Respond( 904 resp, 905 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 906 autorest.ByClosing()) 907 result.Response = resp 908 return 909} 910 911// ReInitializeReplication re-Initializes the replication connection on the destination volume 912// Parameters: 913// resourceGroupName - the name of the resource group. 914// accountName - the name of the NetApp account 915// poolName - the name of the capacity pool 916// volumeName - the name of the volume 917func (client VolumesClient) ReInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesReInitializeReplicationFuture, err error) { 918 if tracing.IsEnabled() { 919 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReInitializeReplication") 920 defer func() { 921 sc := -1 922 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 923 sc = result.FutureAPI.Response().StatusCode 924 } 925 tracing.EndSpan(ctx, sc, err) 926 }() 927 } 928 if err := validation.Validate([]validation.Validation{ 929 {TargetValue: resourceGroupName, 930 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 931 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 932 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 933 {TargetValue: poolName, 934 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 935 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 936 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 937 {TargetValue: volumeName, 938 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 939 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 940 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 941 return result, validation.NewError("netapp.VolumesClient", "ReInitializeReplication", err.Error()) 942 } 943 944 req, err := client.ReInitializeReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) 945 if err != nil { 946 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", nil, "Failure preparing request") 947 return 948 } 949 950 result, err = client.ReInitializeReplicationSender(req) 951 if err != nil { 952 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReInitializeReplication", nil, "Failure sending request") 953 return 954 } 955 956 return 957} 958 959// ReInitializeReplicationPreparer prepares the ReInitializeReplication request. 960func (client VolumesClient) ReInitializeReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { 961 pathParameters := map[string]interface{}{ 962 "accountName": autorest.Encode("path", accountName), 963 "poolName": autorest.Encode("path", poolName), 964 "resourceGroupName": autorest.Encode("path", resourceGroupName), 965 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 966 "volumeName": autorest.Encode("path", volumeName), 967 } 968 969 const APIVersion = "2021-04-01" 970 queryParameters := map[string]interface{}{ 971 "api-version": APIVersion, 972 } 973 974 preparer := autorest.CreatePreparer( 975 autorest.AsPost(), 976 autorest.WithBaseURL(client.BaseURI), 977 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication", pathParameters), 978 autorest.WithQueryParameters(queryParameters)) 979 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 980} 981 982// ReInitializeReplicationSender sends the ReInitializeReplication request. The method will close the 983// http.Response Body if it receives an error. 984func (client VolumesClient) ReInitializeReplicationSender(req *http.Request) (future VolumesReInitializeReplicationFuture, err error) { 985 var resp *http.Response 986 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 987 if err != nil { 988 return 989 } 990 var azf azure.Future 991 azf, err = azure.NewFutureFromResponse(resp) 992 future.FutureAPI = &azf 993 future.Result = future.result 994 return 995} 996 997// ReInitializeReplicationResponder handles the response to the ReInitializeReplication request. The method always 998// closes the http.Response Body. 999func (client VolumesClient) ReInitializeReplicationResponder(resp *http.Response) (result autorest.Response, err error) { 1000 err = autorest.Respond( 1001 resp, 1002 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 1003 autorest.ByClosing()) 1004 result.Response = resp 1005 return 1006} 1007 1008// ReplicationStatusMethod get the status of the replication 1009// Parameters: 1010// resourceGroupName - the name of the resource group. 1011// accountName - the name of the NetApp account 1012// poolName - the name of the capacity pool 1013// volumeName - the name of the volume 1014func (client VolumesClient) ReplicationStatusMethod(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result ReplicationStatus, err error) { 1015 if tracing.IsEnabled() { 1016 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ReplicationStatusMethod") 1017 defer func() { 1018 sc := -1 1019 if result.Response.Response != nil { 1020 sc = result.Response.Response.StatusCode 1021 } 1022 tracing.EndSpan(ctx, sc, err) 1023 }() 1024 } 1025 if err := validation.Validate([]validation.Validation{ 1026 {TargetValue: resourceGroupName, 1027 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1028 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1029 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 1030 {TargetValue: poolName, 1031 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 1032 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1033 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 1034 {TargetValue: volumeName, 1035 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 1036 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1037 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 1038 return result, validation.NewError("netapp.VolumesClient", "ReplicationStatusMethod", err.Error()) 1039 } 1040 1041 req, err := client.ReplicationStatusMethodPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) 1042 if err != nil { 1043 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", nil, "Failure preparing request") 1044 return 1045 } 1046 1047 resp, err := client.ReplicationStatusMethodSender(req) 1048 if err != nil { 1049 result.Response = autorest.Response{Response: resp} 1050 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure sending request") 1051 return 1052 } 1053 1054 result, err = client.ReplicationStatusMethodResponder(resp) 1055 if err != nil { 1056 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ReplicationStatusMethod", resp, "Failure responding to request") 1057 return 1058 } 1059 1060 return 1061} 1062 1063// ReplicationStatusMethodPreparer prepares the ReplicationStatusMethod request. 1064func (client VolumesClient) ReplicationStatusMethodPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { 1065 pathParameters := map[string]interface{}{ 1066 "accountName": autorest.Encode("path", accountName), 1067 "poolName": autorest.Encode("path", poolName), 1068 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1069 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1070 "volumeName": autorest.Encode("path", volumeName), 1071 } 1072 1073 const APIVersion = "2021-04-01" 1074 queryParameters := map[string]interface{}{ 1075 "api-version": APIVersion, 1076 } 1077 1078 preparer := autorest.CreatePreparer( 1079 autorest.AsGet(), 1080 autorest.WithBaseURL(client.BaseURI), 1081 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/replicationStatus", pathParameters), 1082 autorest.WithQueryParameters(queryParameters)) 1083 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1084} 1085 1086// ReplicationStatusMethodSender sends the ReplicationStatusMethod request. The method will close the 1087// http.Response Body if it receives an error. 1088func (client VolumesClient) ReplicationStatusMethodSender(req *http.Request) (*http.Response, error) { 1089 return client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1090} 1091 1092// ReplicationStatusMethodResponder handles the response to the ReplicationStatusMethod request. The method always 1093// closes the http.Response Body. 1094func (client VolumesClient) ReplicationStatusMethodResponder(resp *http.Response) (result ReplicationStatus, err error) { 1095 err = autorest.Respond( 1096 resp, 1097 azure.WithErrorUnlessStatusCode(http.StatusOK), 1098 autorest.ByUnmarshallingJSON(&result), 1099 autorest.ByClosing()) 1100 result.Response = autorest.Response{Response: resp} 1101 return 1102} 1103 1104// ResyncReplication resync the connection on the destination volume. If the operation is ran on the source volume it 1105// will reverse-resync the connection and sync from destination to source. 1106// Parameters: 1107// resourceGroupName - the name of the resource group. 1108// accountName - the name of the NetApp account 1109// poolName - the name of the capacity pool 1110// volumeName - the name of the volume 1111func (client VolumesClient) ResyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesResyncReplicationFuture, err error) { 1112 if tracing.IsEnabled() { 1113 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.ResyncReplication") 1114 defer func() { 1115 sc := -1 1116 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 1117 sc = result.FutureAPI.Response().StatusCode 1118 } 1119 tracing.EndSpan(ctx, sc, err) 1120 }() 1121 } 1122 if err := validation.Validate([]validation.Validation{ 1123 {TargetValue: resourceGroupName, 1124 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1125 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1126 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 1127 {TargetValue: poolName, 1128 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 1129 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1130 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 1131 {TargetValue: volumeName, 1132 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 1133 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1134 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 1135 return result, validation.NewError("netapp.VolumesClient", "ResyncReplication", err.Error()) 1136 } 1137 1138 req, err := client.ResyncReplicationPreparer(ctx, resourceGroupName, accountName, poolName, volumeName) 1139 if err != nil { 1140 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure preparing request") 1141 return 1142 } 1143 1144 result, err = client.ResyncReplicationSender(req) 1145 if err != nil { 1146 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "ResyncReplication", nil, "Failure sending request") 1147 return 1148 } 1149 1150 return 1151} 1152 1153// ResyncReplicationPreparer prepares the ResyncReplication request. 1154func (client VolumesClient) ResyncReplicationPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { 1155 pathParameters := map[string]interface{}{ 1156 "accountName": autorest.Encode("path", accountName), 1157 "poolName": autorest.Encode("path", poolName), 1158 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1159 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1160 "volumeName": autorest.Encode("path", volumeName), 1161 } 1162 1163 const APIVersion = "2021-04-01" 1164 queryParameters := map[string]interface{}{ 1165 "api-version": APIVersion, 1166 } 1167 1168 preparer := autorest.CreatePreparer( 1169 autorest.AsPost(), 1170 autorest.WithBaseURL(client.BaseURI), 1171 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication", pathParameters), 1172 autorest.WithQueryParameters(queryParameters)) 1173 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1174} 1175 1176// ResyncReplicationSender sends the ResyncReplication request. The method will close the 1177// http.Response Body if it receives an error. 1178func (client VolumesClient) ResyncReplicationSender(req *http.Request) (future VolumesResyncReplicationFuture, err error) { 1179 var resp *http.Response 1180 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1181 if err != nil { 1182 return 1183 } 1184 var azf azure.Future 1185 azf, err = azure.NewFutureFromResponse(resp) 1186 future.FutureAPI = &azf 1187 future.Result = future.result 1188 return 1189} 1190 1191// ResyncReplicationResponder handles the response to the ResyncReplication request. The method always 1192// closes the http.Response Body. 1193func (client VolumesClient) ResyncReplicationResponder(resp *http.Response) (result autorest.Response, err error) { 1194 err = autorest.Respond( 1195 resp, 1196 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 1197 autorest.ByClosing()) 1198 result.Response = resp 1199 return 1200} 1201 1202// Revert revert a volume to the snapshot specified in the body 1203// Parameters: 1204// resourceGroupName - the name of the resource group. 1205// accountName - the name of the NetApp account 1206// poolName - the name of the capacity pool 1207// volumeName - the name of the volume 1208// body - object for snapshot to revert supplied in the body of the operation. 1209func (client VolumesClient) Revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (result VolumesRevertFuture, err error) { 1210 if tracing.IsEnabled() { 1211 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Revert") 1212 defer func() { 1213 sc := -1 1214 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 1215 sc = result.FutureAPI.Response().StatusCode 1216 } 1217 tracing.EndSpan(ctx, sc, err) 1218 }() 1219 } 1220 if err := validation.Validate([]validation.Validation{ 1221 {TargetValue: resourceGroupName, 1222 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1223 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1224 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 1225 {TargetValue: poolName, 1226 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 1227 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1228 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 1229 {TargetValue: volumeName, 1230 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 1231 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1232 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 1233 return result, validation.NewError("netapp.VolumesClient", "Revert", err.Error()) 1234 } 1235 1236 req, err := client.RevertPreparer(ctx, resourceGroupName, accountName, poolName, volumeName, body) 1237 if err != nil { 1238 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", nil, "Failure preparing request") 1239 return 1240 } 1241 1242 result, err = client.RevertSender(req) 1243 if err != nil { 1244 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Revert", nil, "Failure sending request") 1245 return 1246 } 1247 1248 return 1249} 1250 1251// RevertPreparer prepares the Revert request. 1252func (client VolumesClient) RevertPreparer(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert) (*http.Request, error) { 1253 pathParameters := map[string]interface{}{ 1254 "accountName": autorest.Encode("path", accountName), 1255 "poolName": autorest.Encode("path", poolName), 1256 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1257 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1258 "volumeName": autorest.Encode("path", volumeName), 1259 } 1260 1261 const APIVersion = "2021-04-01" 1262 queryParameters := map[string]interface{}{ 1263 "api-version": APIVersion, 1264 } 1265 1266 preparer := autorest.CreatePreparer( 1267 autorest.AsContentType("application/json; charset=utf-8"), 1268 autorest.AsPost(), 1269 autorest.WithBaseURL(client.BaseURI), 1270 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revert", pathParameters), 1271 autorest.WithJSON(body), 1272 autorest.WithQueryParameters(queryParameters)) 1273 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1274} 1275 1276// RevertSender sends the Revert request. The method will close the 1277// http.Response Body if it receives an error. 1278func (client VolumesClient) RevertSender(req *http.Request) (future VolumesRevertFuture, err error) { 1279 var resp *http.Response 1280 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1281 if err != nil { 1282 return 1283 } 1284 var azf azure.Future 1285 azf, err = azure.NewFutureFromResponse(resp) 1286 future.FutureAPI = &azf 1287 future.Result = future.result 1288 return 1289} 1290 1291// RevertResponder handles the response to the Revert request. The method always 1292// closes the http.Response Body. 1293func (client VolumesClient) RevertResponder(resp *http.Response) (result autorest.Response, err error) { 1294 err = autorest.Respond( 1295 resp, 1296 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 1297 autorest.ByClosing()) 1298 result.Response = resp 1299 return 1300} 1301 1302// Update patch the specified volume 1303// Parameters: 1304// body - volume object supplied in the body of the operation. 1305// resourceGroupName - the name of the resource group. 1306// accountName - the name of the NetApp account 1307// poolName - the name of the capacity pool 1308// volumeName - the name of the volume 1309func (client VolumesClient) Update(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (result VolumesUpdateFuture, err error) { 1310 if tracing.IsEnabled() { 1311 ctx = tracing.StartSpan(ctx, fqdn+"/VolumesClient.Update") 1312 defer func() { 1313 sc := -1 1314 if result.FutureAPI != nil && result.FutureAPI.Response() != nil { 1315 sc = result.FutureAPI.Response().StatusCode 1316 } 1317 tracing.EndSpan(ctx, sc, err) 1318 }() 1319 } 1320 if err := validation.Validate([]validation.Validation{ 1321 {TargetValue: resourceGroupName, 1322 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, 1323 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1324 {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, 1325 {TargetValue: poolName, 1326 Constraints: []validation.Constraint{{Target: "poolName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 1327 {Target: "poolName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1328 {Target: "poolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}, 1329 {TargetValue: volumeName, 1330 Constraints: []validation.Constraint{{Target: "volumeName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 1331 {Target: "volumeName", Name: validation.MinLength, Rule: 1, Chain: nil}, 1332 {Target: "volumeName", Name: validation.Pattern, Rule: `^[a-zA-Z][a-zA-Z0-9\-_]{0,63}$`, Chain: nil}}}}); err != nil { 1333 return result, validation.NewError("netapp.VolumesClient", "Update", err.Error()) 1334 } 1335 1336 req, err := client.UpdatePreparer(ctx, body, resourceGroupName, accountName, poolName, volumeName) 1337 if err != nil { 1338 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure preparing request") 1339 return 1340 } 1341 1342 result, err = client.UpdateSender(req) 1343 if err != nil { 1344 err = autorest.NewErrorWithError(err, "netapp.VolumesClient", "Update", nil, "Failure sending request") 1345 return 1346 } 1347 1348 return 1349} 1350 1351// UpdatePreparer prepares the Update request. 1352func (client VolumesClient) UpdatePreparer(ctx context.Context, body VolumePatch, resourceGroupName string, accountName string, poolName string, volumeName string) (*http.Request, error) { 1353 pathParameters := map[string]interface{}{ 1354 "accountName": autorest.Encode("path", accountName), 1355 "poolName": autorest.Encode("path", poolName), 1356 "resourceGroupName": autorest.Encode("path", resourceGroupName), 1357 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 1358 "volumeName": autorest.Encode("path", volumeName), 1359 } 1360 1361 const APIVersion = "2021-04-01" 1362 queryParameters := map[string]interface{}{ 1363 "api-version": APIVersion, 1364 } 1365 1366 body.ID = nil 1367 body.Name = nil 1368 body.Type = nil 1369 preparer := autorest.CreatePreparer( 1370 autorest.AsContentType("application/json; charset=utf-8"), 1371 autorest.AsPatch(), 1372 autorest.WithBaseURL(client.BaseURI), 1373 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}", pathParameters), 1374 autorest.WithJSON(body), 1375 autorest.WithQueryParameters(queryParameters)) 1376 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1377} 1378 1379// UpdateSender sends the Update request. The method will close the 1380// http.Response Body if it receives an error. 1381func (client VolumesClient) UpdateSender(req *http.Request) (future VolumesUpdateFuture, err error) { 1382 var resp *http.Response 1383 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) 1384 if err != nil { 1385 return 1386 } 1387 var azf azure.Future 1388 azf, err = azure.NewFutureFromResponse(resp) 1389 future.FutureAPI = &azf 1390 future.Result = future.result 1391 return 1392} 1393 1394// UpdateResponder handles the response to the Update request. The method always 1395// closes the http.Response Body. 1396func (client VolumesClient) UpdateResponder(resp *http.Response) (result Volume, err error) { 1397 err = autorest.Respond( 1398 resp, 1399 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 1400 autorest.ByUnmarshallingJSON(&result), 1401 autorest.ByClosing()) 1402 result.Response = autorest.Response{Response: resp} 1403 return 1404} 1405