From 509b93958c517afd77967b02613b9271e316deb2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 16 Aug 2023 12:56:14 +0000 Subject: [PATCH] CodeGen from PR 25332 in Azure/azure-rest-api-specs Merge fea8254fdf67056cefe1b747d5b930f764e85d6e into 1df6d6f671dc5059016fbc2c0a624e01f0b2972c --- .../netapp/armnetapp/CHANGELOG.md | 44 + .../netapp/armnetapp/accountbackups_client.go | 241 --- .../accountbackups_client_example_test.go | 113 -- .../netapp/armnetapp/accounts_client.go | 112 +- .../armnetapp/accounts_client_example_test.go | 277 --- .../netapp/armnetapp/autorest.md | 7 +- .../netapp/armnetapp/backuppolicies_client.go | 89 +- .../backuppolicies_client_example_test.go | 217 --- .../netapp/armnetapp/backups_client.go | 556 +----- .../armnetapp/backups_client_example_test.go | 277 --- .../netapp/armnetapp/client_factory.go | 48 +- .../netapp/armnetapp/constants.go | 87 +- sdk/resourcemanager/netapp/armnetapp/go.mod | 16 +- sdk/resourcemanager/netapp/armnetapp/go.sum | 26 +- .../netapp/armnetapp/models.go | 698 +------- .../netapp/armnetapp/models_serde.go | 460 ++--- .../netapp/armnetapp/operations_client.go | 7 +- .../operations_client_example_test.go | 1590 ----------------- .../netapp/armnetapp/options.go | 465 +++++ .../netapp/armnetapp/pools_client.go | 89 +- .../armnetapp/pools_client_example_test.go | 201 --- .../netapp/armnetapp/resource_client.go | 207 ++- .../armnetapp/resource_client_example_test.go | 127 -- .../armnetapp/resourcequotalimits_client.go | 22 +- ...resourcequotalimits_client_example_test.go | 147 -- .../netapp/armnetapp/response_types.go | 121 +- .../armnetapp/snapshotpolicies_client.go | 100 +- .../snapshotpolicies_client_example_test.go | 346 ---- .../netapp/armnetapp/snapshots_client.go | 113 +- .../snapshots_client_example_test.go | 193 -- .../netapp/armnetapp/subvolumes_client.go | 108 +- .../subvolumes_client_example_test.go | 216 --- .../netapp/armnetapp/time_rfc3339.go | 3 +- .../netapp/armnetapp/volumegroups_client.go | 65 +- .../volumegroups_client_example_test.go | 265 --- .../armnetapp/volumequotarules_client.go | 89 +- .../volumequotarules_client_example_test.go | 195 -- .../netapp/armnetapp/volumes_client.go | 485 +++-- .../armnetapp/volumes_client_example_test.go | 598 ------- 39 files changed, 1891 insertions(+), 7129 deletions(-) delete mode 100644 sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go create mode 100644 sdk/resourcemanager/netapp/armnetapp/options.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go diff --git a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md index 212c66b4113d..d282e1abfa1f 100644 --- a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md +++ b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md @@ -1,5 +1,49 @@ # Release History +## 5.0.0 (2023-08-16) +### Breaking Changes + +- Enum `BackupType` has been removed +- Function `NewAccountBackupsClient` has been removed +- Function `*AccountBackupsClient.BeginDelete` has been removed +- Function `*AccountBackupsClient.Get` has been removed +- Function `*AccountBackupsClient.NewListPager` has been removed +- Function `*BackupsClient.BeginCreate` has been removed +- Function `*BackupsClient.BeginDelete` has been removed +- Function `*BackupsClient.Get` has been removed +- Function `*BackupsClient.GetStatus` has been removed +- Function `*BackupsClient.NewListPager` has been removed +- Function `*BackupsClient.BeginRestoreFiles` has been removed +- Function `*BackupsClient.BeginUpdate` has been removed +- Function `*ClientFactory.NewAccountBackupsClient` has been removed +- Struct `Backup` has been removed +- Struct `BackupPatch` has been removed +- Struct `BackupProperties` has been removed +- Struct `BackupRestoreFiles` has been removed +- Struct `BackupStatus` has been removed +- Struct `BackupsList` has been removed +- Struct `VolumeBackupProperties` has been removed +- Field `Backup` of struct `VolumePatchPropertiesDataProtection` has been removed +- Field `Backup` of struct `VolumePropertiesDataProtection` has been removed + +### Features Added + +- New value `ApplicationTypeORACLE` added to enum type `ApplicationType` +- New value `NetworkFeaturesBasicStandard`, `NetworkFeaturesStandardBasic` added to enum type `NetworkFeatures` +- New enum type `CoolAccessRetrievalPolicy` with values `CoolAccessRetrievalPolicyDefault`, `CoolAccessRetrievalPolicyNever`, `CoolAccessRetrievalPolicyOnRead` +- New enum type `NetworkSiblingSetProvisioningState` with values `NetworkSiblingSetProvisioningStateCanceled`, `NetworkSiblingSetProvisioningStateFailed`, `NetworkSiblingSetProvisioningStateSucceeded`, `NetworkSiblingSetProvisioningStateUpdating` +- New function `*ResourceClient.QueryNetworkSiblingSet(context.Context, string, QueryNetworkSiblingSetRequest, *ResourceClientQueryNetworkSiblingSetOptions) (ResourceClientQueryNetworkSiblingSetResponse, error)` +- New function `*ResourceClient.BeginUpdateNetworkSiblingSet(context.Context, string, UpdateNetworkSiblingSetRequest, *ResourceClientBeginUpdateNetworkSiblingSetOptions) (*runtime.Poller[ResourceClientUpdateNetworkSiblingSetResponse], error)` +- New function `*VolumesClient.PopulateAvailabilityZone(context.Context, string, string, string, string, *VolumesClientPopulateAvailabilityZoneOptions) (VolumesClientPopulateAvailabilityZoneResponse, error)` +- New struct `NetworkSiblingSet` +- New struct `NicInfo` +- New struct `QueryNetworkSiblingSetRequest` +- New struct `UpdateNetworkSiblingSetRequest` +- New field `Zones` in struct `VolumeGroupVolumeProperties` +- New field `CoolAccessRetrievalPolicy` in struct `VolumePatchProperties` +- New field `CoolAccessRetrievalPolicy` in struct `VolumeProperties` + + ## 4.1.0 (2023-07-28) ### Features Added diff --git a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go deleted file mode 100644 index 51b662f995a3..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go +++ /dev/null @@ -1,241 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AccountBackupsClient contains the methods for the AccountBackups group. -// Don't use this type directly, use NewAccountBackupsClient() instead. -type AccountBackupsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAccountBackupsClient creates a new instance of AccountBackupsClient with the specified values. -// - subscriptionID - The ID of the target subscription. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAccountBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountBackupsClient, error) { - cl, err := arm.NewClient(moduleName+".AccountBackupsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AccountBackupsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginDelete - Delete the specified Backup for a Netapp Account -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupName - The name of the backup -// - options - AccountBackupsClientBeginDeleteOptions contains the optional parameters for the AccountBackupsClient.BeginDelete -// method. -func (client *AccountBackupsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *AccountBackupsClientBeginDeleteOptions) (*runtime.Poller[AccountBackupsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, backupName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountBackupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[AccountBackupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Delete the specified Backup for a Netapp Account -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -func (client *AccountBackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *AccountBackupsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, backupName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *AccountBackupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *AccountBackupsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if backupName == "" { - return nil, errors.New("parameter backupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Gets the specified backup for a Netapp Account -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupName - The name of the backup -// - options - AccountBackupsClientGetOptions contains the optional parameters for the AccountBackupsClient.Get method. -func (client *AccountBackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *AccountBackupsClientGetOptions) (AccountBackupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, backupName, options) - if err != nil { - return AccountBackupsClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AccountBackupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AccountBackupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *AccountBackupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *AccountBackupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups/{backupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if backupName == "" { - return nil, errors.New("parameter backupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AccountBackupsClient) getHandleResponse(resp *http.Response) (AccountBackupsClientGetResponse, error) { - result := AccountBackupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Backup); err != nil { - return AccountBackupsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - List all Backups for a Netapp Account -// -// Generated from API version 2022-11-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - options - AccountBackupsClientListOptions contains the optional parameters for the AccountBackupsClient.NewListPager method. -func (client *AccountBackupsClient) NewListPager(resourceGroupName string, accountName string, options *AccountBackupsClientListOptions) *runtime.Pager[AccountBackupsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[AccountBackupsClientListResponse]{ - More: func(page AccountBackupsClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *AccountBackupsClientListResponse) (AccountBackupsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options) - if err != nil { - return AccountBackupsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AccountBackupsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AccountBackupsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *AccountBackupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountBackupsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/accountBackups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AccountBackupsClient) listHandleResponse(resp *http.Response) (AccountBackupsClientListResponse, error) { - result := AccountBackupsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BackupsList); err != nil { - return AccountBackupsClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go deleted file mode 100644 index aabacdb74c79..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client_example_test.go +++ /dev/null @@ -1,113 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Account_List.json -func ExampleAccountBackupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountBackupsClient().NewListPager("myRG", "account1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BackupsList = armnetapp.BackupsList{ - // Value: []*armnetapp.Backup{ - // { - // Name: to.Ptr("account1/backup1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/accountBackups"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/accountBackups/backup1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Account_Get.json -func ExampleAccountBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountBackupsClient().Get(ctx, "myRG", "account1", "backup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Backup = armnetapp.Backup{ - // Name: to.Ptr("account1/backup1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/accountBackups"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/accountBackups/backup1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Account_Delete.json -func ExampleAccountBackupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountBackupsClient().BeginDelete(ctx, "resourceGroup", "accountName", "backupName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/accounts_client.go b/sdk/resourcemanager/netapp/armnetapp/accounts_client.go index dd55ca0fdca9..fe8ffae8c5bf 100644 --- a/sdk/resourcemanager/netapp/armnetapp/accounts_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/accounts_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -47,7 +46,7 @@ func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create or update the specified NetApp account within the resource group // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - body - NetApp Account object supplied in the body of the operation. @@ -59,9 +58,10 @@ func (client *AccountsClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AccountsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *AccountsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update the specified NetApp account within the resource group // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *AccountsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, body Account, options *AccountsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -106,16 +108,19 @@ func (client *AccountsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete the specified NetApp account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - options - AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. @@ -125,9 +130,10 @@ func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AccountsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -136,20 +142,22 @@ func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete the specified NetApp account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *AccountsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -172,7 +180,7 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -180,23 +188,26 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the NetApp account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - options - AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. func (client *AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientGetOptions) (AccountsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { return AccountsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AccountsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccountsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -219,7 +230,7 @@ func (client *AccountsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +247,7 @@ func (client *AccountsClient) getHandleResponse(resp *http.Response) (AccountsCl // NewListPager - List and describe all NetApp accounts in the resource group. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. func (client *AccountsClient) NewListPager(resourceGroupName string, options *AccountsClientListOptions) *runtime.Pager[AccountsClientListResponse] { @@ -283,7 +294,7 @@ func (client *AccountsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +311,7 @@ func (client *AccountsClient) listHandleResponse(resp *http.Response) (AccountsC // NewListBySubscriptionPager - List and describe all NetApp accounts in the subscription. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - options - AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.NewListBySubscriptionPager // method. func (client *AccountsClient) NewListBySubscriptionPager(options *AccountsClientListBySubscriptionOptions) *runtime.Pager[AccountsClientListBySubscriptionResponse] { @@ -343,7 +354,7 @@ func (client *AccountsClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -363,7 +374,7 @@ func (client *AccountsClient) listBySubscriptionHandleResponse(resp *http.Respon // operation will fix it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - options - AccountsClientBeginRenewCredentialsOptions contains the optional parameters for the AccountsClient.BeginRenewCredentials @@ -374,9 +385,10 @@ func (client *AccountsClient) BeginRenewCredentials(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientRenewCredentialsResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientRenewCredentialsResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AccountsClientRenewCredentialsResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -387,20 +399,22 @@ func (client *AccountsClient) BeginRenewCredentials(ctx context.Context, resourc // operation will fix it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *AccountsClient) renewCredentials(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginRenewCredentialsOptions) (*http.Response, error) { + var err error req, err := client.renewCredentialsCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // renewCredentialsCreateRequest creates the RenewCredentials request. @@ -423,7 +437,7 @@ func (client *AccountsClient) renewCredentialsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -431,7 +445,7 @@ func (client *AccountsClient) renewCredentialsCreateRequest(ctx context.Context, // BeginUpdate - Patch the specified NetApp account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - body - NetApp Account object supplied in the body of the operation. @@ -442,9 +456,10 @@ func (client *AccountsClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AccountsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -453,20 +468,22 @@ func (client *AccountsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Patch the specified NetApp account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *AccountsClient) update(ctx context.Context, resourceGroupName string, accountName string, body AccountPatch, options *AccountsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -489,8 +506,11 @@ func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go deleted file mode 100644 index 54684e45d737..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go +++ /dev/null @@ -1,277 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_List.json -func ExampleAccountsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AccountList = armnetapp.AccountList{ - // Value: []*armnetapp.Account{ - // { - // Name: to.Ptr("account1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.AccountProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_Get.json -func ExampleAccountsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountsClient().Get(ctx, "myRG", "account1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Account = armnetapp.Account{ - // Name: to.Ptr("account1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.AccountProperties{ - // ActiveDirectories: []*armnetapp.ActiveDirectory{ - // { - // ActiveDirectoryID: to.Ptr("02da3711-6c58-2d64-098a-e3af7afaf936"), - // AesEncryption: to.Ptr(true), - // DNS: to.Ptr("10.10.10.3, 10.10.10.4"), - // Domain: to.Ptr("10.10.10.3"), - // LdapSigning: to.Ptr(true), - // OrganizationalUnit: to.Ptr("OU=Engineering"), - // Site: to.Ptr("SiteName"), - // SmbServerName: to.Ptr("SMBServer"), - // Status: to.Ptr(armnetapp.ActiveDirectoryStatusInUse), - // StatusDetails: to.Ptr("Status Details"), - // Username: to.Ptr("ad_user_name"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_CreateOrUpdate.json -func ExampleAccountsClient_BeginCreateOrUpdate_accountsCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", armnetapp.Account{ - Location: to.Ptr("eastus"), - Properties: &armnetapp.AccountProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Account = armnetapp.Account{ - // Name: to.Ptr("account1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.AccountProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_CreateOrUpdateAD.json -func ExampleAccountsClient_BeginCreateOrUpdate_accountsCreateOrUpdateWithActiveDirectory() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", armnetapp.Account{ - Location: to.Ptr("eastus"), - Properties: &armnetapp.AccountProperties{ - ActiveDirectories: []*armnetapp.ActiveDirectory{ - { - AesEncryption: to.Ptr(true), - DNS: to.Ptr("10.10.10.3, 10.10.10.4"), - Domain: to.Ptr("10.10.10.3"), - LdapOverTLS: to.Ptr(false), - LdapSigning: to.Ptr(false), - OrganizationalUnit: to.Ptr("OU=Engineering"), - Password: to.Ptr("ad_password"), - Site: to.Ptr("SiteName"), - SmbServerName: to.Ptr("SMBServer"), - Username: to.Ptr("ad_user_name"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Account = armnetapp.Account{ - // Name: to.Ptr("account1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.AccountProperties{ - // ActiveDirectories: []*armnetapp.ActiveDirectory{ - // { - // ActiveDirectoryID: to.Ptr("503d38f9-f17c-f92d-ef26-b0d46374534b"), - // AesEncryption: to.Ptr(true), - // DNS: to.Ptr("10.10.10.3, 10.10.10.4"), - // Domain: to.Ptr("10.10.10.3"), - // LdapOverTLS: to.Ptr(false), - // LdapSigning: to.Ptr(false), - // OrganizationalUnit: to.Ptr("OU=Engineering"), - // Site: to.Ptr("SiteName"), - // SmbServerName: to.Ptr("SMBServer"), - // Username: to.Ptr("ad_user_name"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_Delete.json -func ExampleAccountsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginDelete(ctx, "myRG", "account1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_Update.json -func ExampleAccountsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginUpdate(ctx, "myRG", "account1", armnetapp.AccountPatch{ - Tags: map[string]*string{ - "Tag1": to.Ptr("Value1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Account = armnetapp.Account{ - // Name: to.Ptr("account1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.AccountProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Accounts_RenewCredentials.json -func ExampleAccountsClient_BeginRenewCredentials() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAccountsClient().BeginRenewCredentials(ctx, "myRG", "account1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/autorest.md b/sdk/resourcemanager/netapp/armnetapp/autorest.md index 7192769656a1..871acc834888 100644 --- a/sdk/resourcemanager/netapp/armnetapp/autorest.md +++ b/sdk/resourcemanager/netapp/armnetapp/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/netapp/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/netapp/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 4.1.0 -tag: package-netapp-2022-11-01 +module-version: 5.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go index e74d743002f8..96f7775d0f52 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -47,7 +46,7 @@ func NewBackupPoliciesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreate - Create a backup policy for Netapp Account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - backupPolicyName - Backup policy Name which uniquely identify backup policy. @@ -60,9 +59,10 @@ func (client *BackupPoliciesClient) BeginCreate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupPoliciesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupPoliciesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[BackupPoliciesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *BackupPoliciesClient) BeginCreate(ctx context.Context, resourceGro // Create - Create a backup policy for Netapp Account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *BackupPoliciesClient) create(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy, options *BackupPoliciesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, backupPolicyName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -111,16 +113,19 @@ func (client *BackupPoliciesClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete backup policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - backupPolicyName - Backup policy Name which uniquely identify backup policy. @@ -132,9 +137,10 @@ func (client *BackupPoliciesClient) BeginDelete(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupPoliciesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupPoliciesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[BackupPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,20 +149,22 @@ func (client *BackupPoliciesClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete backup policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *BackupPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, options *BackupPoliciesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, backupPolicyName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -183,7 +191,7 @@ func (client *BackupPoliciesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -191,24 +199,27 @@ func (client *BackupPoliciesClient) deleteCreateRequest(ctx context.Context, res // Get - Get a particular backup Policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - backupPolicyName - Backup policy Name which uniquely identify backup policy. // - options - BackupPoliciesClientGetOptions contains the optional parameters for the BackupPoliciesClient.Get method. func (client *BackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, options *BackupPoliciesClientGetOptions) (BackupPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, backupPolicyName, options) if err != nil { return BackupPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -235,7 +246,7 @@ func (client *BackupPoliciesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +263,7 @@ func (client *BackupPoliciesClient) getHandleResponse(resp *http.Response) (Back // NewListPager - List backup policies for Netapp Account // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - options - BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. @@ -298,7 +309,7 @@ func (client *BackupPoliciesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +327,7 @@ func (client *BackupPoliciesClient) listHandleResponse(resp *http.Response) (Bac // BeginUpdate - Patch a backup policy for Netapp Account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - backupPolicyName - Backup policy Name which uniquely identify backup policy. @@ -329,9 +340,10 @@ func (client *BackupPoliciesClient) BeginUpdate(ctx context.Context, resourceGro if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupPoliciesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupPoliciesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[BackupPoliciesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -340,20 +352,22 @@ func (client *BackupPoliciesClient) BeginUpdate(ctx context.Context, resourceGro // Update - Patch a backup policy for Netapp Account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *BackupPoliciesClient) update(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch, options *BackupPoliciesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, backupPolicyName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -380,8 +394,11 @@ func (client *BackupPoliciesClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go deleted file mode 100644 index 3288ec562ac7..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client_example_test.go +++ /dev/null @@ -1,217 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/BackupPolicies_List.json -func ExampleBackupPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupPoliciesClient().NewListPager("myRG", "account1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BackupPoliciesList = armnetapp.BackupPoliciesList{ - // Value: []*armnetapp.BackupPolicy{ - // { - // Name: to.Ptr("account1/backupPolicy1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicy1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.BackupPolicyProperties{ - // DailyBackupsToKeep: to.Ptr[int32](10), - // Enabled: to.Ptr(true), - // MonthlyBackupsToKeep: to.Ptr[int32](10), - // VolumesAssigned: to.Ptr[int32](0), - // WeeklyBackupsToKeep: to.Ptr[int32](10), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/BackupPolicies_Get.json -func ExampleBackupPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupPoliciesClient().Get(ctx, "myRG", "account1", "backupPolicyName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupPolicy = armnetapp.BackupPolicy{ - // Name: to.Ptr("account1/backupPolicyName"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicyName"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.BackupPolicyProperties{ - // DailyBackupsToKeep: to.Ptr[int32](10), - // Enabled: to.Ptr(true), - // MonthlyBackupsToKeep: to.Ptr[int32](10), - // VolumeBackups: []*armnetapp.VolumeBackups{ - // { - // BackupsCount: to.Ptr[int32](5), - // PolicyEnabled: to.Ptr(true), - // VolumeName: to.Ptr("volume 1"), - // }}, - // VolumesAssigned: to.Ptr[int32](0), - // WeeklyBackupsToKeep: to.Ptr[int32](10), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/BackupPolicies_Create.json -func ExampleBackupPoliciesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBackupPoliciesClient().BeginCreate(ctx, "myRG", "account1", "backupPolicyName", armnetapp.BackupPolicy{ - Location: to.Ptr("westus"), - Properties: &armnetapp.BackupPolicyProperties{ - DailyBackupsToKeep: to.Ptr[int32](10), - Enabled: to.Ptr(true), - MonthlyBackupsToKeep: to.Ptr[int32](10), - WeeklyBackupsToKeep: to.Ptr[int32](10), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupPolicy = armnetapp.BackupPolicy{ - // Name: to.Ptr("account1/backupPolicyName"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicyName"), - // Location: to.Ptr("westus"), - // Properties: &armnetapp.BackupPolicyProperties{ - // DailyBackupsToKeep: to.Ptr[int32](10), - // Enabled: to.Ptr(true), - // MonthlyBackupsToKeep: to.Ptr[int32](10), - // ProvisioningState: to.Ptr("Succeeded"), - // WeeklyBackupsToKeep: to.Ptr[int32](10), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/BackupPolicies_Update.json -func ExampleBackupPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBackupPoliciesClient().BeginUpdate(ctx, "myRG", "account1", "backupPolicyName", armnetapp.BackupPolicyPatch{ - Location: to.Ptr("westus"), - Properties: &armnetapp.BackupPolicyProperties{ - DailyBackupsToKeep: to.Ptr[int32](5), - Enabled: to.Ptr(false), - MonthlyBackupsToKeep: to.Ptr[int32](10), - WeeklyBackupsToKeep: to.Ptr[int32](10), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupPolicy = armnetapp.BackupPolicy{ - // Name: to.Ptr("account1/backupPolicyName"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolocies/backupPolicyName"), - // Location: to.Ptr("westus"), - // Properties: &armnetapp.BackupPolicyProperties{ - // DailyBackupsToKeep: to.Ptr[int32](5), - // Enabled: to.Ptr(false), - // MonthlyBackupsToKeep: to.Ptr[int32](10), - // ProvisioningState: to.Ptr("Succeeded"), - // VolumeBackups: []*armnetapp.VolumeBackups{ - // { - // BackupsCount: to.Ptr[int32](5), - // PolicyEnabled: to.Ptr(true), - // VolumeName: to.Ptr("volume 1"), - // }}, - // VolumesAssigned: to.Ptr[int32](1), - // WeeklyBackupsToKeep: to.Ptr[int32](10), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/BackupPolicies_Delete.json -func ExampleBackupPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBackupPoliciesClient().BeginDelete(ctx, "resourceGroup", "accountName", "backupPolicyName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/backups_client.go b/sdk/resourcemanager/netapp/armnetapp/backups_client.go index b6432e871938..33e217355040 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backups_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/backups_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -44,311 +43,10 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } -// BeginCreate - Create a backup for the volume -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - poolName - The name of the capacity pool -// - volumeName - The name of the volume -// - backupName - The name of the backup -// - body - Backup object supplied in the body of the operation. -// - options - BackupsClientBeginCreateOptions contains the optional parameters for the BackupsClient.BeginCreate method. -func (client *BackupsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup, options *BackupsClientBeginCreateOptions) (*runtime.Poller[BackupsClientCreateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[BackupsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Create - Create a backup for the volume -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -func (client *BackupsClient) create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup, options *BackupsClientBeginCreateOptions) (*http.Response, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createCreateRequest creates the Create request. -func (client *BackupsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body Backup, options *BackupsClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if poolName == "" { - return nil, errors.New("parameter poolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - if volumeName == "" { - return nil, errors.New("parameter volumeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - if backupName == "" { - return nil, errors.New("parameter backupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) -} - -// BeginDelete - Delete a backup of the volume -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - poolName - The name of the capacity pool -// - volumeName - The name of the volume -// - backupName - The name of the backup -// - options - BackupsClientBeginDeleteOptions contains the optional parameters for the BackupsClient.BeginDelete method. -func (client *BackupsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, options *BackupsClientBeginDeleteOptions) (*runtime.Poller[BackupsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[BackupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Delete - Delete a backup of the volume -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -func (client *BackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, options *BackupsClientBeginDeleteOptions) (*http.Response, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *BackupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, options *BackupsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if poolName == "" { - return nil, errors.New("parameter poolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - if volumeName == "" { - return nil, errors.New("parameter volumeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - if backupName == "" { - return nil, errors.New("parameter backupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Gets the specified backup of the volume -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - poolName - The name of the capacity pool -// - volumeName - The name of the volume -// - backupName - The name of the backup -// - options - BackupsClientGetOptions contains the optional parameters for the BackupsClient.Get method. -func (client *BackupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, options *BackupsClientGetOptions) (BackupsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, options) - if err != nil { - return BackupsClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return BackupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, options *BackupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if poolName == "" { - return nil, errors.New("parameter poolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - if volumeName == "" { - return nil, errors.New("parameter volumeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - if backupName == "" { - return nil, errors.New("parameter backupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *BackupsClient) getHandleResponse(resp *http.Response) (BackupsClientGetResponse, error) { - result := BackupsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Backup); err != nil { - return BackupsClientGetResponse{}, err - } - return result, nil -} - -// GetStatus - Get the status of the backup for a volume -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - poolName - The name of the capacity pool -// - volumeName - The name of the volume -// - options - BackupsClientGetStatusOptions contains the optional parameters for the BackupsClient.GetStatus method. -func (client *BackupsClient) GetStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *BackupsClientGetStatusOptions) (BackupsClientGetStatusResponse, error) { - req, err := client.getStatusCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) - if err != nil { - return BackupsClientGetStatusResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return BackupsClientGetStatusResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupsClientGetStatusResponse{}, runtime.NewResponseError(resp) - } - return client.getStatusHandleResponse(resp) -} - -// getStatusCreateRequest creates the GetStatus request. -func (client *BackupsClient) getStatusCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *BackupsClientGetStatusOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if poolName == "" { - return nil, errors.New("parameter poolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - if volumeName == "" { - return nil, errors.New("parameter volumeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getStatusHandleResponse handles the GetStatus response. -func (client *BackupsClient) getStatusHandleResponse(resp *http.Response) (BackupsClientGetStatusResponse, error) { - result := BackupsClientGetStatusResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BackupStatus); err != nil { - return BackupsClientGetStatusResponse{}, err - } - return result, nil -} - // GetVolumeRestoreStatus - Get the status of the restore for a volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -356,18 +54,21 @@ func (client *BackupsClient) getStatusHandleResponse(resp *http.Response) (Backu // - options - BackupsClientGetVolumeRestoreStatusOptions contains the optional parameters for the BackupsClient.GetVolumeRestoreStatus // method. func (client *BackupsClient) GetVolumeRestoreStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *BackupsClientGetVolumeRestoreStatusOptions) (BackupsClientGetVolumeRestoreStatusResponse, error) { + var err error req, err := client.getVolumeRestoreStatusCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return BackupsClientGetVolumeRestoreStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupsClientGetVolumeRestoreStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupsClientGetVolumeRestoreStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupsClientGetVolumeRestoreStatusResponse{}, err } - return client.getVolumeRestoreStatusHandleResponse(resp) + resp, err := client.getVolumeRestoreStatusHandleResponse(httpResp) + return resp, err } // getVolumeRestoreStatusCreateRequest creates the GetVolumeRestoreStatus request. @@ -398,7 +99,7 @@ func (client *BackupsClient) getVolumeRestoreStatusCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -412,240 +113,3 @@ func (client *BackupsClient) getVolumeRestoreStatusHandleResponse(resp *http.Res } return result, nil } - -// NewListPager - List all backups for a volume -// -// Generated from API version 2022-11-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - poolName - The name of the capacity pool -// - volumeName - The name of the volume -// - options - BackupsClientListOptions contains the optional parameters for the BackupsClient.NewListPager method. -func (client *BackupsClient) NewListPager(resourceGroupName string, accountName string, poolName string, volumeName string, options *BackupsClientListOptions) *runtime.Pager[BackupsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[BackupsClientListResponse]{ - More: func(page BackupsClientListResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *BackupsClientListResponse) (BackupsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) - if err != nil { - return BackupsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return BackupsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *BackupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *BackupsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if poolName == "" { - return nil, errors.New("parameter poolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - if volumeName == "" { - return nil, errors.New("parameter volumeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *BackupsClient) listHandleResponse(resp *http.Response) (BackupsClientListResponse, error) { - result := BackupsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BackupsList); err != nil { - return BackupsClientListResponse{}, err - } - return result, nil -} - -// BeginRestoreFiles - Restore the specified files from the specified backup to the active filesystem -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - poolName - The name of the capacity pool -// - volumeName - The name of the volume -// - backupName - The name of the backup -// - body - Restore payload supplied in the body of the operation. -// - options - BackupsClientBeginRestoreFilesOptions contains the optional parameters for the BackupsClient.BeginRestoreFiles -// method. -func (client *BackupsClient) BeginRestoreFiles(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupRestoreFiles, options *BackupsClientBeginRestoreFilesOptions) (*runtime.Poller[BackupsClientRestoreFilesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restoreFiles(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientRestoreFilesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[BackupsClientRestoreFilesResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// RestoreFiles - Restore the specified files from the specified backup to the active filesystem -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -func (client *BackupsClient) restoreFiles(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupRestoreFiles, options *BackupsClientBeginRestoreFilesOptions) (*http.Response, error) { - req, err := client.restoreFilesCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// restoreFilesCreateRequest creates the RestoreFiles request. -func (client *BackupsClient) restoreFilesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupRestoreFiles, options *BackupsClientBeginRestoreFilesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}/restoreFiles" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if poolName == "" { - return nil, errors.New("parameter poolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - if volumeName == "" { - return nil, errors.New("parameter volumeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - if backupName == "" { - return nil, errors.New("parameter backupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, body) -} - -// BeginUpdate - Patch a backup for the volume -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - poolName - The name of the capacity pool -// - volumeName - The name of the volume -// - backupName - The name of the backup -// - body - Backup object supplied in the body of the operation. -// - options - BackupsClientBeginUpdateOptions contains the optional parameters for the BackupsClient.BeginUpdate method. -func (client *BackupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupPatch, options *BackupsClientBeginUpdateOptions) (*runtime.Poller[BackupsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) - if err != nil { - return nil, err - } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - }) - } else { - return runtime.NewPollerFromResumeToken[BackupsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Update - Patch a backup for the volume -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-01 -func (client *BackupsClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupPatch, options *BackupsClientBeginUpdateOptions) (*http.Response, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, backupName, body, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// updateCreateRequest creates the Update request. -func (client *BackupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, backupName string, body BackupPatch, options *BackupsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backups/{backupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if accountName == "" { - return nil, errors.New("parameter accountName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) - if poolName == "" { - return nil, errors.New("parameter poolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) - if volumeName == "" { - return nil, errors.New("parameter volumeName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) - if backupName == "" { - return nil, errors.New("parameter backupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupName}", url.PathEscape(backupName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) -} diff --git a/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go deleted file mode 100644 index 22382cbcd597..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go +++ /dev/null @@ -1,277 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_BackupStatus.json -func ExampleBackupsClient_GetStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupsClient().GetStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupStatus = armnetapp.BackupStatus{ - // ErrorMessage: to.Ptr(""), - // Healthy: to.Ptr(true), - // LastTransferSize: to.Ptr[int64](100000), - // LastTransferType: to.Ptr(""), - // MirrorState: to.Ptr(armnetapp.MirrorStateMirrored), - // RelationshipStatus: to.Ptr(armnetapp.RelationshipStatusIdle), - // TotalTransferBytes: to.Ptr[int64](100000), - // UnhealthyReason: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_RestoreStatus.json -func ExampleBackupsClient_GetVolumeRestoreStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupsClient().GetVolumeRestoreStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestoreStatus = armnetapp.RestoreStatus{ - // ErrorMessage: to.Ptr(""), - // Healthy: to.Ptr(true), - // MirrorState: to.Ptr(armnetapp.MirrorStateUninitialized), - // RelationshipStatus: to.Ptr(armnetapp.RelationshipStatusIdle), - // TotalTransferBytes: to.Ptr[int64](100000), - // UnhealthyReason: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_List.json -func ExampleBackupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupsClient().NewListPager("myRG", "account1", "pool1", "volume1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BackupsList = armnetapp.BackupsList{ - // Value: []*armnetapp.Backup{ - // { - // Name: to.Ptr("account1/pool1/volume1/backup1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/backups/backup1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Get.json -func ExampleBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupsClient().Get(ctx, "myRG", "account1", "pool1", "volume1", "backup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Backup = armnetapp.Backup{ - // Name: to.Ptr("account1/pool1/volume1/backup1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/backups/backup1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Create.json -func ExampleBackupsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBackupsClient().BeginCreate(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.Backup{ - Location: to.Ptr("eastus"), - Properties: &armnetapp.BackupProperties{ - Label: to.Ptr("myLabel"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Backup = armnetapp.Backup{ - // Name: to.Ptr("account1/pool1/volume1/backup1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/backups/backup1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Update.json -func ExampleBackupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBackupsClient().BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.BackupPatch{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Backup = armnetapp.Backup{ - // Name: to.Ptr("account1/pool1/volume1/backup1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/backups/backup1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_Delete.json -func ExampleBackupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBackupsClient().BeginDelete(ctx, "resourceGroup", "accountName", "poolName", "volumeName", "backupName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Backups_SingleFileRestore.json -func ExampleBackupsClient_BeginRestoreFiles() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewBackupsClient().BeginRestoreFiles(ctx, "myRG", "account1", "pool1", "volume1", "backup1", armnetapp.BackupRestoreFiles{ - DestinationVolumeID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), - FileList: []*string{ - to.Ptr("/dir1/customer1.db"), - to.Ptr("/dir1/customer2.db")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/client_factory.go b/sdk/resourcemanager/netapp/armnetapp/client_factory.go index bbbdde7e9002..5d375dac211d 100644 --- a/sdk/resourcemanager/netapp/armnetapp/client_factory.go +++ b/sdk/resourcemanager/netapp/armnetapp/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -38,23 +37,23 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewAccountsClient() *AccountsClient { + subClient, _ := NewAccountsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewResourceClient() *ResourceClient { - subClient, _ := NewResourceClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupPoliciesClient() *BackupPoliciesClient { + subClient, _ := NewBackupPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewResourceQuotaLimitsClient() *ResourceQuotaLimitsClient { - subClient, _ := NewResourceQuotaLimitsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupsClient() *BackupsClient { + subClient, _ := NewBackupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAccountsClient() *AccountsClient { - subClient, _ := NewAccountsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } @@ -63,13 +62,13 @@ func (c *ClientFactory) NewPoolsClient() *PoolsClient { return subClient } -func (c *ClientFactory) NewVolumesClient() *VolumesClient { - subClient, _ := NewVolumesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewResourceClient() *ResourceClient { + subClient, _ := NewResourceClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient { - subClient, _ := NewSnapshotsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewResourceQuotaLimitsClient() *ResourceQuotaLimitsClient { + subClient, _ := NewResourceQuotaLimitsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -78,18 +77,18 @@ func (c *ClientFactory) NewSnapshotPoliciesClient() *SnapshotPoliciesClient { return subClient } -func (c *ClientFactory) NewBackupsClient() *BackupsClient { - subClient, _ := NewBackupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient { + subClient, _ := NewSnapshotsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAccountBackupsClient() *AccountBackupsClient { - subClient, _ := NewAccountBackupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSubvolumesClient() *SubvolumesClient { + subClient, _ := NewSubvolumesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupPoliciesClient() *BackupPoliciesClient { - subClient, _ := NewBackupPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVolumeGroupsClient() *VolumeGroupsClient { + subClient, _ := NewVolumeGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -98,12 +97,7 @@ func (c *ClientFactory) NewVolumeQuotaRulesClient() *VolumeQuotaRulesClient { return subClient } -func (c *ClientFactory) NewVolumeGroupsClient() *VolumeGroupsClient { - subClient, _ := NewVolumeGroupsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewSubvolumesClient() *SubvolumesClient { - subClient, _ := NewSubvolumesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVolumesClient() *VolumesClient { + subClient, _ := NewVolumesClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/netapp/armnetapp/constants.go b/sdk/resourcemanager/netapp/armnetapp/constants.go index 08ac5d44ad0a..a6a6fbfe4939 100644 --- a/sdk/resourcemanager/netapp/armnetapp/constants.go +++ b/sdk/resourcemanager/netapp/armnetapp/constants.go @@ -3,15 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp const ( moduleName = "armnetapp" - moduleVersion = "v4.1.0" + moduleVersion = "v5.0.0" ) // ActiveDirectoryStatus - Status of the Active Directory @@ -45,12 +44,14 @@ func PossibleActiveDirectoryStatusValues() []ActiveDirectoryStatus { type ApplicationType string const ( + ApplicationTypeORACLE ApplicationType = "ORACLE" ApplicationTypeSAPHANA ApplicationType = "SAP-HANA" ) // PossibleApplicationTypeValues returns the possible values for the ApplicationType const type. func PossibleApplicationTypeValues() []ApplicationType { return []ApplicationType{ + ApplicationTypeORACLE, ApplicationTypeSAPHANA, } } @@ -73,24 +74,6 @@ func PossibleAvsDataStoreValues() []AvsDataStore { } } -// BackupType - Type of backup Manual or Scheduled -type BackupType string - -const ( - // BackupTypeManual - Manual backup - BackupTypeManual BackupType = "Manual" - // BackupTypeScheduled - Scheduled backup - BackupTypeScheduled BackupType = "Scheduled" -) - -// PossibleBackupTypeValues returns the possible values for the BackupType const type. -func PossibleBackupTypeValues() []BackupType { - return []BackupType{ - BackupTypeManual, - BackupTypeScheduled, - } -} - // CheckNameResourceTypes - Resource type used for verification. type CheckNameResourceTypes string @@ -149,6 +132,28 @@ func PossibleChownModeValues() []ChownMode { } } +// CoolAccessRetrievalPolicy - coolAccessRetrievalPolicy determines the data retrieval behavior from the cool tier to standard +// storage based on the read pattern for cool access enabled volumes. The possible values for this field +// are: Default - Data will be pulled from cool tier to standard storage on random reads. This policy is the default. OnRead +// - All client-driven data read is pulled from cool tier to standard storage on +// both sequential and random reads. Never - No client-driven data is pulled from cool tier to standard storage. +type CoolAccessRetrievalPolicy string + +const ( + CoolAccessRetrievalPolicyDefault CoolAccessRetrievalPolicy = "Default" + CoolAccessRetrievalPolicyNever CoolAccessRetrievalPolicy = "Never" + CoolAccessRetrievalPolicyOnRead CoolAccessRetrievalPolicy = "OnRead" +) + +// PossibleCoolAccessRetrievalPolicyValues returns the possible values for the CoolAccessRetrievalPolicy const type. +func PossibleCoolAccessRetrievalPolicyValues() []CoolAccessRetrievalPolicy { + return []CoolAccessRetrievalPolicy{ + CoolAccessRetrievalPolicyDefault, + CoolAccessRetrievalPolicyNever, + CoolAccessRetrievalPolicyOnRead, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -374,21 +379,47 @@ func PossibleMirrorStateValues() []MirrorState { } } -// NetworkFeatures - Basic network, or Standard features available to the volume. +// NetworkFeatures - Network features available to the volume, or current state of update. type NetworkFeatures string const ( - // NetworkFeaturesBasic - Basic network feature. + // NetworkFeaturesBasic - Basic network features. NetworkFeaturesBasic NetworkFeatures = "Basic" - // NetworkFeaturesStandard - Standard network feature. + // NetworkFeaturesBasicStandard - Updating from Basic to Standard network features. + NetworkFeaturesBasicStandard NetworkFeatures = "Basic_Standard" + // NetworkFeaturesStandard - Standard network features. NetworkFeaturesStandard NetworkFeatures = "Standard" + // NetworkFeaturesStandardBasic - Updating from Standard to Basic network features. + NetworkFeaturesStandardBasic NetworkFeatures = "Standard_Basic" ) // PossibleNetworkFeaturesValues returns the possible values for the NetworkFeatures const type. func PossibleNetworkFeaturesValues() []NetworkFeatures { return []NetworkFeatures{ NetworkFeaturesBasic, + NetworkFeaturesBasicStandard, NetworkFeaturesStandard, + NetworkFeaturesStandardBasic, + } +} + +// NetworkSiblingSetProvisioningState - Gets the status of the NetworkSiblingSet at the time the operation was called. +type NetworkSiblingSetProvisioningState string + +const ( + NetworkSiblingSetProvisioningStateCanceled NetworkSiblingSetProvisioningState = "Canceled" + NetworkSiblingSetProvisioningStateFailed NetworkSiblingSetProvisioningState = "Failed" + NetworkSiblingSetProvisioningStateSucceeded NetworkSiblingSetProvisioningState = "Succeeded" + NetworkSiblingSetProvisioningStateUpdating NetworkSiblingSetProvisioningState = "Updating" +) + +// PossibleNetworkSiblingSetProvisioningStateValues returns the possible values for the NetworkSiblingSetProvisioningState const type. +func PossibleNetworkSiblingSetProvisioningStateValues() []NetworkSiblingSetProvisioningState { + return []NetworkSiblingSetProvisioningState{ + NetworkSiblingSetProvisioningStateCanceled, + NetworkSiblingSetProvisioningStateFailed, + NetworkSiblingSetProvisioningStateSucceeded, + NetworkSiblingSetProvisioningStateUpdating, } } @@ -398,10 +429,10 @@ type ProvisioningState string const ( ProvisioningStateAccepted ProvisioningState = "Accepted" ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStatePatching ProvisioningState = "Patching" ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateMoving ProvisioningState = "Moving" ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateMoving ProvisioningState = "Moving" + ProvisioningStatePatching ProvisioningState = "Patching" ProvisioningStateSucceeded ProvisioningState = "Succeeded" ) @@ -410,10 +441,10 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ ProvisioningStateAccepted, ProvisioningStateCreating, - ProvisioningStatePatching, ProvisioningStateDeleting, - ProvisioningStateMoving, ProvisioningStateFailed, + ProvisioningStateMoving, + ProvisioningStatePatching, ProvisioningStateSucceeded, } } diff --git a/sdk/resourcemanager/netapp/armnetapp/go.mod b/sdk/resourcemanager/netapp/armnetapp/go.mod index b7d2e4fa7ecc..4984fd9ada2a 100644 --- a/sdk/resourcemanager/netapp/armnetapp/go.mod +++ b/sdk/resourcemanager/netapp/armnetapp/go.mod @@ -1,21 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v5 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.7.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/netapp/armnetapp/go.sum b/sdk/resourcemanager/netapp/armnetapp/go.sum index 21718b486698..727ce838bdc8 100644 --- a/sdk/resourcemanager/netapp/armnetapp/go.sum +++ b/sdk/resourcemanager/netapp/armnetapp/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 h1:8kDqDngH+DmVBiCtIjCFTGa7MBnsIOkF9IccInFEbjk= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/netapp/armnetapp/models.go b/sdk/resourcemanager/netapp/armnetapp/models.go index ab02fd64ee67..97c7ea452256 100644 --- a/sdk/resourcemanager/netapp/armnetapp/models.go +++ b/sdk/resourcemanager/netapp/armnetapp/models.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -41,22 +40,6 @@ type Account struct { Type *string } -// AccountBackupsClientBeginDeleteOptions contains the optional parameters for the AccountBackupsClient.BeginDelete method. -type AccountBackupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccountBackupsClientGetOptions contains the optional parameters for the AccountBackupsClient.Get method. -type AccountBackupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AccountBackupsClientListOptions contains the optional parameters for the AccountBackupsClient.NewListPager method. -type AccountBackupsClientListOptions struct { - // placeholder for future optional parameters -} - // AccountEncryption - Encryption settings type AccountEncryption struct { // Identity used to authenticate to KeyVault. Applicable if keySource is 'Microsoft.KeyVault'. @@ -117,47 +100,6 @@ type AccountProperties struct { ProvisioningState *string } -// AccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the AccountsClient.BeginCreateOrUpdate method. -type AccountsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. -type AccountsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccountsClientBeginRenewCredentialsOptions contains the optional parameters for the AccountsClient.BeginRenewCredentials -// method. -type AccountsClientBeginRenewCredentialsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method. -type AccountsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. -type AccountsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.NewListBySubscriptionPager -// method. -type AccountsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. -type AccountsClientListOptions struct { - // placeholder for future optional parameters -} - // ActiveDirectory - Active Directory type ActiveDirectory struct { // Id of the Active Directory @@ -241,64 +183,6 @@ type AuthorizeRequest struct { RemoteVolumeResourceID *string } -// Backup of a Volume -type Backup struct { - // REQUIRED; Resource location - Location *string - - // REQUIRED; Backup Properties - Properties *BackupProperties - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// BackupPatch - Backup patch -type BackupPatch struct { - // Backup Properties - Properties *BackupProperties - - // Resource tags - Tags map[string]*string -} - -// BackupPoliciesClientBeginCreateOptions contains the optional parameters for the BackupPoliciesClient.BeginCreate method. -type BackupPoliciesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupPoliciesClientBeginDeleteOptions contains the optional parameters for the BackupPoliciesClient.BeginDelete method. -type BackupPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupPoliciesClientBeginUpdateOptions contains the optional parameters for the BackupPoliciesClient.BeginUpdate method. -type BackupPoliciesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupPoliciesClientGetOptions contains the optional parameters for the BackupPoliciesClient.Get method. -type BackupPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. -type BackupPoliciesClientListOptions struct { - // placeholder for future optional parameters -} - // BackupPoliciesList - List of Backup Policies type BackupPoliciesList struct { // A list of backup policies @@ -380,128 +264,6 @@ type BackupPolicyProperties struct { VolumesAssigned *int32 } -// BackupProperties - Backup properties -type BackupProperties struct { - // Label for backup - Label *string - - // Manual backup an already existing snapshot. This will always be false for scheduled backups and true/false for manual backups - UseExistingSnapshot *bool - - // READ-ONLY; UUID v4 used to identify the Backup - BackupID *string - - // READ-ONLY; Type of backup Manual or Scheduled - BackupType *BackupType - - // READ-ONLY; The creation date of the backup - CreationDate *time.Time - - // READ-ONLY; Failure reason - FailureReason *string - - // READ-ONLY; Azure lifecycle management - ProvisioningState *string - - // READ-ONLY; Size of backup - Size *int64 - - // READ-ONLY; Volume name - VolumeName *string -} - -// BackupRestoreFiles - Restore payload for single file backup restore -type BackupRestoreFiles struct { - // REQUIRED; Resource Id of the destination volume on which the files need to be restored - DestinationVolumeID *string - - // REQUIRED; List of files to be restored - FileList []*string - - // Destination folder where the files will be restored. The path name should start with a forward slash. If it is omitted - // from request then restore is done at the root folder of the destination volume by - // default - RestoreFilePath *string -} - -// BackupStatus - Backup status -type BackupStatus struct { - // READ-ONLY; Displays error message if the backup is in an error state - ErrorMessage *string - - // READ-ONLY; Backup health status - Healthy *bool - - // READ-ONLY; Displays the last transfer size - LastTransferSize *int64 - - // READ-ONLY; Displays the last transfer type - LastTransferType *string - - // READ-ONLY; The status of the backup - MirrorState *MirrorState - - // READ-ONLY; Status of the backup mirror relationship - RelationshipStatus *RelationshipStatus - - // READ-ONLY; Displays the total bytes transferred - TotalTransferBytes *int64 - - // READ-ONLY; Reason for the unhealthy backup relationship - UnhealthyReason *string -} - -// BackupsClientBeginCreateOptions contains the optional parameters for the BackupsClient.BeginCreate method. -type BackupsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupsClientBeginDeleteOptions contains the optional parameters for the BackupsClient.BeginDelete method. -type BackupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupsClientBeginRestoreFilesOptions contains the optional parameters for the BackupsClient.BeginRestoreFiles method. -type BackupsClientBeginRestoreFilesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupsClientBeginUpdateOptions contains the optional parameters for the BackupsClient.BeginUpdate method. -type BackupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupsClientGetOptions contains the optional parameters for the BackupsClient.Get method. -type BackupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// BackupsClientGetStatusOptions contains the optional parameters for the BackupsClient.GetStatus method. -type BackupsClientGetStatusOptions struct { - // placeholder for future optional parameters -} - -// BackupsClientGetVolumeRestoreStatusOptions contains the optional parameters for the BackupsClient.GetVolumeRestoreStatus -// method. -type BackupsClientGetVolumeRestoreStatusOptions struct { - // placeholder for future optional parameters -} - -// BackupsClientListOptions contains the optional parameters for the BackupsClient.NewListPager method. -type BackupsClientListOptions struct { - // placeholder for future optional parameters -} - -// BackupsList - List of Backups -type BackupsList struct { - // A list of Backups - Value []*Backup -} - // BreakFileLocksRequest - Break file locks request type BreakFileLocksRequest struct { // To clear file locks on a volume for a particular client @@ -856,6 +618,37 @@ type MountTargetProperties struct { MountTargetID *string } +// NetworkSiblingSet - Describes the contents of a network sibling set. +type NetworkSiblingSet struct { + // Network features available to the volume, or current state of update. + NetworkFeatures *NetworkFeatures + + // Network Sibling Set ID for a group of volumes sharing networking resources in a subnet. + NetworkSiblingSetID *string + + // Network sibling set state Id identifying the current state of the sibling set. + NetworkSiblingSetStateID *string + + // List of NIC information + NicInfoList []*NicInfo + + // The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Example + // /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} + SubnetID *string + + // READ-ONLY; Gets the status of the NetworkSiblingSet at the time the operation was called. + ProvisioningState *NetworkSiblingSetProvisioningState +} + +// NicInfo - NIC information and list of volumes for which the NIC has the primary mount ip address. +type NicInfo struct { + // Volume resource Ids + VolumeResourceIDs []*string + + // READ-ONLY; ipAddress + IPAddress *string +} + // Operation - Microsoft.NetApp REST API operation definition. type Operation struct { // Display metadata associated with the operation. @@ -899,11 +692,6 @@ type OperationProperties struct { ServiceSpecification *ServiceSpecification } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // PlacementKeyValuePairs - Application specific parameters for the placement of volumes in the volume group type PlacementKeyValuePairs struct { // REQUIRED; Key for an application specific parameter for the placement of volumes in the volume group @@ -962,32 +750,14 @@ type PoolProperties struct { UtilizedThroughputMibps *float32 } -// PoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the PoolsClient.BeginCreateOrUpdate method. -type PoolsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PoolsClientBeginDeleteOptions contains the optional parameters for the PoolsClient.BeginDelete method. -type PoolsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PoolsClientBeginUpdateOptions contains the optional parameters for the PoolsClient.BeginUpdate method. -type PoolsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PoolsClientGetOptions contains the optional parameters for the PoolsClient.Get method. -type PoolsClientGetOptions struct { - // placeholder for future optional parameters -} +// QueryNetworkSiblingSetRequest - Network sibling set query. +type QueryNetworkSiblingSetRequest struct { + // REQUIRED; Network Sibling Set ID for a group of volumes sharing networking resources in a subnet. + NetworkSiblingSetID *string -// PoolsClientListOptions contains the optional parameters for the PoolsClient.NewListPager method. -type PoolsClientListOptions struct { - // placeholder for future optional parameters + // REQUIRED; The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Example + // /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} + SubnetID *string } // QuotaAvailabilityRequest - Quota availability request content. @@ -1057,11 +827,11 @@ type ReplicationObject struct { // The remote region for the other end of the Volume Replication. RemoteVolumeRegion *string - // Id - ReplicationID *string - // Schedule ReplicationSchedule *ReplicationSchedule + + // READ-ONLY; Id + ReplicationID *string } // ReplicationStatus - Replication status @@ -1082,29 +852,6 @@ type ReplicationStatus struct { TotalProgress *string } -// ResourceClientCheckFilePathAvailabilityOptions contains the optional parameters for the ResourceClient.CheckFilePathAvailability -// method. -type ResourceClientCheckFilePathAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// ResourceClientCheckNameAvailabilityOptions contains the optional parameters for the ResourceClient.CheckNameAvailability -// method. -type ResourceClientCheckNameAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// ResourceClientCheckQuotaAvailabilityOptions contains the optional parameters for the ResourceClient.CheckQuotaAvailability -// method. -type ResourceClientCheckQuotaAvailabilityOptions struct { - // placeholder for future optional parameters -} - -// ResourceClientQueryRegionInfoOptions contains the optional parameters for the ResourceClient.QueryRegionInfo method. -type ResourceClientQueryRegionInfoOptions struct { - // placeholder for future optional parameters -} - // ResourceNameAvailabilityRequest - Resource name availability request content. type ResourceNameAvailabilityRequest struct { // REQUIRED; Resource name to verify. @@ -1117,16 +864,6 @@ type ResourceNameAvailabilityRequest struct { Type *CheckNameResourceTypes } -// ResourceQuotaLimitsClientGetOptions contains the optional parameters for the ResourceQuotaLimitsClient.Get method. -type ResourceQuotaLimitsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ResourceQuotaLimitsClientListOptions contains the optional parameters for the ResourceQuotaLimitsClient.NewListPager method. -type ResourceQuotaLimitsClientListOptions struct { - // placeholder for future optional parameters -} - // RestoreStatus - Restore status type RestoreStatus struct { // READ-ONLY; Displays error message if the restore is in an error state @@ -1178,38 +915,6 @@ type Snapshot struct { Type *string } -// SnapshotPoliciesClientBeginDeleteOptions contains the optional parameters for the SnapshotPoliciesClient.BeginDelete method. -type SnapshotPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotPoliciesClientBeginUpdateOptions contains the optional parameters for the SnapshotPoliciesClient.BeginUpdate method. -type SnapshotPoliciesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotPoliciesClientCreateOptions contains the optional parameters for the SnapshotPoliciesClient.Create method. -type SnapshotPoliciesClientCreateOptions struct { - // placeholder for future optional parameters -} - -// SnapshotPoliciesClientGetOptions contains the optional parameters for the SnapshotPoliciesClient.Get method. -type SnapshotPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SnapshotPoliciesClientListOptions contains the optional parameters for the SnapshotPoliciesClient.NewListPager method. -type SnapshotPoliciesClientListOptions struct { - // placeholder for future optional parameters -} - -// SnapshotPoliciesClientListVolumesOptions contains the optional parameters for the SnapshotPoliciesClient.ListVolumes method. -type SnapshotPoliciesClientListVolumesOptions struct { - // placeholder for future optional parameters -} - // SnapshotPoliciesList - List of Snapshot Policies type SnapshotPoliciesList struct { // A list of snapshot policies @@ -1312,40 +1017,6 @@ type SnapshotRestoreFiles struct { DestinationPath *string } -// SnapshotsClientBeginCreateOptions contains the optional parameters for the SnapshotsClient.BeginCreate method. -type SnapshotsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. -type SnapshotsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginRestoreFilesOptions contains the optional parameters for the SnapshotsClient.BeginRestoreFiles method. -type SnapshotsClientBeginRestoreFilesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. -type SnapshotsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. -type SnapshotsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. -type SnapshotsClientListOptions struct { - // placeholder for future optional parameters -} - // SnapshotsList - List of Snapshots type SnapshotsList struct { // A list of Snapshots @@ -1481,40 +1152,6 @@ type SubvolumeProperties struct { ProvisioningState *string } -// SubvolumesClientBeginCreateOptions contains the optional parameters for the SubvolumesClient.BeginCreate method. -type SubvolumesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubvolumesClientBeginDeleteOptions contains the optional parameters for the SubvolumesClient.BeginDelete method. -type SubvolumesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubvolumesClientBeginGetMetadataOptions contains the optional parameters for the SubvolumesClient.BeginGetMetadata method. -type SubvolumesClientBeginGetMetadataOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubvolumesClientBeginUpdateOptions contains the optional parameters for the SubvolumesClient.BeginUpdate method. -type SubvolumesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SubvolumesClientGetOptions contains the optional parameters for the SubvolumesClient.Get method. -type SubvolumesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SubvolumesClientListByVolumeOptions contains the optional parameters for the SubvolumesClient.NewListByVolumePager method. -type SubvolumesClientListByVolumeOptions struct { - // placeholder for future optional parameters -} - // SubvolumesList - List of Subvolumes type SubvolumesList struct { // URL to get the next set of results. @@ -1545,6 +1182,22 @@ type SystemData struct { LastModifiedByType *CreatedByType } +// UpdateNetworkSiblingSetRequest - Network sibling set update. +type UpdateNetworkSiblingSetRequest struct { + // REQUIRED; Network features available to the volume, some such + NetworkFeatures *NetworkFeatures + + // REQUIRED; Network Sibling Set ID for a group of volumes sharing networking resources in a subnet. + NetworkSiblingSetID *string + + // REQUIRED; Network sibling set state Id identifying the current state of the sibling set. + NetworkSiblingSetStateID *string + + // REQUIRED; The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes. Example + // /subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/{mySubnet} + SubnetID *string +} + // UserAssignedIdentity - User assigned identity properties type UserAssignedIdentity struct { // READ-ONLY; The client ID of the assigned identity. @@ -1584,18 +1237,6 @@ type Volume struct { Type *string } -// VolumeBackupProperties - Volume Backup Properties -type VolumeBackupProperties struct { - // Backup Enabled - BackupEnabled *bool - - // Backup Policy Resource ID - BackupPolicyID *string - - // Policy Enforced - PolicyEnforced *bool -} - // VolumeBackups - Volume details using the backup policy type VolumeBackups struct { // Total count of backups for volume @@ -1703,6 +1344,9 @@ type VolumeGroupVolumeProperties struct { // Resource tags Tags map[string]*string + // Availability Zone + Zones []*string + // READ-ONLY; Resource Id ID *string @@ -1710,29 +1354,6 @@ type VolumeGroupVolumeProperties struct { Type *string } -// VolumeGroupsClientBeginCreateOptions contains the optional parameters for the VolumeGroupsClient.BeginCreate method. -type VolumeGroupsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumeGroupsClientBeginDeleteOptions contains the optional parameters for the VolumeGroupsClient.BeginDelete method. -type VolumeGroupsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumeGroupsClientGetOptions contains the optional parameters for the VolumeGroupsClient.Get method. -type VolumeGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VolumeGroupsClientListByNetAppAccountOptions contains the optional parameters for the VolumeGroupsClient.NewListByNetAppAccountPager -// method. -type VolumeGroupsClientListByNetAppAccountOptions struct { - // placeholder for future optional parameters -} - // VolumeList - List of volume resources type VolumeList struct { // URL to get the next set of results. @@ -1768,6 +1389,13 @@ type VolumePatchProperties struct { // Specifies whether Cool Access(tiering) is enabled for the volume. CoolAccess *bool + // coolAccessRetrievalPolicy determines the data retrieval behavior from the cool tier to standard storage based on the read + // pattern for cool access enabled volumes. The possible values for this field + // are: Default - Data will be pulled from cool tier to standard storage on random reads. This policy is the default. OnRead + // - All client-driven data read is pulled from cool tier to standard storage on + // both sequential and random reads. Never - No client-driven data is pulled from cool tier to standard storage. + CoolAccessRetrievalPolicy *CoolAccessRetrievalPolicy + // Specifies the number of days after which data that is not accessed by clients will be tiered. CoolnessPeriod *int32 @@ -1805,15 +1433,13 @@ type VolumePatchProperties struct { UnixPermissions *string // Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is - // 100 GiB. Upper limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. + // 100 GiB. Upper limit is 100TiB, 500Tib for LargeVolume or 2400Tib for LargeVolume + // on exceptional basis. Specified in bytes. UsageThreshold *int64 } // VolumePatchPropertiesDataProtection - DataProtection type volumes include an object containing details of the replication type VolumePatchPropertiesDataProtection struct { - // Backup Properties - Backup *VolumeBackupProperties - // Snapshot properties. Snapshot *VolumeSnapshotProperties } @@ -1833,7 +1459,8 @@ type VolumeProperties struct { SubnetID *string // REQUIRED; Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum - // size is 100 GiB. Upper limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. + // size is 100 GiB. Upper limit is 100TiB, 500Tib for LargeVolume or 2400Tib for LargeVolume + // on exceptional basis. Specified in bytes. UsageThreshold *int64 // Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose @@ -1848,6 +1475,13 @@ type VolumeProperties struct { // Specifies whether Cool Access(tiering) is enabled for the volume. CoolAccess *bool + // coolAccessRetrievalPolicy determines the data retrieval behavior from the cool tier to standard storage based on the read + // pattern for cool access enabled volumes. The possible values for this field + // are: Default - Data will be pulled from cool tier to standard storage on random reads. This policy is the default. OnRead + // - All client-driven data read is pulled from cool tier to standard storage on + // both sequential and random reads. Never - No client-driven data is pulled from cool tier to standard storage. + CoolAccessRetrievalPolicy *CoolAccessRetrievalPolicy + // Specifies the number of days after which data that is not accessed by clients will be tiered. CoolnessPeriod *int32 @@ -1894,7 +1528,7 @@ type VolumeProperties struct { // Specifies whether LDAP is enabled or not for a given NFS volume. LdapEnabled *bool - // Basic network, or Standard features available to the volume. + // Network features available to the volume, or current state of update. NetworkFeatures *NetworkFeatures // Application specific placement rules for the particular volume @@ -2006,9 +1640,6 @@ type VolumeProperties struct { // VolumePropertiesDataProtection - DataProtection type volumes include an object containing details of the replication type VolumePropertiesDataProtection struct { - // Backup Properties - Backup *VolumeBackupProperties - // Replication properties Replication *ReplicationObject @@ -2058,35 +1689,6 @@ type VolumeQuotaRulePatch struct { Tags map[string]*string } -// VolumeQuotaRulesClientBeginCreateOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginCreate method. -type VolumeQuotaRulesClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumeQuotaRulesClientBeginDeleteOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginDelete method. -type VolumeQuotaRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumeQuotaRulesClientBeginUpdateOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginUpdate method. -type VolumeQuotaRulesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumeQuotaRulesClientGetOptions contains the optional parameters for the VolumeQuotaRulesClient.Get method. -type VolumeQuotaRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VolumeQuotaRulesClientListByVolumeOptions contains the optional parameters for the VolumeQuotaRulesClient.NewListByVolumePager -// method. -type VolumeQuotaRulesClientListByVolumeOptions struct { - // placeholder for future optional parameters -} - // VolumeQuotaRulesList - List of Volume Quota Rules type VolumeQuotaRulesList struct { // A list of Volume Quota Rules @@ -2130,146 +1732,6 @@ type VolumeSnapshotProperties struct { SnapshotPolicyID *string } -// VolumesClientBeginAuthorizeReplicationOptions contains the optional parameters for the VolumesClient.BeginAuthorizeReplication -// method. -type VolumesClientBeginAuthorizeReplicationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginBreakFileLocksOptions contains the optional parameters for the VolumesClient.BeginBreakFileLocks method. -type VolumesClientBeginBreakFileLocksOptions struct { - // Optional body to provide the ability to clear file locks with selected options - Body *BreakFileLocksRequest - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginBreakReplicationOptions contains the optional parameters for the VolumesClient.BeginBreakReplication -// method. -type VolumesClientBeginBreakReplicationOptions struct { - // Optional body to force break the replication. - Body *BreakReplicationRequest - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginCreateOrUpdateOptions contains the optional parameters for the VolumesClient.BeginCreateOrUpdate method. -type VolumesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginDeleteOptions contains the optional parameters for the VolumesClient.BeginDelete method. -type VolumesClientBeginDeleteOptions struct { - // An option to force delete the volume. Will cleanup resources connected to the particular volume - ForceDelete *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginDeleteReplicationOptions contains the optional parameters for the VolumesClient.BeginDeleteReplication -// method. -type VolumesClientBeginDeleteReplicationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginFinalizeRelocationOptions contains the optional parameters for the VolumesClient.BeginFinalizeRelocation -// method. -type VolumesClientBeginFinalizeRelocationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginListGetGroupIDListForLdapUserOptions contains the optional parameters for the VolumesClient.BeginListGetGroupIDListForLdapUser -// method. -type VolumesClientBeginListGetGroupIDListForLdapUserOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginPoolChangeOptions contains the optional parameters for the VolumesClient.BeginPoolChange method. -type VolumesClientBeginPoolChangeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginReInitializeReplicationOptions contains the optional parameters for the VolumesClient.BeginReInitializeReplication -// method. -type VolumesClientBeginReInitializeReplicationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginReestablishReplicationOptions contains the optional parameters for the VolumesClient.BeginReestablishReplication -// method. -type VolumesClientBeginReestablishReplicationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginRelocateOptions contains the optional parameters for the VolumesClient.BeginRelocate method. -type VolumesClientBeginRelocateOptions struct { - // Relocate volume request - Body *RelocateVolumeRequest - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginResetCifsPasswordOptions contains the optional parameters for the VolumesClient.BeginResetCifsPassword -// method. -type VolumesClientBeginResetCifsPasswordOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginResyncReplicationOptions contains the optional parameters for the VolumesClient.BeginResyncReplication -// method. -type VolumesClientBeginResyncReplicationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginRevertOptions contains the optional parameters for the VolumesClient.BeginRevert method. -type VolumesClientBeginRevertOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginRevertRelocationOptions contains the optional parameters for the VolumesClient.BeginRevertRelocation -// method. -type VolumesClientBeginRevertRelocationOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientBeginUpdateOptions contains the optional parameters for the VolumesClient.BeginUpdate method. -type VolumesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VolumesClientGetOptions contains the optional parameters for the VolumesClient.Get method. -type VolumesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VolumesClientListOptions contains the optional parameters for the VolumesClient.NewListPager method. -type VolumesClientListOptions struct { - // placeholder for future optional parameters -} - -// VolumesClientListReplicationsOptions contains the optional parameters for the VolumesClient.NewListReplicationsPager method. -type VolumesClientListReplicationsOptions struct { - // placeholder for future optional parameters -} - -// VolumesClientReplicationStatusOptions contains the optional parameters for the VolumesClient.ReplicationStatus method. -type VolumesClientReplicationStatusOptions struct { - // placeholder for future optional parameters -} - // WeeklySchedule - Weekly Schedule properties, make a snapshot every week at a specific day or days type WeeklySchedule struct { // Indicates which weekdays snapshot should be taken, accepts a comma separated list of week day names in english diff --git a/sdk/resourcemanager/netapp/armnetapp/models_serde.go b/sdk/resourcemanager/netapp/armnetapp/models_serde.go index 3bfd9df8e863..7746c1458a91 100644 --- a/sdk/resourcemanager/netapp/armnetapp/models_serde.go +++ b/sdk/resourcemanager/netapp/armnetapp/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -373,84 +372,6 @@ func (a *AuthorizeRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Backup. -func (b Backup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "systemData", b.SystemData) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Backup. -func (b *Backup) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &b.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &b.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BackupPatch. -func (b BackupPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupPatch. -func (b *BackupPatch) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, "Properties", &b.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &b.Tags) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type BackupPoliciesList. func (b BackupPoliciesList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -635,182 +556,6 @@ func (b *BackupPolicyProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupProperties. -func (b BackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "backupId", b.BackupID) - populate(objectMap, "backupType", b.BackupType) - populateTimeRFC3339(objectMap, "creationDate", b.CreationDate) - populate(objectMap, "failureReason", b.FailureReason) - populate(objectMap, "label", b.Label) - populate(objectMap, "provisioningState", b.ProvisioningState) - populate(objectMap, "size", b.Size) - populate(objectMap, "useExistingSnapshot", b.UseExistingSnapshot) - populate(objectMap, "volumeName", b.VolumeName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupProperties. -func (b *BackupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backupId": - err = unpopulate(val, "BackupID", &b.BackupID) - delete(rawMsg, key) - case "backupType": - err = unpopulate(val, "BackupType", &b.BackupType) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &b.CreationDate) - delete(rawMsg, key) - case "failureReason": - err = unpopulate(val, "FailureReason", &b.FailureReason) - delete(rawMsg, key) - case "label": - err = unpopulate(val, "Label", &b.Label) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - delete(rawMsg, key) - case "size": - err = unpopulate(val, "Size", &b.Size) - delete(rawMsg, key) - case "useExistingSnapshot": - err = unpopulate(val, "UseExistingSnapshot", &b.UseExistingSnapshot) - delete(rawMsg, key) - case "volumeName": - err = unpopulate(val, "VolumeName", &b.VolumeName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BackupRestoreFiles. -func (b BackupRestoreFiles) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "destinationVolumeId", b.DestinationVolumeID) - populate(objectMap, "fileList", b.FileList) - populate(objectMap, "restoreFilePath", b.RestoreFilePath) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupRestoreFiles. -func (b *BackupRestoreFiles) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationVolumeId": - err = unpopulate(val, "DestinationVolumeID", &b.DestinationVolumeID) - delete(rawMsg, key) - case "fileList": - err = unpopulate(val, "FileList", &b.FileList) - delete(rawMsg, key) - case "restoreFilePath": - err = unpopulate(val, "RestoreFilePath", &b.RestoreFilePath) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BackupStatus. -func (b BackupStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "errorMessage", b.ErrorMessage) - populate(objectMap, "healthy", b.Healthy) - populate(objectMap, "lastTransferSize", b.LastTransferSize) - populate(objectMap, "lastTransferType", b.LastTransferType) - populate(objectMap, "mirrorState", b.MirrorState) - populate(objectMap, "relationshipStatus", b.RelationshipStatus) - populate(objectMap, "totalTransferBytes", b.TotalTransferBytes) - populate(objectMap, "unhealthyReason", b.UnhealthyReason) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupStatus. -func (b *BackupStatus) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &b.ErrorMessage) - delete(rawMsg, key) - case "healthy": - err = unpopulate(val, "Healthy", &b.Healthy) - delete(rawMsg, key) - case "lastTransferSize": - err = unpopulate(val, "LastTransferSize", &b.LastTransferSize) - delete(rawMsg, key) - case "lastTransferType": - err = unpopulate(val, "LastTransferType", &b.LastTransferType) - delete(rawMsg, key) - case "mirrorState": - err = unpopulate(val, "MirrorState", &b.MirrorState) - delete(rawMsg, key) - case "relationshipStatus": - err = unpopulate(val, "RelationshipStatus", &b.RelationshipStatus) - delete(rawMsg, key) - case "totalTransferBytes": - err = unpopulate(val, "TotalTransferBytes", &b.TotalTransferBytes) - delete(rawMsg, key) - case "unhealthyReason": - err = unpopulate(val, "UnhealthyReason", &b.UnhealthyReason) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BackupsList. -func (b BackupsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupsList. -func (b *BackupsList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - err = unpopulate(val, "Value", &b.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type BreakFileLocksRequest. func (b BreakFileLocksRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1685,6 +1430,84 @@ func (m *MountTargetProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NetworkSiblingSet. +func (n NetworkSiblingSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkFeatures", n.NetworkFeatures) + populate(objectMap, "networkSiblingSetId", n.NetworkSiblingSetID) + populate(objectMap, "networkSiblingSetStateId", n.NetworkSiblingSetStateID) + populate(objectMap, "nicInfoList", n.NicInfoList) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "subnetId", n.SubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSiblingSet. +func (n *NetworkSiblingSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkFeatures": + err = unpopulate(val, "NetworkFeatures", &n.NetworkFeatures) + delete(rawMsg, key) + case "networkSiblingSetId": + err = unpopulate(val, "NetworkSiblingSetID", &n.NetworkSiblingSetID) + delete(rawMsg, key) + case "networkSiblingSetStateId": + err = unpopulate(val, "NetworkSiblingSetStateID", &n.NetworkSiblingSetStateID) + delete(rawMsg, key) + case "nicInfoList": + err = unpopulate(val, "NicInfoList", &n.NicInfoList) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &n.SubnetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NicInfo. +func (n NicInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ipAddress", n.IPAddress) + populate(objectMap, "volumeResourceIds", n.VolumeResourceIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NicInfo. +func (n *NicInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ipAddress": + err = unpopulate(val, "IPAddress", &n.IPAddress) + delete(rawMsg, key) + case "volumeResourceIds": + err = unpopulate(val, "VolumeResourceIDs", &n.VolumeResourceIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1969,6 +1792,37 @@ func (p *PoolProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type QueryNetworkSiblingSetRequest. +func (q QueryNetworkSiblingSetRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkSiblingSetId", q.NetworkSiblingSetID) + populate(objectMap, "subnetId", q.SubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryNetworkSiblingSetRequest. +func (q *QueryNetworkSiblingSetRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkSiblingSetId": + err = unpopulate(val, "NetworkSiblingSetID", &q.NetworkSiblingSetID) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &q.SubnetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type QuotaAvailabilityRequest. func (q QuotaAvailabilityRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3122,6 +2976,45 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UpdateNetworkSiblingSetRequest. +func (u UpdateNetworkSiblingSetRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkFeatures", u.NetworkFeatures) + populate(objectMap, "networkSiblingSetId", u.NetworkSiblingSetID) + populate(objectMap, "networkSiblingSetStateId", u.NetworkSiblingSetStateID) + populate(objectMap, "subnetId", u.SubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateNetworkSiblingSetRequest. +func (u *UpdateNetworkSiblingSetRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkFeatures": + err = unpopulate(val, "NetworkFeatures", &u.NetworkFeatures) + delete(rawMsg, key) + case "networkSiblingSetId": + err = unpopulate(val, "NetworkSiblingSetID", &u.NetworkSiblingSetID) + delete(rawMsg, key) + case "networkSiblingSetStateId": + err = unpopulate(val, "NetworkSiblingSetStateID", &u.NetworkSiblingSetStateID) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &u.SubnetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3212,41 +3105,6 @@ func (v *Volume) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type VolumeBackupProperties. -func (v VolumeBackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "backupEnabled", v.BackupEnabled) - populate(objectMap, "backupPolicyId", v.BackupPolicyID) - populate(objectMap, "policyEnforced", v.PolicyEnforced) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VolumeBackupProperties. -func (v *VolumeBackupProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "backupEnabled": - err = unpopulate(val, "BackupEnabled", &v.BackupEnabled) - delete(rawMsg, key) - case "backupPolicyId": - err = unpopulate(val, "BackupPolicyID", &v.BackupPolicyID) - delete(rawMsg, key) - case "policyEnforced": - err = unpopulate(val, "PolicyEnforced", &v.PolicyEnforced) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type VolumeBackups. func (v VolumeBackups) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3516,6 +3374,7 @@ func (v VolumeGroupVolumeProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "properties", v.Properties) populate(objectMap, "tags", v.Tags) populate(objectMap, "type", v.Type) + populate(objectMap, "zones", v.Zones) return json.Marshal(objectMap) } @@ -3543,6 +3402,9 @@ func (v *VolumeGroupVolumeProperties) UnmarshalJSON(data []byte) error { case "type": err = unpopulate(val, "Type", &v.Type) delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &v.Zones) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", v, err) @@ -3633,6 +3495,7 @@ func (v *VolumePatch) UnmarshalJSON(data []byte) error { func (v VolumePatchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "coolAccess", v.CoolAccess) + populate(objectMap, "coolAccessRetrievalPolicy", v.CoolAccessRetrievalPolicy) populate(objectMap, "coolnessPeriod", v.CoolnessPeriod) populate(objectMap, "dataProtection", v.DataProtection) populate(objectMap, "defaultGroupQuotaInKiBs", v.DefaultGroupQuotaInKiBs) @@ -3659,6 +3522,9 @@ func (v *VolumePatchProperties) UnmarshalJSON(data []byte) error { case "coolAccess": err = unpopulate(val, "CoolAccess", &v.CoolAccess) delete(rawMsg, key) + case "coolAccessRetrievalPolicy": + err = unpopulate(val, "CoolAccessRetrievalPolicy", &v.CoolAccessRetrievalPolicy) + delete(rawMsg, key) case "coolnessPeriod": err = unpopulate(val, "CoolnessPeriod", &v.CoolnessPeriod) delete(rawMsg, key) @@ -3703,7 +3569,6 @@ func (v *VolumePatchProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumePatchPropertiesDataProtection. func (v VolumePatchPropertiesDataProtection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backup", v.Backup) populate(objectMap, "snapshot", v.Snapshot) return json.Marshal(objectMap) } @@ -3717,9 +3582,6 @@ func (v *VolumePatchPropertiesDataProtection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "backup": - err = unpopulate(val, "Backup", &v.Backup) - delete(rawMsg, key) case "snapshot": err = unpopulate(val, "Snapshot", &v.Snapshot) delete(rawMsg, key) @@ -3768,6 +3630,7 @@ func (v VolumeProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "capacityPoolResourceId", v.CapacityPoolResourceID) populate(objectMap, "cloneProgress", v.CloneProgress) populate(objectMap, "coolAccess", v.CoolAccess) + populate(objectMap, "coolAccessRetrievalPolicy", v.CoolAccessRetrievalPolicy) populate(objectMap, "coolnessPeriod", v.CoolnessPeriod) populate(objectMap, "creationToken", v.CreationToken) populate(objectMap, "dataProtection", v.DataProtection) @@ -3847,6 +3710,9 @@ func (v *VolumeProperties) UnmarshalJSON(data []byte) error { case "coolAccess": err = unpopulate(val, "CoolAccess", &v.CoolAccess) delete(rawMsg, key) + case "coolAccessRetrievalPolicy": + err = unpopulate(val, "CoolAccessRetrievalPolicy", &v.CoolAccessRetrievalPolicy) + delete(rawMsg, key) case "coolnessPeriod": err = unpopulate(val, "CoolnessPeriod", &v.CoolnessPeriod) delete(rawMsg, key) @@ -3996,7 +3862,6 @@ func (v *VolumeProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VolumePropertiesDataProtection. func (v VolumePropertiesDataProtection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "backup", v.Backup) populate(objectMap, "replication", v.Replication) populate(objectMap, "snapshot", v.Snapshot) populate(objectMap, "volumeRelocation", v.VolumeRelocation) @@ -4012,9 +3877,6 @@ func (v *VolumePropertiesDataProtection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "backup": - err = unpopulate(val, "Backup", &v.Backup) - delete(rawMsg, key) case "replication": err = unpopulate(val, "Replication", &v.Replication) delete(rawMsg, key) diff --git a/sdk/resourcemanager/netapp/armnetapp/operations_client.go b/sdk/resourcemanager/netapp/armnetapp/operations_client.go index f6293d13dac7..ccf7fab18d6c 100644 --- a/sdk/resourcemanager/netapp/armnetapp/operations_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Microsoft.NetApp Rest API operations // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +71,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go deleted file mode 100644 index bdca17a61bfa..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go +++ /dev/null @@ -1,1590 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/OperationList.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armnetapp.OperationListResult{ - // Value: []*armnetapp.Operation{ - // { - // Name: to.Ptr("Microsoft.NetApp/register/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Subscription Registration Action"), - // Operation: to.Ptr("Subscription Registration Action"), - // Provider: to.Ptr("Microsoft.NetApp"), - // Resource: to.Ptr("Subscription"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a volume resource."), - // Operation: to.Ptr("Read volume resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Writes a volume resource."), - // Operation: to.Ptr("Write volume resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/delete"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Deletes a volume resource."), - // Operation: to.Ptr("Delete volume resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/Revert/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Revert volume to specific snapshot"), - // Operation: to.Ptr("Revert volume resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/BreakReplication/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Break volume replication relations"), - // Operation: to.Ptr("Break volume replication resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/ReplicationStatus/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads the statuses of the Volume Replication."), - // Operation: to.Ptr("Read Volume Replication Status."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/ListReplications/action"), - // Display: &armnetapp.OperationDisplay{ - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/ReInitializeReplication/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Attempts to re-initialize an uninitialized replication"), - // Operation: to.Ptr("Re-Initialize replication"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for Volume resource."), - // Operation: to.Ptr("Read volume metric definitions."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("system"), - // Properties: &armnetapp.OperationProperties{ - // ServiceSpecification: &armnetapp.ServiceSpecification{ - // MetricSpecifications: []*armnetapp.MetricSpecification{ - // { - // Name: to.Ptr("AverageReadLatency"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Average read latency in milliseconds per operation"), - // DisplayName: to.Ptr("Average read latency"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("AverageReadLatency"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("MilliSeconds"), - // }, - // { - // Name: to.Ptr("AverageWriteLatency"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Average write latency in milliseconds per operation"), - // DisplayName: to.Ptr("Average write latency"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("AverageWriteLatency"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("MilliSeconds"), - // }, - // { - // Name: to.Ptr("VolumeLogicalSize"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Logical size of the volume (used bytes)"), - // DisplayName: to.Ptr("Volume Consumed Size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumeLogicalSize"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("VolumeSnapshotSize"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Size of all snapshots in volume"), - // DisplayName: to.Ptr("Volume snapshot size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumeSnapshotSize"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("ReadIops"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Read In/out operations per second"), - // DisplayName: to.Ptr("Read iops"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("ReadIops"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("CountPerSecond"), - // }, - // { - // Name: to.Ptr("WriteIops"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Write In/out operations per second"), - // DisplayName: to.Ptr("Write iops"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("WriteIops"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("CountPerSecond"), - // }, - // { - // Name: to.Ptr("VolumeAllocatedSize"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("The provisioned size of a volume"), - // DisplayName: to.Ptr("Volume allocated size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumeAllocatedSize"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("VolumeCoolTierSize"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Volume Footprint for Cool Tier"), - // DisplayName: to.Ptr("Volume cool tier size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumeCoolTierSize"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("VolumeCoolTierDataReadSize"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Data read in using GET per volume"), - // DisplayName: to.Ptr("Volume cool tier data read size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumeCoolTierDataReadSize"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("VolumeCoolTierDataWriteSize"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Data tiered out using PUT per volume"), - // DisplayName: to.Ptr("Volume cool tier data write size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumeCoolTierDataWriteSize"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("XregionReplicationLastTransferDuration"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("The amount of time in seconds it took for the last transfer to complete."), - // DisplayName: to.Ptr("Volume replication last transfer duration"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("XregionReplicationLastTransferDuration"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Seconds"), - // }, - // { - // Name: to.Ptr("XregionReplicationLastTransferSize"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("The total number of bytes transferred as part of the last transfer."), - // DisplayName: to.Ptr("Volume replication last transfer size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("XregionReplicationLastTransferSize"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("XregionReplicationHealthy"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Condition of the relationship, 1 or 0."), - // DisplayName: to.Ptr("Is volume replication status healthy"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("XregionReplicationHealthy"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Count"), - // }, - // { - // Name: to.Ptr("XregionReplicationLagTime"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("The amount of time in seconds by which the data on the mirror lags behind the source."), - // DisplayName: to.Ptr("Volume replication lag time"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("XregionReplicationLagTime"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Seconds"), - // }, - // { - // Name: to.Ptr("XregionReplicationTotalTransferBytes"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Cumulative bytes transferred for the relationship."), - // DisplayName: to.Ptr("Volume replication total transfer"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("XregionReplicationTotalTransferBytes"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("XregionReplicationRelationshipProgress"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Total amount of data transferred for the current transfer operation."), - // DisplayName: to.Ptr("Volume replication progress"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("XregionReplicationRelationshipProgress"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("XregionReplicationRelationshipTransferring"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Whether the status of the Volume Replication is 'transferring'."), - // DisplayName: to.Ptr("Is volume replication transferring"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("XregionReplicationRelationshipTransferring"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Count"), - // }, - // { - // Name: to.Ptr("CbsVolumeLogicalBackupBytes"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Total bytes backed up for this Volume."), - // DisplayName: to.Ptr("Volume Backup Bytes"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("CbsVolumeLogicalBackupBytes"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("CbsVolumeProtected"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Is backup enabled for the volume? 1 if yes, 0 if no."), - // DisplayName: to.Ptr("Is Volume Backup Enabled"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("CbsVolumeProtected"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Count"), - // }, - // { - // Name: to.Ptr("CbsVolumeBackupActive"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Is the backup policy suspended for the volume? 0 if yes, 1 if no."), - // DisplayName: to.Ptr("Is Volume Backup suspended"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("CbsVolumeBackupActive"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Count"), - // }, - // { - // Name: to.Ptr("CbsVolumeOperationTransferredBytes"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Total bytes transferred for last backup or restore operation."), - // DisplayName: to.Ptr("Volume Backup Last Transferred Bytes"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("CbsVolumeOperationTransferredBytes"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("CbsVolumeOperationComplete"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Did the last volume backup or restore operation complete successfully? 1 if yes, 0 if no."), - // DisplayName: to.Ptr("Is Volume Backup Operation Complete"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("CbsVolumeOperationComplete"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Count"), - // }, - // { - // Name: to.Ptr("VolumeConsumedSizePercentage"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("The percentage of the volume consumed including snapshots."), - // DisplayName: to.Ptr("Percentage Volume Consumed Size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumeConsumedSizePercentage"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Percent"), - // }, - // { - // Name: to.Ptr("OtherThroughput"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Other throughput (that is not read or write) in bytes per second"), - // DisplayName: to.Ptr("Other throughput"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("OtherThroughput"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("BytesPerSecond"), - // }, - // { - // Name: to.Ptr("ReadThroughput"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Read throughput in bytes per second"), - // DisplayName: to.Ptr("Read throughput"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("ReadThroughput"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("BytesPerSecond"), - // }, - // { - // Name: to.Ptr("TotalThroughput"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Sum of all throughput in bytes per second"), - // DisplayName: to.Ptr("Total throughput"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("TotalThroughput"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("BytesPerSecond"), - // }, - // { - // Name: to.Ptr("WriteThroughput"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Write throughput in bytes per second"), - // DisplayName: to.Ptr("Write throughput"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("WriteThroughput"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("BytesPerSecond"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Gets the diagnostic setting for the resource."), - // Operation: to.Ptr("Read diagnostic setting."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource."), - // Operation: to.Ptr("Write diagnostic setting."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/AuthorizeReplication/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Authorize the source volume replication"), - // Operation: to.Ptr("Authorize Replication"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/ResyncReplication/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Resync the replication on the destination volume"), - // Operation: to.Ptr("Resync Replication"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/DeleteReplication/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Delete the replication on the destination volume"), - // Operation: to.Ptr("Delete Replication"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/ReplicationStatus/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads the statuses of the Volume Replication."), - // Operation: to.Ptr("Read Volume Replication Status."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/MountTargets/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a mount target resource."), - // Operation: to.Ptr("Read mount target resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/BackupStatus/read"), - // Display: &armnetapp.OperationDisplay{ - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/RestoreStatus/read"), - // Display: &armnetapp.OperationDisplay{ - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/PoolChange/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Moves volume to another pool."), - // Operation: to.Ptr("Change pool for volume"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/RelocateVolume/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Relocate volume to a new stamp."), - // Operation: to.Ptr("Relocate volume to a new stamp."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/FinalizeRelocation/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Finalize relocation by cleaning up the old volume."), - // Operation: to.Ptr("Finalize relocation of volume."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/RevertRelocation/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Revert the relocation and revert back to the old volume."), - // Operation: to.Ptr("Revert the relocation of volume."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads an account resource."), - // Operation: to.Ptr("Read account resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Accounts resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Writes an account resource."), - // Operation: to.Ptr("Write account resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Accounts resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/delete"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Deletes a account resource."), - // Operation: to.Ptr("Delete account resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Accounts resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/RenewCredentials/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Renews MSI credentials of account, if account has MSI credentials that are due for renewal."), - // Operation: to.Ptr("Renew MSI credentials, if possible."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Accounts resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a pool resource."), - // Operation: to.Ptr("Read pool resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Pools resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Writes a pool resource."), - // Operation: to.Ptr("Write pool resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Pools resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/delete"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Deletes a pool resource."), - // Operation: to.Ptr("Delete pool resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Pools resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/providers/Microsoft.Insights/metricDefinitions/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for Volume resource."), - // Operation: to.Ptr("Read volume metric definitions."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Pools resource type"), - // }, - // Origin: to.Ptr("system"), - // Properties: &armnetapp.OperationProperties{ - // ServiceSpecification: &armnetapp.ServiceSpecification{ - // MetricSpecifications: []*armnetapp.MetricSpecification{ - // { - // Name: to.Ptr("VolumePoolAllocatedUsed"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Allocated used size of the pool"), - // DisplayName: to.Ptr("Pool Allocated To Volume Size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumePoolAllocatedUsed"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("VolumePoolTotalLogicalSize"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Sum of the logical size of all the volumes belonging to the pool"), - // DisplayName: to.Ptr("Pool Consumed Size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumePoolTotalLogicalSize"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage), - // to.Ptr(armnetapp.MetricAggregationType("Total"))}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("VolumePoolAllocatedSize"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Provisioned size of this pool"), - // DisplayName: to.Ptr("Pool Allocated Size"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumePoolAllocatedSize"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage), - // to.Ptr(armnetapp.MetricAggregationType("Total"))}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("VolumePoolTotalSnapshotSize"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Sum of snapshot size of all volumes in this pool"), - // DisplayName: to.Ptr("Total Snapshot size for the pool"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumePoolTotalSnapshotSize"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("Bytes"), - // }, - // { - // Name: to.Ptr("VolumePoolProvisionedThroughput"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Provisioned throughput of this pool"), - // DisplayName: to.Ptr("Provisioned throughput for the pool"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumePoolProvisionedThroughput"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("BytesPerSecond"), - // }, - // { - // Name: to.Ptr("VolumePoolAllocatedToVolumeThroughput"), - // AggregationType: to.Ptr("Average"), - // Dimensions: []*armnetapp.Dimension{ - // }, - // DisplayDescription: to.Ptr("Sum of the throughput of all the volumes belonging to the pool"), - // DisplayName: to.Ptr("Pool allocated throughput"), - // EnableRegionalMdmAccount: to.Ptr(true), - // FillGapWithZero: to.Ptr(false), - // InternalMetricName: to.Ptr("VolumePoolAllocatedToVolumeThroughput"), - // IsInternal: to.Ptr(false), - // SourceMdmAccount: to.Ptr("MicrosoftNetAppShoebox2"), - // SourceMdmNamespace: to.Ptr("NetAppUsageAndMetrics"), - // SupportedAggregationTypes: []*armnetapp.MetricAggregationType{ - // to.Ptr(armnetapp.MetricAggregationTypeAverage)}, - // SupportedTimeGrainTypes: []*string{ - // to.Ptr("PT5M"), - // to.Ptr("PT15M"), - // to.Ptr("PT30M"), - // to.Ptr("PT1H"), - // to.Ptr("PT6H"), - // to.Ptr("PT12H"), - // to.Ptr("P1D")}, - // Unit: to.Ptr("BytesPerSecond"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/providers/Microsoft.Insights/logDefinitions/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Gets the log definitions for the resource."), - // Operation: to.Ptr("Read log definitions."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Pools resource type"), - // }, - // Origin: to.Ptr("system"), - // Properties: &armnetapp.OperationProperties{ - // ServiceSpecification: &armnetapp.ServiceSpecification{ - // LogSpecifications: []*armnetapp.LogSpecification{ - // { - // Name: to.Ptr("Autoscale"), - // DisplayName: to.Ptr("Capacity Pool Autoscaled"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/providers/Microsoft.Insights/diagnosticSettings/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Gets the diagnostic setting for the resource."), - // Operation: to.Ptr("Read diagnostic setting."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Pools resource type"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/providers/Microsoft.Insights/diagnosticSettings/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diagnostic setting for the resource."), - // Operation: to.Ptr("Write diagnostic setting."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Pools resource type"), - // }, - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a snapshot resource."), - // Operation: to.Ptr("Read snapshot resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Snapshots resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Writes a snapshot resource."), - // Operation: to.Ptr("Write snapshot resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Snapshots resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/delete"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Deletes a snapshot resource."), - // Operation: to.Ptr("Delete snapshot resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Snapshots resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots/RestoreFiles/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Restores files from a snapshot resource"), - // Operation: to.Ptr("Single File Snapshot Restore"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Snapshots resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes/read"), - // Display: &armnetapp.OperationDisplay{ - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Subvolume resource type."), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Write a subvolume resource."), - // Operation: to.Ptr("Write subvolume Resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Subvolume resource type."), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes/delete"), - // Display: &armnetapp.OperationDisplay{ - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Subvolume resource type."), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes/GetMetadata/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Read subvolume metadata resource."), - // Operation: to.Ptr("Subvolume Metadata resource."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Subvolume resource type."), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a snapshot policy resource."), - // Operation: to.Ptr("Read snapshot policy resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Snapshot Policies resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Writes a snapshot policy resource."), - // Operation: to.Ptr("Write snapshot policy resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Snapshot Policies resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies/delete"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Deletes a snapshot policy resource."), - // Operation: to.Ptr("Delete snapshot policy resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Snapshot Policies resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies/Volumes/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("List volumes connected to snapshot policy"), - // Operation: to.Ptr("List connected volumes"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Snapshot Policies resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies/ListVolumes/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("List volumes connected to snapshot policy"), - // Operation: to.Ptr("List connected volumes"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Snapshot Policies resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a backup resource."), - // Operation: to.Ptr("Read backup resource."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Backup resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Writes a backup resource."), - // Operation: to.Ptr("Write backup resource."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Backup resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/backups/delete"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Deletes a backup resource."), - // Operation: to.Ptr("Delete backup resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Backup resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppIPSecPolicies/read"), - // Display: &armnetapp.OperationDisplay{ - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppIPSecPolicies/write"), - // Display: &armnetapp.OperationDisplay{ - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppIPSecPolicies/delete"), - // Display: &armnetapp.OperationDisplay{ - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppIPSecPolicies/Apply/action"), - // Display: &armnetapp.OperationDisplay{ - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a backup policy resource."), - // Operation: to.Ptr("Read backup policy resource."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Backup Policy resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Writes a backup policy resource."), - // Operation: to.Ptr("Write backup policy resource."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Backup Policy resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/backupPolicies/delete"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Deletes a backup policy resource."), - // Operation: to.Ptr("Delete backup policy resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Backup Policy resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/vaults/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a vault resource."), - // Operation: to.Ptr("Read vault resource."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Vault resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/accountBackups/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads an account backup resource."), - // Operation: to.Ptr("Read an account backup resource."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Account backup resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/accountBackups/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Writes an account backup resource."), - // Operation: to.Ptr("Write an account backup resource."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Account backup resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/accountBackups/delete"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Deletes an account backup resource."), - // Operation: to.Ptr("Delete an account backup resource."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Account backup resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/volumeGroups/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a volume group resource."), - // Operation: to.Ptr("Read volume group resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volume Group resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/volumeGroups/write"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Writes a volume group resource."), - // Operation: to.Ptr("Write volume group resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volume Group resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/netAppAccounts/volumeGroups/delete"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Deletes a volume group resource."), - // Operation: to.Ptr("Delete volume group resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volume Group resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/locations/quotaLimits/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a Quotalimit resource type."), - // Operation: to.Ptr("Read QuotaLimit resource type"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("QuotaLimit resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/Operations/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads an operation resources."), - // Operation: to.Ptr("Read operation resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Operations resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/locations/operationresults/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads an operation result resource."), - // Operation: to.Ptr("Read operation result resource"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Operation results resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/locations/read"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Reads a location wide operation."), - // Operation: to.Ptr("Read location wide operation"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Location wide operation"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/locations/checknameavailability/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Check if resource name is available"), - // Operation: to.Ptr("Check if resource name is available"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("NetApp resources"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/locations/checkfilepathavailability/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Check if file path is available"), - // Operation: to.Ptr("Check if file path is available"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Volumes resource type"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/unregister/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Unregisters Subscription with Microsoft.NetApp resource provider"), - // Operation: to.Ptr("Unregister Subscription for Azure NetApp Files"), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("Subscription"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.NetApp/locations/checkinventory/action"), - // Display: &armnetapp.OperationDisplay{ - // Description: to.Ptr("Checks ReservedCapacity inventory."), - // Operation: to.Ptr("Checks ReservedCapacity inventory."), - // Provider: to.Ptr("Microsoft.NetApp Resource Provider"), - // Resource: to.Ptr("ReservedCapacity reservation resource."), - // }, - // Origin: to.Ptr("user,system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/options.go b/sdk/resourcemanager/netapp/armnetapp/options.go new file mode 100644 index 000000000000..fa952be4a6ef --- /dev/null +++ b/sdk/resourcemanager/netapp/armnetapp/options.go @@ -0,0 +1,465 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armnetapp + +// AccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the AccountsClient.BeginCreateOrUpdate method. +type AccountsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. +type AccountsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccountsClientBeginRenewCredentialsOptions contains the optional parameters for the AccountsClient.BeginRenewCredentials +// method. +type AccountsClientBeginRenewCredentialsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method. +type AccountsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. +type AccountsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.NewListBySubscriptionPager +// method. +type AccountsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. +type AccountsClientListOptions struct { + // placeholder for future optional parameters +} + +// BackupPoliciesClientBeginCreateOptions contains the optional parameters for the BackupPoliciesClient.BeginCreate method. +type BackupPoliciesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BackupPoliciesClientBeginDeleteOptions contains the optional parameters for the BackupPoliciesClient.BeginDelete method. +type BackupPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BackupPoliciesClientBeginUpdateOptions contains the optional parameters for the BackupPoliciesClient.BeginUpdate method. +type BackupPoliciesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// BackupPoliciesClientGetOptions contains the optional parameters for the BackupPoliciesClient.Get method. +type BackupPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. +type BackupPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + +// BackupsClientGetVolumeRestoreStatusOptions contains the optional parameters for the BackupsClient.GetVolumeRestoreStatus +// method. +type BackupsClientGetVolumeRestoreStatusOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the PoolsClient.BeginCreateOrUpdate method. +type PoolsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PoolsClientBeginDeleteOptions contains the optional parameters for the PoolsClient.BeginDelete method. +type PoolsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PoolsClientBeginUpdateOptions contains the optional parameters for the PoolsClient.BeginUpdate method. +type PoolsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PoolsClientGetOptions contains the optional parameters for the PoolsClient.Get method. +type PoolsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PoolsClientListOptions contains the optional parameters for the PoolsClient.NewListPager method. +type PoolsClientListOptions struct { + // placeholder for future optional parameters +} + +// ResourceClientBeginUpdateNetworkSiblingSetOptions contains the optional parameters for the ResourceClient.BeginUpdateNetworkSiblingSet +// method. +type ResourceClientBeginUpdateNetworkSiblingSetOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ResourceClientCheckFilePathAvailabilityOptions contains the optional parameters for the ResourceClient.CheckFilePathAvailability +// method. +type ResourceClientCheckFilePathAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ResourceClientCheckNameAvailabilityOptions contains the optional parameters for the ResourceClient.CheckNameAvailability +// method. +type ResourceClientCheckNameAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ResourceClientCheckQuotaAvailabilityOptions contains the optional parameters for the ResourceClient.CheckQuotaAvailability +// method. +type ResourceClientCheckQuotaAvailabilityOptions struct { + // placeholder for future optional parameters +} + +// ResourceClientQueryNetworkSiblingSetOptions contains the optional parameters for the ResourceClient.QueryNetworkSiblingSet +// method. +type ResourceClientQueryNetworkSiblingSetOptions struct { + // placeholder for future optional parameters +} + +// ResourceClientQueryRegionInfoOptions contains the optional parameters for the ResourceClient.QueryRegionInfo method. +type ResourceClientQueryRegionInfoOptions struct { + // placeholder for future optional parameters +} + +// ResourceQuotaLimitsClientGetOptions contains the optional parameters for the ResourceQuotaLimitsClient.Get method. +type ResourceQuotaLimitsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ResourceQuotaLimitsClientListOptions contains the optional parameters for the ResourceQuotaLimitsClient.NewListPager method. +type ResourceQuotaLimitsClientListOptions struct { + // placeholder for future optional parameters +} + +// SnapshotPoliciesClientBeginDeleteOptions contains the optional parameters for the SnapshotPoliciesClient.BeginDelete method. +type SnapshotPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotPoliciesClientBeginUpdateOptions contains the optional parameters for the SnapshotPoliciesClient.BeginUpdate method. +type SnapshotPoliciesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotPoliciesClientCreateOptions contains the optional parameters for the SnapshotPoliciesClient.Create method. +type SnapshotPoliciesClientCreateOptions struct { + // placeholder for future optional parameters +} + +// SnapshotPoliciesClientGetOptions contains the optional parameters for the SnapshotPoliciesClient.Get method. +type SnapshotPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SnapshotPoliciesClientListOptions contains the optional parameters for the SnapshotPoliciesClient.NewListPager method. +type SnapshotPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + +// SnapshotPoliciesClientListVolumesOptions contains the optional parameters for the SnapshotPoliciesClient.ListVolumes method. +type SnapshotPoliciesClientListVolumesOptions struct { + // placeholder for future optional parameters +} + +// SnapshotsClientBeginCreateOptions contains the optional parameters for the SnapshotsClient.BeginCreate method. +type SnapshotsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. +type SnapshotsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotsClientBeginRestoreFilesOptions contains the optional parameters for the SnapshotsClient.BeginRestoreFiles method. +type SnapshotsClientBeginRestoreFilesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. +type SnapshotsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. +type SnapshotsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. +type SnapshotsClientListOptions struct { + // placeholder for future optional parameters +} + +// SubvolumesClientBeginCreateOptions contains the optional parameters for the SubvolumesClient.BeginCreate method. +type SubvolumesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SubvolumesClientBeginDeleteOptions contains the optional parameters for the SubvolumesClient.BeginDelete method. +type SubvolumesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SubvolumesClientBeginGetMetadataOptions contains the optional parameters for the SubvolumesClient.BeginGetMetadata method. +type SubvolumesClientBeginGetMetadataOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SubvolumesClientBeginUpdateOptions contains the optional parameters for the SubvolumesClient.BeginUpdate method. +type SubvolumesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SubvolumesClientGetOptions contains the optional parameters for the SubvolumesClient.Get method. +type SubvolumesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SubvolumesClientListByVolumeOptions contains the optional parameters for the SubvolumesClient.NewListByVolumePager method. +type SubvolumesClientListByVolumeOptions struct { + // placeholder for future optional parameters +} + +// VolumeGroupsClientBeginCreateOptions contains the optional parameters for the VolumeGroupsClient.BeginCreate method. +type VolumeGroupsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumeGroupsClientBeginDeleteOptions contains the optional parameters for the VolumeGroupsClient.BeginDelete method. +type VolumeGroupsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumeGroupsClientGetOptions contains the optional parameters for the VolumeGroupsClient.Get method. +type VolumeGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VolumeGroupsClientListByNetAppAccountOptions contains the optional parameters for the VolumeGroupsClient.NewListByNetAppAccountPager +// method. +type VolumeGroupsClientListByNetAppAccountOptions struct { + // placeholder for future optional parameters +} + +// VolumeQuotaRulesClientBeginCreateOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginCreate method. +type VolumeQuotaRulesClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumeQuotaRulesClientBeginDeleteOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginDelete method. +type VolumeQuotaRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumeQuotaRulesClientBeginUpdateOptions contains the optional parameters for the VolumeQuotaRulesClient.BeginUpdate method. +type VolumeQuotaRulesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumeQuotaRulesClientGetOptions contains the optional parameters for the VolumeQuotaRulesClient.Get method. +type VolumeQuotaRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// VolumeQuotaRulesClientListByVolumeOptions contains the optional parameters for the VolumeQuotaRulesClient.NewListByVolumePager +// method. +type VolumeQuotaRulesClientListByVolumeOptions struct { + // placeholder for future optional parameters +} + +// VolumesClientBeginAuthorizeReplicationOptions contains the optional parameters for the VolumesClient.BeginAuthorizeReplication +// method. +type VolumesClientBeginAuthorizeReplicationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginBreakFileLocksOptions contains the optional parameters for the VolumesClient.BeginBreakFileLocks method. +type VolumesClientBeginBreakFileLocksOptions struct { + // Optional body to provide the ability to clear file locks with selected options + Body *BreakFileLocksRequest + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginBreakReplicationOptions contains the optional parameters for the VolumesClient.BeginBreakReplication +// method. +type VolumesClientBeginBreakReplicationOptions struct { + // Optional body to force break the replication. + Body *BreakReplicationRequest + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginCreateOrUpdateOptions contains the optional parameters for the VolumesClient.BeginCreateOrUpdate method. +type VolumesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginDeleteOptions contains the optional parameters for the VolumesClient.BeginDelete method. +type VolumesClientBeginDeleteOptions struct { + // An option to force delete the volume. Will cleanup resources connected to the particular volume + ForceDelete *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginDeleteReplicationOptions contains the optional parameters for the VolumesClient.BeginDeleteReplication +// method. +type VolumesClientBeginDeleteReplicationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginFinalizeRelocationOptions contains the optional parameters for the VolumesClient.BeginFinalizeRelocation +// method. +type VolumesClientBeginFinalizeRelocationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginListGetGroupIDListForLdapUserOptions contains the optional parameters for the VolumesClient.BeginListGetGroupIDListForLdapUser +// method. +type VolumesClientBeginListGetGroupIDListForLdapUserOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginPoolChangeOptions contains the optional parameters for the VolumesClient.BeginPoolChange method. +type VolumesClientBeginPoolChangeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginReInitializeReplicationOptions contains the optional parameters for the VolumesClient.BeginReInitializeReplication +// method. +type VolumesClientBeginReInitializeReplicationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginReestablishReplicationOptions contains the optional parameters for the VolumesClient.BeginReestablishReplication +// method. +type VolumesClientBeginReestablishReplicationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginRelocateOptions contains the optional parameters for the VolumesClient.BeginRelocate method. +type VolumesClientBeginRelocateOptions struct { + // Relocate volume request + Body *RelocateVolumeRequest + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginResetCifsPasswordOptions contains the optional parameters for the VolumesClient.BeginResetCifsPassword +// method. +type VolumesClientBeginResetCifsPasswordOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginResyncReplicationOptions contains the optional parameters for the VolumesClient.BeginResyncReplication +// method. +type VolumesClientBeginResyncReplicationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginRevertOptions contains the optional parameters for the VolumesClient.BeginRevert method. +type VolumesClientBeginRevertOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginRevertRelocationOptions contains the optional parameters for the VolumesClient.BeginRevertRelocation +// method. +type VolumesClientBeginRevertRelocationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientBeginUpdateOptions contains the optional parameters for the VolumesClient.BeginUpdate method. +type VolumesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VolumesClientGetOptions contains the optional parameters for the VolumesClient.Get method. +type VolumesClientGetOptions struct { + // placeholder for future optional parameters +} + +// VolumesClientListOptions contains the optional parameters for the VolumesClient.NewListPager method. +type VolumesClientListOptions struct { + // placeholder for future optional parameters +} + +// VolumesClientListReplicationsOptions contains the optional parameters for the VolumesClient.NewListReplicationsPager method. +type VolumesClientListReplicationsOptions struct { + // placeholder for future optional parameters +} + +// VolumesClientPopulateAvailabilityZoneOptions contains the optional parameters for the VolumesClient.PopulateAvailabilityZone +// method. +type VolumesClientPopulateAvailabilityZoneOptions struct { + // placeholder for future optional parameters +} + +// VolumesClientReplicationStatusOptions contains the optional parameters for the VolumesClient.ReplicationStatus method. +type VolumesClientReplicationStatusOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/netapp/armnetapp/pools_client.go b/sdk/resourcemanager/netapp/armnetapp/pools_client.go index 449987190d82..97d9a1464807 100644 --- a/sdk/resourcemanager/netapp/armnetapp/pools_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/pools_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -47,7 +46,7 @@ func NewPoolsClient(subscriptionID string, credential azcore.TokenCredential, op // BeginCreateOrUpdate - Create or Update a capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -60,9 +59,10 @@ func (client *PoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PoolsClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PoolsClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PoolsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -71,20 +71,22 @@ func (client *PoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGrou // CreateOrUpdate - Create or Update a capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *PoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, body CapacityPool, options *PoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, poolName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -111,16 +113,19 @@ func (client *PoolsClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -131,9 +136,10 @@ func (client *PoolsClient) BeginDelete(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PoolsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PoolsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PoolsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -142,20 +148,22 @@ func (client *PoolsClient) BeginDelete(ctx context.Context, resourceGroupName st // Delete - Delete the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *PoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, options *PoolsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -182,7 +190,7 @@ func (client *PoolsClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -190,24 +198,27 @@ func (client *PoolsClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Get details of the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool // - options - PoolsClientGetOptions contains the optional parameters for the PoolsClient.Get method. func (client *PoolsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, options *PoolsClientGetOptions) (PoolsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, options) if err != nil { return PoolsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PoolsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PoolsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PoolsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -234,7 +245,7 @@ func (client *PoolsClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,7 +262,7 @@ func (client *PoolsClient) getHandleResponse(resp *http.Response) (PoolsClientGe // NewListPager - List all capacity pools in the NetApp Account // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - options - PoolsClientListOptions contains the optional parameters for the PoolsClient.NewListPager method. @@ -303,7 +314,7 @@ func (client *PoolsClient) listCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +332,7 @@ func (client *PoolsClient) listHandleResponse(resp *http.Response) (PoolsClientL // BeginUpdate - Patch the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -333,9 +344,10 @@ func (client *PoolsClient) BeginUpdate(ctx context.Context, resourceGroupName st if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PoolsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PoolsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[PoolsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -344,20 +356,22 @@ func (client *PoolsClient) BeginUpdate(ctx context.Context, resourceGroupName st // Update - Patch the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *PoolsClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, body CapacityPoolPatch, options *PoolsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -384,8 +398,11 @@ func (client *PoolsClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go deleted file mode 100644 index a7168d4c1f92..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/pools_client_example_test.go +++ /dev/null @@ -1,201 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Pools_List.json -func ExamplePoolsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPoolsClient().NewListPager("myRG", "account1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CapacityPoolList = armnetapp.CapacityPoolList{ - // Value: []*armnetapp.CapacityPool{ - // { - // Name: to.Ptr("account1/pool1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.PoolProperties{ - // PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), - // ProvisioningState: to.Ptr("Succeeded"), - // QosType: to.Ptr(armnetapp.QosTypeAuto), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // Size: to.Ptr[int64](4398046511104), - // TotalThroughputMibps: to.Ptr[float32](281.474), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Pools_Get.json -func ExamplePoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPoolsClient().Get(ctx, "myRG", "account1", "pool1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityPool = armnetapp.CapacityPool{ - // Name: to.Ptr("account1/pool1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.PoolProperties{ - // PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), - // ProvisioningState: to.Ptr("Succeeded"), - // QosType: to.Ptr(armnetapp.QosTypeManual), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // Size: to.Ptr[int64](4398046511104), - // TotalThroughputMibps: to.Ptr[float32](281.474), - // UtilizedThroughputMibps: to.Ptr[float32](100.47), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Pools_CreateOrUpdate.json -func ExamplePoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPoolsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", "pool1", armnetapp.CapacityPool{ - Location: to.Ptr("eastus"), - Properties: &armnetapp.PoolProperties{ - QosType: to.Ptr(armnetapp.QosTypeAuto), - ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - Size: to.Ptr[int64](4398046511104), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityPool = armnetapp.CapacityPool{ - // Name: to.Ptr("account1/pool1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.PoolProperties{ - // PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), - // ProvisioningState: to.Ptr("Succeeded"), - // QosType: to.Ptr(armnetapp.QosTypeAuto), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // Size: to.Ptr[int64](4398046511104), - // TotalThroughputMibps: to.Ptr[float32](281.474), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Pools_Update.json -func ExamplePoolsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPoolsClient().BeginUpdate(ctx, "myRG", "account1", "pool1", armnetapp.CapacityPoolPatch{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityPool = armnetapp.CapacityPool{ - // Name: to.Ptr("account1/pool1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.PoolProperties{ - // PoolID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), - // ProvisioningState: to.Ptr("Succeeded"), - // QosType: to.Ptr(armnetapp.QosTypeManual), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // Size: to.Ptr[int64](4398046511104), - // TotalThroughputMibps: to.Ptr[float32](281.474), - // UtilizedThroughputMibps: to.Ptr[float32](100.47), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Pools_Delete.json -func ExamplePoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPoolsClient().BeginDelete(ctx, "myRG", "account1", "pool1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/resource_client.go b/sdk/resourcemanager/netapp/armnetapp/resource_client.go index 7508ee2f5bef..c8f7b52a7e73 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resource_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/resource_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -47,24 +46,27 @@ func NewResourceClient(subscriptionID string, credential azcore.TokenCredential, // CheckFilePathAvailability - Check if a file path is available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - location - The name of Azure region. // - body - File path availability request. // - options - ResourceClientCheckFilePathAvailabilityOptions contains the optional parameters for the ResourceClient.CheckFilePathAvailability // method. func (client *ResourceClient) CheckFilePathAvailability(ctx context.Context, location string, body FilePathAvailabilityRequest, options *ResourceClientCheckFilePathAvailabilityOptions) (ResourceClientCheckFilePathAvailabilityResponse, error) { + var err error req, err := client.checkFilePathAvailabilityCreateRequest(ctx, location, body, options) if err != nil { return ResourceClientCheckFilePathAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceClientCheckFilePathAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceClientCheckFilePathAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceClientCheckFilePathAvailabilityResponse{}, err } - return client.checkFilePathAvailabilityHandleResponse(resp) + resp, err := client.checkFilePathAvailabilityHandleResponse(httpResp) + return resp, err } // checkFilePathAvailabilityCreateRequest creates the CheckFilePathAvailability request. @@ -83,10 +85,13 @@ func (client *ResourceClient) checkFilePathAvailabilityCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // checkFilePathAvailabilityHandleResponse handles the CheckFilePathAvailability response. @@ -101,24 +106,27 @@ func (client *ResourceClient) checkFilePathAvailabilityHandleResponse(resp *http // CheckNameAvailability - Check if a resource name is available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - location - The name of Azure region. // - body - Name availability request. // - options - ResourceClientCheckNameAvailabilityOptions contains the optional parameters for the ResourceClient.CheckNameAvailability // method. func (client *ResourceClient) CheckNameAvailability(ctx context.Context, location string, body ResourceNameAvailabilityRequest, options *ResourceClientCheckNameAvailabilityOptions) (ResourceClientCheckNameAvailabilityResponse, error) { + var err error req, err := client.checkNameAvailabilityCreateRequest(ctx, location, body, options) if err != nil { return ResourceClientCheckNameAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceClientCheckNameAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceClientCheckNameAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceClientCheckNameAvailabilityResponse{}, err } - return client.checkNameAvailabilityHandleResponse(resp) + resp, err := client.checkNameAvailabilityHandleResponse(httpResp) + return resp, err } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. @@ -137,10 +145,13 @@ func (client *ResourceClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. @@ -155,24 +166,27 @@ func (client *ResourceClient) checkNameAvailabilityHandleResponse(resp *http.Res // CheckQuotaAvailability - Check if a quota is available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - location - The name of Azure region. // - body - Quota availability request. // - options - ResourceClientCheckQuotaAvailabilityOptions contains the optional parameters for the ResourceClient.CheckQuotaAvailability // method. func (client *ResourceClient) CheckQuotaAvailability(ctx context.Context, location string, body QuotaAvailabilityRequest, options *ResourceClientCheckQuotaAvailabilityOptions) (ResourceClientCheckQuotaAvailabilityResponse, error) { + var err error req, err := client.checkQuotaAvailabilityCreateRequest(ctx, location, body, options) if err != nil { return ResourceClientCheckQuotaAvailabilityResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceClientCheckQuotaAvailabilityResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceClientCheckQuotaAvailabilityResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceClientCheckQuotaAvailabilityResponse{}, err } - return client.checkQuotaAvailabilityHandleResponse(resp) + resp, err := client.checkQuotaAvailabilityHandleResponse(httpResp) + return resp, err } // checkQuotaAvailabilityCreateRequest creates the CheckQuotaAvailability request. @@ -191,10 +205,13 @@ func (client *ResourceClient) checkQuotaAvailabilityCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // checkQuotaAvailabilityHandleResponse handles the CheckQuotaAvailability response. @@ -206,26 +223,89 @@ func (client *ResourceClient) checkQuotaAvailabilityHandleResponse(resp *http.Re return result, nil } +// QueryNetworkSiblingSet - Get details of the specified network sibling set. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - location - The name of Azure region. +// - body - Network sibling set to query. +// - options - ResourceClientQueryNetworkSiblingSetOptions contains the optional parameters for the ResourceClient.QueryNetworkSiblingSet +// method. +func (client *ResourceClient) QueryNetworkSiblingSet(ctx context.Context, location string, body QueryNetworkSiblingSetRequest, options *ResourceClientQueryNetworkSiblingSetOptions) (ResourceClientQueryNetworkSiblingSetResponse, error) { + var err error + req, err := client.queryNetworkSiblingSetCreateRequest(ctx, location, body, options) + if err != nil { + return ResourceClientQueryNetworkSiblingSetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ResourceClientQueryNetworkSiblingSetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceClientQueryNetworkSiblingSetResponse{}, err + } + resp, err := client.queryNetworkSiblingSetHandleResponse(httpResp) + return resp, err +} + +// queryNetworkSiblingSetCreateRequest creates the QueryNetworkSiblingSet request. +func (client *ResourceClient) queryNetworkSiblingSetCreateRequest(ctx context.Context, location string, body QueryNetworkSiblingSetRequest, options *ResourceClientQueryNetworkSiblingSetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/queryNetworkSiblingSet" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// queryNetworkSiblingSetHandleResponse handles the QueryNetworkSiblingSet response. +func (client *ResourceClient) queryNetworkSiblingSetHandleResponse(resp *http.Response) (ResourceClientQueryNetworkSiblingSetResponse, error) { + result := ResourceClientQueryNetworkSiblingSetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSiblingSet); err != nil { + return ResourceClientQueryNetworkSiblingSetResponse{}, err + } + return result, nil +} + // QueryRegionInfo - Provides storage to network proximity and logical zone mapping information. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - location - The name of Azure region. // - options - ResourceClientQueryRegionInfoOptions contains the optional parameters for the ResourceClient.QueryRegionInfo // method. func (client *ResourceClient) QueryRegionInfo(ctx context.Context, location string, options *ResourceClientQueryRegionInfoOptions) (ResourceClientQueryRegionInfoResponse, error) { + var err error req, err := client.queryRegionInfoCreateRequest(ctx, location, options) if err != nil { return ResourceClientQueryRegionInfoResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceClientQueryRegionInfoResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceClientQueryRegionInfoResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceClientQueryRegionInfoResponse{}, err } - return client.queryRegionInfoHandleResponse(resp) + resp, err := client.queryRegionInfoHandleResponse(httpResp) + return resp, err } // queryRegionInfoCreateRequest creates the QueryRegionInfo request. @@ -244,7 +324,7 @@ func (client *ResourceClient) queryRegionInfoCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,3 +338,72 @@ func (client *ResourceClient) queryRegionInfoHandleResponse(resp *http.Response) } return result, nil } + +// BeginUpdateNetworkSiblingSet - Update the network features of the specified network sibling set. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - location - The name of Azure region. +// - body - Update for the specified network sibling set. +// - options - ResourceClientBeginUpdateNetworkSiblingSetOptions contains the optional parameters for the ResourceClient.BeginUpdateNetworkSiblingSet +// method. +func (client *ResourceClient) BeginUpdateNetworkSiblingSet(ctx context.Context, location string, body UpdateNetworkSiblingSetRequest, options *ResourceClientBeginUpdateNetworkSiblingSetOptions) (*runtime.Poller[ResourceClientUpdateNetworkSiblingSetResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateNetworkSiblingSet(ctx, location, body, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ResourceClientUpdateNetworkSiblingSetResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[ResourceClientUpdateNetworkSiblingSetResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// UpdateNetworkSiblingSet - Update the network features of the specified network sibling set. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +func (client *ResourceClient) updateNetworkSiblingSet(ctx context.Context, location string, body UpdateNetworkSiblingSetRequest, options *ResourceClientBeginUpdateNetworkSiblingSetOptions) (*http.Response, error) { + var err error + req, err := client.updateNetworkSiblingSetCreateRequest(ctx, location, body, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// updateNetworkSiblingSetCreateRequest creates the UpdateNetworkSiblingSet request. +func (client *ResourceClient) updateNetworkSiblingSetCreateRequest(ctx context.Context, location string, body UpdateNetworkSiblingSetRequest, options *ResourceClientBeginUpdateNetworkSiblingSetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/updateNetworkSiblingSet" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go deleted file mode 100644 index fe88f5dac56e..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/CheckNameAvailability.json -func ExampleResourceClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().CheckNameAvailability(ctx, "eastus", armnetapp.ResourceNameAvailabilityRequest{ - Name: to.Ptr("accName"), - Type: to.Ptr(armnetapp.CheckNameResourceTypes("netAppAccount")), - ResourceGroup: to.Ptr("myRG"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckAvailabilityResponse = armnetapp.CheckAvailabilityResponse{ - // IsAvailable: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/CheckFilePathAvailability.json -func ExampleResourceClient_CheckFilePathAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().CheckFilePathAvailability(ctx, "eastus", armnetapp.FilePathAvailabilityRequest{ - Name: to.Ptr("my-exact-filepth"), - SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckAvailabilityResponse = armnetapp.CheckAvailabilityResponse{ - // IsAvailable: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/CheckQuotaAvailability.json -func ExampleResourceClient_CheckQuotaAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().CheckQuotaAvailability(ctx, "eastus", armnetapp.QuotaAvailabilityRequest{ - Name: to.Ptr("resource1"), - Type: to.Ptr(armnetapp.CheckQuotaNameResourceTypesMicrosoftNetAppNetAppAccounts), - ResourceGroup: to.Ptr("myRG"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckAvailabilityResponse = armnetapp.CheckAvailabilityResponse{ - // IsAvailable: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/RegionInfo.json -func ExampleResourceClient_QueryRegionInfo() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceClient().QueryRegionInfo(ctx, "eastus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegionInfo = armnetapp.RegionInfo{ - // AvailabilityZoneMappings: []*armnetapp.RegionInfoAvailabilityZoneMappingsItem{ - // { - // AvailabilityZone: to.Ptr("1"), - // IsAvailable: to.Ptr(true), - // }}, - // StorageToNetworkProximity: to.Ptr(armnetapp.RegionStorageToNetworkProximityT2), - // } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go index 24fe9ca4358e..eac79aef8c9f 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -47,23 +46,26 @@ func NewResourceQuotaLimitsClient(subscriptionID string, credential azcore.Token // Get - Get the default and current subscription quota limit // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - location - The name of Azure region. // - quotaLimitName - The name of the Quota Limit // - options - ResourceQuotaLimitsClientGetOptions contains the optional parameters for the ResourceQuotaLimitsClient.Get method. func (client *ResourceQuotaLimitsClient) Get(ctx context.Context, location string, quotaLimitName string, options *ResourceQuotaLimitsClientGetOptions) (ResourceQuotaLimitsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, location, quotaLimitName, options) if err != nil { return ResourceQuotaLimitsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceQuotaLimitsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceQuotaLimitsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceQuotaLimitsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -86,7 +88,7 @@ func (client *ResourceQuotaLimitsClient) getCreateRequest(ctx context.Context, l return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -103,7 +105,7 @@ func (client *ResourceQuotaLimitsClient) getHandleResponse(resp *http.Response) // NewListPager - Get the default and current limits for quotas // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - location - The name of Azure region. // - options - ResourceQuotaLimitsClientListOptions contains the optional parameters for the ResourceQuotaLimitsClient.NewListPager // method. @@ -145,7 +147,7 @@ func (client *ResourceQuotaLimitsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go deleted file mode 100644 index 291f918b2401..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client_example_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/QuotaLimits_List.json -func ExampleResourceQuotaLimitsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceQuotaLimitsClient().NewListPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SubscriptionQuotaItemList = armnetapp.SubscriptionQuotaItemList{ - // Value: []*armnetapp.SubscriptionQuotaItem{ - // { - // Name: to.Ptr("eastus/accountsPerSubscription"), - // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/accountsPerSubscription"), - // Properties: &armnetapp.SubscriptionQuotaItemProperties{ - // Default: to.Ptr[int32](10), - // Current: to.Ptr[int32](10), - // }, - // }, - // { - // Name: to.Ptr("eastus/poolsPerAccount"), - // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/poolsPerAccount"), - // Properties: &armnetapp.SubscriptionQuotaItemProperties{ - // Default: to.Ptr[int32](25), - // Current: to.Ptr[int32](25), - // }, - // }, - // { - // Name: to.Ptr("eastus/volumesPerPool"), - // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/volumesPerPool"), - // Properties: &armnetapp.SubscriptionQuotaItemProperties{ - // Default: to.Ptr[int32](500), - // Current: to.Ptr[int32](500), - // }, - // }, - // { - // Name: to.Ptr("eastus/snapshotsPerVolume"), - // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/snapshotsPerVolume"), - // Properties: &armnetapp.SubscriptionQuotaItemProperties{ - // Default: to.Ptr[int32](255), - // Current: to.Ptr[int32](255), - // }, - // }, - // { - // Name: to.Ptr("eastus/totalTiBsPerSubscription"), - // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalTiBsPerSubscription"), - // Properties: &armnetapp.SubscriptionQuotaItemProperties{ - // Default: to.Ptr[int32](25), - // Current: to.Ptr[int32](1000), - // }, - // }, - // { - // Name: to.Ptr("eastus/totalDPVolumesPerSubscription"), - // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalDPVolumesPerSubscription"), - // Properties: &armnetapp.SubscriptionQuotaItemProperties{ - // Default: to.Ptr[int32](10), - // Current: to.Ptr[int32](10), - // }, - // }, - // { - // Name: to.Ptr("eastus/totalVolumesPerSubscription"), - // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalVolumesPerSubscription"), - // Properties: &armnetapp.SubscriptionQuotaItemProperties{ - // Default: to.Ptr[int32](500), - // Current: to.Ptr[int32](500), - // }, - // }, - // { - // Name: to.Ptr("eastus/totalCoolAccessVolumesPerSubscription"), - // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalCoolAccessVolumesPerSubscription"), - // Properties: &armnetapp.SubscriptionQuotaItemProperties{ - // Default: to.Ptr[int32](10), - // Current: to.Ptr[int32](10), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/QuotaLimits_Get.json -func ExampleResourceQuotaLimitsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceQuotaLimitsClient().Get(ctx, "eastus", "totalCoolAccessVolumesPerSubscription", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SubscriptionQuotaItem = armnetapp.SubscriptionQuotaItem{ - // Name: to.Ptr("eastus/totalCoolAccessVolumesPerSubscription"), - // Type: to.Ptr("Microsoft.NetApp/locations/quotaLimits"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/quotaLimits/totalCoolAccessVolumesPerSubscription"), - // Properties: &armnetapp.SubscriptionQuotaItemProperties{ - // Default: to.Ptr[int32](10), - // Current: to.Ptr[int32](10), - // }, - // } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/response_types.go b/sdk/resourcemanager/netapp/armnetapp/response_types.go index 94cce4c2d0dd..05a547948ca0 100644 --- a/sdk/resourcemanager/netapp/armnetapp/response_types.go +++ b/sdk/resourcemanager/netapp/armnetapp/response_types.go @@ -3,29 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp -// AccountBackupsClientDeleteResponse contains the response from method AccountBackupsClient.BeginDelete. -type AccountBackupsClientDeleteResponse struct { - // placeholder for future response values -} - -// AccountBackupsClientGetResponse contains the response from method AccountBackupsClient.Get. -type AccountBackupsClientGetResponse struct { - Backup -} - -// AccountBackupsClientListResponse contains the response from method AccountBackupsClient.NewListPager. -type AccountBackupsClientListResponse struct { - BackupsList -} - // AccountsClientCreateOrUpdateResponse contains the response from method AccountsClient.BeginCreateOrUpdate. type AccountsClientCreateOrUpdateResponse struct { + // NetApp account resource Account } @@ -36,16 +21,19 @@ type AccountsClientDeleteResponse struct { // AccountsClientGetResponse contains the response from method AccountsClient.Get. type AccountsClientGetResponse struct { + // NetApp account resource Account } // AccountsClientListBySubscriptionResponse contains the response from method AccountsClient.NewListBySubscriptionPager. type AccountsClientListBySubscriptionResponse struct { + // List of NetApp account resources AccountList } // AccountsClientListResponse contains the response from method AccountsClient.NewListPager. type AccountsClientListResponse struct { + // List of NetApp account resources AccountList } @@ -56,11 +44,13 @@ type AccountsClientRenewCredentialsResponse struct { // AccountsClientUpdateResponse contains the response from method AccountsClient.BeginUpdate. type AccountsClientUpdateResponse struct { + // NetApp account resource Account } // BackupPoliciesClientCreateResponse contains the response from method BackupPoliciesClient.BeginCreate. type BackupPoliciesClientCreateResponse struct { + // Backup policy information BackupPolicy } @@ -71,66 +61,38 @@ type BackupPoliciesClientDeleteResponse struct { // BackupPoliciesClientGetResponse contains the response from method BackupPoliciesClient.Get. type BackupPoliciesClientGetResponse struct { + // Backup policy information BackupPolicy } // BackupPoliciesClientListResponse contains the response from method BackupPoliciesClient.NewListPager. type BackupPoliciesClientListResponse struct { + // List of Backup Policies BackupPoliciesList } // BackupPoliciesClientUpdateResponse contains the response from method BackupPoliciesClient.BeginUpdate. type BackupPoliciesClientUpdateResponse struct { + // Backup policy information BackupPolicy } -// BackupsClientCreateResponse contains the response from method BackupsClient.BeginCreate. -type BackupsClientCreateResponse struct { - Backup -} - -// BackupsClientDeleteResponse contains the response from method BackupsClient.BeginDelete. -type BackupsClientDeleteResponse struct { - // placeholder for future response values -} - -// BackupsClientGetResponse contains the response from method BackupsClient.Get. -type BackupsClientGetResponse struct { - Backup -} - -// BackupsClientGetStatusResponse contains the response from method BackupsClient.GetStatus. -type BackupsClientGetStatusResponse struct { - BackupStatus -} - // BackupsClientGetVolumeRestoreStatusResponse contains the response from method BackupsClient.GetVolumeRestoreStatus. type BackupsClientGetVolumeRestoreStatusResponse struct { + // Restore status RestoreStatus } -// BackupsClientListResponse contains the response from method BackupsClient.NewListPager. -type BackupsClientListResponse struct { - BackupsList -} - -// BackupsClientRestoreFilesResponse contains the response from method BackupsClient.BeginRestoreFiles. -type BackupsClientRestoreFilesResponse struct { - // placeholder for future response values -} - -// BackupsClientUpdateResponse contains the response from method BackupsClient.BeginUpdate. -type BackupsClientUpdateResponse struct { - Backup -} - // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Result of the request to list Cloud Volume operations. It contains a list of operations and a URL link to get the next + // set of results. OperationListResult } // PoolsClientCreateOrUpdateResponse contains the response from method PoolsClient.BeginCreateOrUpdate. type PoolsClientCreateOrUpdateResponse struct { + // Capacity pool resource CapacityPool } @@ -141,51 +103,73 @@ type PoolsClientDeleteResponse struct { // PoolsClientGetResponse contains the response from method PoolsClient.Get. type PoolsClientGetResponse struct { + // Capacity pool resource CapacityPool } // PoolsClientListResponse contains the response from method PoolsClient.NewListPager. type PoolsClientListResponse struct { + // List of capacity pool resources CapacityPoolList } // PoolsClientUpdateResponse contains the response from method PoolsClient.BeginUpdate. type PoolsClientUpdateResponse struct { + // Capacity pool resource CapacityPool } // ResourceClientCheckFilePathAvailabilityResponse contains the response from method ResourceClient.CheckFilePathAvailability. type ResourceClientCheckFilePathAvailabilityResponse struct { + // Information regarding availability of a resource. CheckAvailabilityResponse } // ResourceClientCheckNameAvailabilityResponse contains the response from method ResourceClient.CheckNameAvailability. type ResourceClientCheckNameAvailabilityResponse struct { + // Information regarding availability of a resource. CheckAvailabilityResponse } // ResourceClientCheckQuotaAvailabilityResponse contains the response from method ResourceClient.CheckQuotaAvailability. type ResourceClientCheckQuotaAvailabilityResponse struct { + // Information regarding availability of a resource. CheckAvailabilityResponse } +// ResourceClientQueryNetworkSiblingSetResponse contains the response from method ResourceClient.QueryNetworkSiblingSet. +type ResourceClientQueryNetworkSiblingSetResponse struct { + // Describes the contents of a network sibling set. + NetworkSiblingSet +} + // ResourceClientQueryRegionInfoResponse contains the response from method ResourceClient.QueryRegionInfo. type ResourceClientQueryRegionInfoResponse struct { + // Provides region specific information. RegionInfo } +// ResourceClientUpdateNetworkSiblingSetResponse contains the response from method ResourceClient.BeginUpdateNetworkSiblingSet. +type ResourceClientUpdateNetworkSiblingSetResponse struct { + // Describes the contents of a network sibling set. + NetworkSiblingSet +} + // ResourceQuotaLimitsClientGetResponse contains the response from method ResourceQuotaLimitsClient.Get. type ResourceQuotaLimitsClientGetResponse struct { + // Information regarding Subscription Quota Item. SubscriptionQuotaItem } // ResourceQuotaLimitsClientListResponse contains the response from method ResourceQuotaLimitsClient.NewListPager. type ResourceQuotaLimitsClientListResponse struct { + // List of Subscription Quota Items SubscriptionQuotaItemList } // SnapshotPoliciesClientCreateResponse contains the response from method SnapshotPoliciesClient.Create. type SnapshotPoliciesClientCreateResponse struct { + // Snapshot policy information SnapshotPolicy } @@ -196,26 +180,31 @@ type SnapshotPoliciesClientDeleteResponse struct { // SnapshotPoliciesClientGetResponse contains the response from method SnapshotPoliciesClient.Get. type SnapshotPoliciesClientGetResponse struct { + // Snapshot policy information SnapshotPolicy } // SnapshotPoliciesClientListResponse contains the response from method SnapshotPoliciesClient.NewListPager. type SnapshotPoliciesClientListResponse struct { + // List of Snapshot Policies SnapshotPoliciesList } // SnapshotPoliciesClientListVolumesResponse contains the response from method SnapshotPoliciesClient.ListVolumes. type SnapshotPoliciesClientListVolumesResponse struct { + // Volumes associated with snapshot policy SnapshotPolicyVolumeList } // SnapshotPoliciesClientUpdateResponse contains the response from method SnapshotPoliciesClient.BeginUpdate. type SnapshotPoliciesClientUpdateResponse struct { + // Snapshot policy information SnapshotPolicy } // SnapshotsClientCreateResponse contains the response from method SnapshotsClient.BeginCreate. type SnapshotsClientCreateResponse struct { + // Snapshot of a Volume Snapshot } @@ -226,11 +215,13 @@ type SnapshotsClientDeleteResponse struct { // SnapshotsClientGetResponse contains the response from method SnapshotsClient.Get. type SnapshotsClientGetResponse struct { + // Snapshot of a Volume Snapshot } // SnapshotsClientListResponse contains the response from method SnapshotsClient.NewListPager. type SnapshotsClientListResponse struct { + // List of Snapshots SnapshotsList } @@ -241,11 +232,13 @@ type SnapshotsClientRestoreFilesResponse struct { // SnapshotsClientUpdateResponse contains the response from method SnapshotsClient.BeginUpdate. type SnapshotsClientUpdateResponse struct { + // Snapshot of a Volume Snapshot } // SubvolumesClientCreateResponse contains the response from method SubvolumesClient.BeginCreate. type SubvolumesClientCreateResponse struct { + // Subvolume Information properties SubvolumeInfo } @@ -256,26 +249,31 @@ type SubvolumesClientDeleteResponse struct { // SubvolumesClientGetMetadataResponse contains the response from method SubvolumesClient.BeginGetMetadata. type SubvolumesClientGetMetadataResponse struct { + // Result of the post subvolume and action is to get metadata of the subvolume. SubvolumeModel } // SubvolumesClientGetResponse contains the response from method SubvolumesClient.Get. type SubvolumesClientGetResponse struct { + // Subvolume Information properties SubvolumeInfo } // SubvolumesClientListByVolumeResponse contains the response from method SubvolumesClient.NewListByVolumePager. type SubvolumesClientListByVolumeResponse struct { + // List of Subvolumes SubvolumesList } // SubvolumesClientUpdateResponse contains the response from method SubvolumesClient.BeginUpdate. type SubvolumesClientUpdateResponse struct { + // Subvolume Information properties SubvolumeInfo } // VolumeGroupsClientCreateResponse contains the response from method VolumeGroupsClient.BeginCreate. type VolumeGroupsClientCreateResponse struct { + // Volume group resource for create VolumeGroupDetails } @@ -286,16 +284,19 @@ type VolumeGroupsClientDeleteResponse struct { // VolumeGroupsClientGetResponse contains the response from method VolumeGroupsClient.Get. type VolumeGroupsClientGetResponse struct { + // Volume group resource for create VolumeGroupDetails } // VolumeGroupsClientListByNetAppAccountResponse contains the response from method VolumeGroupsClient.NewListByNetAppAccountPager. type VolumeGroupsClientListByNetAppAccountResponse struct { + // List of volume group resources VolumeGroupList } // VolumeQuotaRulesClientCreateResponse contains the response from method VolumeQuotaRulesClient.BeginCreate. type VolumeQuotaRulesClientCreateResponse struct { + // Quota Rule of a Volume VolumeQuotaRule } @@ -306,16 +307,19 @@ type VolumeQuotaRulesClientDeleteResponse struct { // VolumeQuotaRulesClientGetResponse contains the response from method VolumeQuotaRulesClient.Get. type VolumeQuotaRulesClientGetResponse struct { + // Quota Rule of a Volume VolumeQuotaRule } // VolumeQuotaRulesClientListByVolumeResponse contains the response from method VolumeQuotaRulesClient.NewListByVolumePager. type VolumeQuotaRulesClientListByVolumeResponse struct { + // List of Volume Quota Rules VolumeQuotaRulesList } // VolumeQuotaRulesClientUpdateResponse contains the response from method VolumeQuotaRulesClient.BeginUpdate. type VolumeQuotaRulesClientUpdateResponse struct { + // Quota Rule of a Volume VolumeQuotaRule } @@ -336,6 +340,7 @@ type VolumesClientBreakReplicationResponse struct { // VolumesClientCreateOrUpdateResponse contains the response from method VolumesClient.BeginCreateOrUpdate. type VolumesClientCreateOrUpdateResponse struct { + // Volume resource Volume } @@ -356,21 +361,25 @@ type VolumesClientFinalizeRelocationResponse struct { // VolumesClientGetResponse contains the response from method VolumesClient.Get. type VolumesClientGetResponse struct { + // Volume resource Volume } // VolumesClientListGetGroupIDListForLdapUserResponse contains the response from method VolumesClient.BeginListGetGroupIDListForLdapUser. type VolumesClientListGetGroupIDListForLdapUserResponse struct { + // Group Id list for Ldap user GetGroupIDListForLDAPUserResponse } // VolumesClientListReplicationsResponse contains the response from method VolumesClient.NewListReplicationsPager. type VolumesClientListReplicationsResponse struct { + // List Replications ListReplications } // VolumesClientListResponse contains the response from method VolumesClient.NewListPager. type VolumesClientListResponse struct { + // List of volume resources VolumeList } @@ -379,6 +388,12 @@ type VolumesClientPoolChangeResponse struct { // placeholder for future response values } +// VolumesClientPopulateAvailabilityZoneResponse contains the response from method VolumesClient.PopulateAvailabilityZone. +type VolumesClientPopulateAvailabilityZoneResponse struct { + // Volume resource + Volume +} + // VolumesClientReInitializeReplicationResponse contains the response from method VolumesClient.BeginReInitializeReplication. type VolumesClientReInitializeReplicationResponse struct { // placeholder for future response values @@ -396,6 +411,7 @@ type VolumesClientRelocateResponse struct { // VolumesClientReplicationStatusResponse contains the response from method VolumesClient.ReplicationStatus. type VolumesClientReplicationStatusResponse struct { + // Replication status ReplicationStatus } @@ -421,5 +437,6 @@ type VolumesClientRevertResponse struct { // VolumesClientUpdateResponse contains the response from method VolumesClient.BeginUpdate. type VolumesClientUpdateResponse struct { + // Volume resource Volume } diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go index 58daf446d69a..0b6e8ce360e4 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -47,25 +46,28 @@ func NewSnapshotPoliciesClient(subscriptionID string, credential azcore.TokenCre // Create - Create a snapshot policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - snapshotPolicyName - The name of the snapshot policy // - body - Snapshot policy object supplied in the body of the operation. // - options - SnapshotPoliciesClientCreateOptions contains the optional parameters for the SnapshotPoliciesClient.Create method. func (client *SnapshotPoliciesClient) Create(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, body SnapshotPolicy, options *SnapshotPoliciesClientCreateOptions) (SnapshotPoliciesClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, snapshotPolicyName, body, options) if err != nil { return SnapshotPoliciesClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SnapshotPoliciesClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return SnapshotPoliciesClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return SnapshotPoliciesClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -92,10 +94,13 @@ func (client *SnapshotPoliciesClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -110,7 +115,7 @@ func (client *SnapshotPoliciesClient) createHandleResponse(resp *http.Response) // BeginDelete - Delete snapshot policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - snapshotPolicyName - The name of the snapshot policy @@ -122,9 +127,10 @@ func (client *SnapshotPoliciesClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotPoliciesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotPoliciesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SnapshotPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -133,20 +139,22 @@ func (client *SnapshotPoliciesClient) BeginDelete(ctx context.Context, resourceG // Delete - Delete snapshot policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SnapshotPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, options *SnapshotPoliciesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, snapshotPolicyName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -173,7 +181,7 @@ func (client *SnapshotPoliciesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -181,24 +189,27 @@ func (client *SnapshotPoliciesClient) deleteCreateRequest(ctx context.Context, r // Get - Get a snapshot Policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - snapshotPolicyName - The name of the snapshot policy // - options - SnapshotPoliciesClientGetOptions contains the optional parameters for the SnapshotPoliciesClient.Get method. func (client *SnapshotPoliciesClient) Get(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, options *SnapshotPoliciesClientGetOptions) (SnapshotPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, snapshotPolicyName, options) if err != nil { return SnapshotPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SnapshotPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SnapshotPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SnapshotPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -225,7 +236,7 @@ func (client *SnapshotPoliciesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +253,7 @@ func (client *SnapshotPoliciesClient) getHandleResponse(resp *http.Response) (Sn // NewListPager - List snapshot policy // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - options - SnapshotPoliciesClientListOptions contains the optional parameters for the SnapshotPoliciesClient.NewListPager @@ -289,7 +300,7 @@ func (client *SnapshotPoliciesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,25 +318,28 @@ func (client *SnapshotPoliciesClient) listHandleResponse(resp *http.Response) (S // ListVolumes - Get volumes associated with snapshot policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - snapshotPolicyName - The name of the snapshot policy // - options - SnapshotPoliciesClientListVolumesOptions contains the optional parameters for the SnapshotPoliciesClient.ListVolumes // method. func (client *SnapshotPoliciesClient) ListVolumes(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, options *SnapshotPoliciesClientListVolumesOptions) (SnapshotPoliciesClientListVolumesResponse, error) { + var err error req, err := client.listVolumesCreateRequest(ctx, resourceGroupName, accountName, snapshotPolicyName, options) if err != nil { return SnapshotPoliciesClientListVolumesResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SnapshotPoliciesClientListVolumesResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SnapshotPoliciesClientListVolumesResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SnapshotPoliciesClientListVolumesResponse{}, err } - return client.listVolumesHandleResponse(resp) + resp, err := client.listVolumesHandleResponse(httpResp) + return resp, err } // listVolumesCreateRequest creates the ListVolumes request. @@ -352,7 +366,7 @@ func (client *SnapshotPoliciesClient) listVolumesCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,7 +384,7 @@ func (client *SnapshotPoliciesClient) listVolumesHandleResponse(resp *http.Respo // BeginUpdate - Patch a snapshot policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - snapshotPolicyName - The name of the snapshot policy @@ -383,9 +397,10 @@ func (client *SnapshotPoliciesClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotPoliciesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotPoliciesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SnapshotPoliciesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -394,20 +409,22 @@ func (client *SnapshotPoliciesClient) BeginUpdate(ctx context.Context, resourceG // Update - Patch a snapshot policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SnapshotPoliciesClient) update(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, body SnapshotPolicyPatch, options *SnapshotPoliciesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, snapshotPolicyName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -434,8 +451,11 @@ func (client *SnapshotPoliciesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go deleted file mode 100644 index f9f5454a263a..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client_example_test.go +++ /dev/null @@ -1,346 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_List.json -func ExampleSnapshotPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSnapshotPoliciesClient().NewListPager("myRG", "account1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SnapshotPoliciesList = armnetapp.SnapshotPoliciesList{ - // Value: []*armnetapp.SnapshotPolicy{ - // { - // Name: to.Ptr("account1/snapshotPolicy1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.SnapshotPolicyProperties{ - // DailySchedule: &armnetapp.DailySchedule{ - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](30), - // SnapshotsToKeep: to.Ptr[int32](4), - // }, - // Enabled: to.Ptr(true), - // HourlySchedule: &armnetapp.HourlySchedule{ - // Minute: to.Ptr[int32](50), - // SnapshotsToKeep: to.Ptr[int32](2), - // }, - // MonthlySchedule: &armnetapp.MonthlySchedule{ - // DaysOfMonth: to.Ptr("10,11,12"), - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](15), - // SnapshotsToKeep: to.Ptr[int32](5), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // WeeklySchedule: &armnetapp.WeeklySchedule{ - // Day: to.Ptr("Wednesday"), - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](45), - // SnapshotsToKeep: to.Ptr[int32](3), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_Get.json -func ExampleSnapshotPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSnapshotPoliciesClient().Get(ctx, "myRG", "account1", "snapshotPolicyName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SnapshotPolicy = armnetapp.SnapshotPolicy{ - // Name: to.Ptr("account1/snapshotPolicy1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.SnapshotPolicyProperties{ - // DailySchedule: &armnetapp.DailySchedule{ - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](30), - // SnapshotsToKeep: to.Ptr[int32](4), - // }, - // Enabled: to.Ptr(true), - // HourlySchedule: &armnetapp.HourlySchedule{ - // Minute: to.Ptr[int32](50), - // SnapshotsToKeep: to.Ptr[int32](2), - // }, - // MonthlySchedule: &armnetapp.MonthlySchedule{ - // DaysOfMonth: to.Ptr("10,11,12"), - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](15), - // SnapshotsToKeep: to.Ptr[int32](5), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // WeeklySchedule: &armnetapp.WeeklySchedule{ - // Day: to.Ptr("Wednesday"), - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](45), - // SnapshotsToKeep: to.Ptr[int32](3), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_Create.json -func ExampleSnapshotPoliciesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSnapshotPoliciesClient().Create(ctx, "myRG", "account1", "snapshotPolicyName", armnetapp.SnapshotPolicy{ - Location: to.Ptr("eastus"), - Properties: &armnetapp.SnapshotPolicyProperties{ - DailySchedule: &armnetapp.DailySchedule{ - Hour: to.Ptr[int32](14), - Minute: to.Ptr[int32](30), - SnapshotsToKeep: to.Ptr[int32](4), - }, - Enabled: to.Ptr(true), - HourlySchedule: &armnetapp.HourlySchedule{ - Minute: to.Ptr[int32](50), - SnapshotsToKeep: to.Ptr[int32](2), - }, - MonthlySchedule: &armnetapp.MonthlySchedule{ - DaysOfMonth: to.Ptr("10,11,12"), - Hour: to.Ptr[int32](14), - Minute: to.Ptr[int32](15), - SnapshotsToKeep: to.Ptr[int32](5), - }, - WeeklySchedule: &armnetapp.WeeklySchedule{ - Day: to.Ptr("Wednesday"), - Hour: to.Ptr[int32](14), - Minute: to.Ptr[int32](45), - SnapshotsToKeep: to.Ptr[int32](3), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SnapshotPolicy = armnetapp.SnapshotPolicy{ - // Name: to.Ptr("account1/snapshotPolicy1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.SnapshotPolicyProperties{ - // DailySchedule: &armnetapp.DailySchedule{ - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](30), - // SnapshotsToKeep: to.Ptr[int32](4), - // }, - // Enabled: to.Ptr(true), - // HourlySchedule: &armnetapp.HourlySchedule{ - // Minute: to.Ptr[int32](50), - // SnapshotsToKeep: to.Ptr[int32](2), - // }, - // MonthlySchedule: &armnetapp.MonthlySchedule{ - // DaysOfMonth: to.Ptr("10,11,12"), - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](15), - // SnapshotsToKeep: to.Ptr[int32](5), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // WeeklySchedule: &armnetapp.WeeklySchedule{ - // Day: to.Ptr("Wednesday"), - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](45), - // SnapshotsToKeep: to.Ptr[int32](3), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_Update.json -func ExampleSnapshotPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotPoliciesClient().BeginUpdate(ctx, "myRG", "account1", "snapshotPolicyName", armnetapp.SnapshotPolicyPatch{ - Location: to.Ptr("eastus"), - Properties: &armnetapp.SnapshotPolicyProperties{ - DailySchedule: &armnetapp.DailySchedule{ - Hour: to.Ptr[int32](14), - Minute: to.Ptr[int32](30), - SnapshotsToKeep: to.Ptr[int32](4), - }, - Enabled: to.Ptr(true), - HourlySchedule: &armnetapp.HourlySchedule{ - Minute: to.Ptr[int32](50), - SnapshotsToKeep: to.Ptr[int32](2), - }, - MonthlySchedule: &armnetapp.MonthlySchedule{ - DaysOfMonth: to.Ptr("10,11,12"), - Hour: to.Ptr[int32](14), - Minute: to.Ptr[int32](15), - SnapshotsToKeep: to.Ptr[int32](5), - }, - WeeklySchedule: &armnetapp.WeeklySchedule{ - Day: to.Ptr("Wednesday"), - Hour: to.Ptr[int32](14), - Minute: to.Ptr[int32](45), - SnapshotsToKeep: to.Ptr[int32](3), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SnapshotPolicy = armnetapp.SnapshotPolicy{ - // Name: to.Ptr("account1/snapshotPolicy1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/snapshotPolicies"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.SnapshotPolicyProperties{ - // DailySchedule: &armnetapp.DailySchedule{ - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](30), - // SnapshotsToKeep: to.Ptr[int32](4), - // }, - // Enabled: to.Ptr(true), - // HourlySchedule: &armnetapp.HourlySchedule{ - // Minute: to.Ptr[int32](50), - // SnapshotsToKeep: to.Ptr[int32](2), - // }, - // MonthlySchedule: &armnetapp.MonthlySchedule{ - // DaysOfMonth: to.Ptr("10,11,12"), - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](15), - // SnapshotsToKeep: to.Ptr[int32](5), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // WeeklySchedule: &armnetapp.WeeklySchedule{ - // Day: to.Ptr("Wednesday"), - // Hour: to.Ptr[int32](14), - // Minute: to.Ptr[int32](45), - // SnapshotsToKeep: to.Ptr[int32](3), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_Delete.json -func ExampleSnapshotPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotPoliciesClient().BeginDelete(ctx, "resourceGroup", "accountName", "snapshotPolicyName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/SnapshotPolicies_ListVolumes.json -func ExampleSnapshotPoliciesClient_ListVolumes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSnapshotPoliciesClient().ListVolumes(ctx, "myRG", "account1", "snapshotPolicyName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SnapshotPolicyVolumeList = armnetapp.SnapshotPolicyVolumeList{ - // Value: []*armnetapp.Volume{ - // { - // Name: to.Ptr("account1/pool1/volume1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("some-amazing-filepath"), - // FileSystemID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - // ThroughputMibps: to.Ptr[float32](128), - // UsageThreshold: to.Ptr[int64](107374182400), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go b/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go index 48a803cf104d..40249fb24a79 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -47,7 +46,7 @@ func NewSnapshotsClient(subscriptionID string, credential azcore.TokenCredential // BeginCreate - Create the specified snapshot within the given volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -61,9 +60,10 @@ func (client *SnapshotsClient) BeginCreate(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SnapshotsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ func (client *SnapshotsClient) BeginCreate(ctx context.Context, resourceGroupNam // Create - Create the specified snapshot within the given volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SnapshotsClient) create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body Snapshot, options *SnapshotsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -120,16 +122,19 @@ func (client *SnapshotsClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete snapshot // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -142,9 +147,10 @@ func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SnapshotsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -153,20 +159,22 @@ func (client *SnapshotsClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Delete snapshot // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SnapshotsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, options *SnapshotsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -201,7 +209,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -209,7 +217,7 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource // Get - Get details of the specified snapshot // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -217,18 +225,21 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource // - snapshotName - The name of the snapshot // - options - SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. func (client *SnapshotsClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, options *SnapshotsClientGetOptions) (SnapshotsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, options) if err != nil { return SnapshotsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SnapshotsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SnapshotsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SnapshotsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -263,7 +274,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +291,7 @@ func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (Snapshots // NewListPager - List all snapshots associated with the volume // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -336,7 +347,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +365,7 @@ func (client *SnapshotsClient) listHandleResponse(resp *http.Response) (Snapshot // BeginRestoreFiles - Restore the specified files from the specified snapshot to the active filesystem // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -369,9 +380,10 @@ func (client *SnapshotsClient) BeginRestoreFiles(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientRestoreFilesResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientRestoreFilesResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SnapshotsClientRestoreFilesResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -380,20 +392,22 @@ func (client *SnapshotsClient) BeginRestoreFiles(ctx context.Context, resourceGr // RestoreFiles - Restore the specified files from the specified snapshot to the active filesystem // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SnapshotsClient) restoreFiles(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body SnapshotRestoreFiles, options *SnapshotsClientBeginRestoreFilesOptions) (*http.Response, error) { + var err error req, err := client.restoreFilesCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // restoreFilesCreateRequest creates the RestoreFiles request. @@ -428,15 +442,18 @@ func (client *SnapshotsClient) restoreFilesCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginUpdate - Patch a snapshot // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -450,9 +467,10 @@ func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SnapshotsClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SnapshotsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -461,20 +479,22 @@ func (client *SnapshotsClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Patch a snapshot // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SnapshotsClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, snapshotName string, body any, options *SnapshotsClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, snapshotName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -509,8 +529,11 @@ func (client *SnapshotsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go deleted file mode 100644 index c657ec67a1ad..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/snapshots_client_example_test.go +++ /dev/null @@ -1,193 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_List.json -func ExampleSnapshotsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSnapshotsClient().NewListPager("myRG", "account1", "pool1", "volume1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SnapshotsList = armnetapp.SnapshotsList{ - // Value: []*armnetapp.Snapshot{ - // { - // Name: to.Ptr("account1/pool1/volume1/snapshot1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.SnapshotProperties{ - // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // ProvisioningState: to.Ptr("Succeeded"), - // SnapshotID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_Get.json -func ExampleSnapshotsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSnapshotsClient().Get(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armnetapp.Snapshot{ - // Name: to.Ptr("account1/pool1/volume1/snapshot1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.SnapshotProperties{ - // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // ProvisioningState: to.Ptr("Succeeded"), - // SnapshotID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_Create.json -func ExampleSnapshotsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().BeginCreate(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", armnetapp.Snapshot{ - Location: to.Ptr("eastus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_Update.json -func ExampleSnapshotsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", map[string]any{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armnetapp.Snapshot{ - // Name: to.Ptr("account1/pool1/volume1/snapshot1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.SnapshotProperties{ - // Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // ProvisioningState: to.Ptr("Succeeded"), - // SnapshotID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_Delete.json -func ExampleSnapshotsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Snapshots_SingleFileRestore.json -func ExampleSnapshotsClient_BeginRestoreFiles() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().BeginRestoreFiles(ctx, "myRG", "account1", "pool1", "volume1", "snapshot1", armnetapp.SnapshotRestoreFiles{ - FilePaths: []*string{ - to.Ptr("/dir1/customer1.db"), - to.Ptr("/dir1/customer2.db")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go index 20f25b005436..3e7dd176028c 100644 --- a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -47,7 +46,7 @@ func NewSubvolumesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreate - Creates a subvolume in the path or clones the subvolume mentioned in the parentPath // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -61,9 +60,10 @@ func (client *SubvolumesClient) BeginCreate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SubvolumesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,20 +72,22 @@ func (client *SubvolumesClient) BeginCreate(ctx context.Context, resourceGroupNa // Create - Creates a subvolume in the path or clones the subvolume mentioned in the parentPath // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SubvolumesClient) create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, body SubvolumeInfo, options *SubvolumesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -120,16 +122,19 @@ func (client *SubvolumesClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete subvolume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -142,9 +147,10 @@ func (client *SubvolumesClient) BeginDelete(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SubvolumesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -153,20 +159,22 @@ func (client *SubvolumesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Delete subvolume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SubvolumesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, options *SubvolumesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -201,7 +209,7 @@ func (client *SubvolumesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -209,7 +217,7 @@ func (client *SubvolumesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Returns the path associated with the subvolumeName provided // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -217,18 +225,21 @@ func (client *SubvolumesClient) deleteCreateRequest(ctx context.Context, resourc // - subvolumeName - The name of the subvolume. // - options - SubvolumesClientGetOptions contains the optional parameters for the SubvolumesClient.Get method. func (client *SubvolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, options *SubvolumesClientGetOptions) (SubvolumesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, options) if err != nil { return SubvolumesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubvolumesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubvolumesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SubvolumesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -263,7 +274,7 @@ func (client *SubvolumesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +292,7 @@ func (client *SubvolumesClient) getHandleResponse(resp *http.Response) (Subvolum // BeginGetMetadata - Get details of the specified subvolume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -295,9 +306,10 @@ func (client *SubvolumesClient) BeginGetMetadata(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientGetMetadataResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientGetMetadataResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SubvolumesClientGetMetadataResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -306,20 +318,22 @@ func (client *SubvolumesClient) BeginGetMetadata(ctx context.Context, resourceGr // GetMetadata - Get details of the specified subvolume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SubvolumesClient) getMetadata(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, options *SubvolumesClientBeginGetMetadataOptions) (*http.Response, error) { + var err error req, err := client.getMetadataCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // getMetadataCreateRequest creates the GetMetadata request. @@ -354,7 +368,7 @@ func (client *SubvolumesClient) getMetadataCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -362,7 +376,7 @@ func (client *SubvolumesClient) getMetadataCreateRequest(ctx context.Context, re // NewListByVolumePager - Returns a list of the subvolumes in the volume // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -425,7 +439,7 @@ func (client *SubvolumesClient) listByVolumeCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -443,7 +457,7 @@ func (client *SubvolumesClient) listByVolumeHandleResponse(resp *http.Response) // BeginUpdate - Patch a subvolume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -457,9 +471,10 @@ func (client *SubvolumesClient) BeginUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[SubvolumesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[SubvolumesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -468,20 +483,22 @@ func (client *SubvolumesClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Patch a subvolume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *SubvolumesClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, subvolumeName string, body SubvolumePatchRequest, options *SubvolumesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, subvolumeName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -516,8 +533,11 @@ func (client *SubvolumesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go deleted file mode 100644 index ad8214b69c4f..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client_example_test.go +++ /dev/null @@ -1,216 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_List.json -func ExampleSubvolumesClient_NewListByVolumePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubvolumesClient().NewListByVolumePager("myRG", "account1", "pool1", "volume1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SubvolumesList = armnetapp.SubvolumesList{ - // Value: []*armnetapp.SubvolumeInfo{ - // { - // Name: to.Ptr("account1/pool1/volume1/subvolume1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/subvolumes/subvolume1"), - // Properties: &armnetapp.SubvolumeProperties{ - // Path: to.Ptr("/pathToSubvol"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_Get.json -func ExampleSubvolumesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubvolumesClient().Get(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SubvolumeInfo = armnetapp.SubvolumeInfo{ - // Name: to.Ptr("account1/pool1/volume1/subvolume1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/subvolumes/subvolume1"), - // Properties: &armnetapp.SubvolumeProperties{ - // Path: to.Ptr("/pathToSubvol"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_Create.json -func ExampleSubvolumesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubvolumesClient().BeginCreate(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", armnetapp.SubvolumeInfo{ - Properties: &armnetapp.SubvolumeProperties{ - Path: to.Ptr("/subvolumePath"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SubvolumeInfo = armnetapp.SubvolumeInfo{ - // Name: to.Ptr("account1/pool1/volume1/subvolume1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/subvolumes/subvolume1"), - // Properties: &armnetapp.SubvolumeProperties{ - // Path: to.Ptr("/subvolumePath"), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_Update.json -func ExampleSubvolumesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubvolumesClient().BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", armnetapp.SubvolumePatchRequest{ - Properties: &armnetapp.SubvolumePatchParams{ - Path: to.Ptr("/subvolumePath"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SubvolumeInfo = armnetapp.SubvolumeInfo{ - // Name: to.Ptr("account1/pool1/volume1/subvolume1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolume1"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/subvolumes/subvolume1"), - // Properties: &armnetapp.SubvolumeProperties{ - // Path: to.Ptr("/subvolumePath"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_Delete.json -func ExampleSubvolumesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubvolumesClient().BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Subvolumes_Metadata.json -func ExampleSubvolumesClient_BeginGetMetadata() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubvolumesClient().BeginGetMetadata(ctx, "myRG", "account1", "pool1", "volume1", "subvolume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SubvolumeModel = armnetapp.SubvolumeModel{ - // Name: to.Ptr("account1/pool1/volume1/subvolume1/metadata"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/subvolumes/metadata"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/subvolumes/subvolume1/metadata"), - // Properties: &armnetapp.SubvolumeModelProperties{ - // Path: to.Ptr("/pathToSubvol"), - // AccessedTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // BytesUsed: to.Ptr[int64](5), - // ChangedTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // CreationTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // ModifiedTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33Z"); return t}()), - // Permissions: to.Ptr("777"), - // Size: to.Ptr[int64](5), - // }, - // } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/time_rfc3339.go b/sdk/resourcemanager/netapp/armnetapp/time_rfc3339.go index 232d6772fe39..22661db585ce 100644 --- a/sdk/resourcemanager/netapp/armnetapp/time_rfc3339.go +++ b/sdk/resourcemanager/netapp/armnetapp/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp diff --git a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go index 3d46a5b3e0c7..302aaa127193 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -47,7 +46,7 @@ func NewVolumeGroupsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreate - Create a volume group along with specified volumes // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - volumeGroupName - The name of the volumeGroup @@ -60,7 +59,8 @@ func (client *VolumeGroupsClient) BeginCreate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[VolumeGroupsClientCreateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[VolumeGroupsClientCreateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumeGroupsClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -69,20 +69,22 @@ func (client *VolumeGroupsClient) BeginCreate(ctx context.Context, resourceGroup // Create - Create a volume group along with specified volumes // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumeGroupsClient) create(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string, body VolumeGroupDetails, options *VolumeGroupsClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, volumeGroupName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -109,16 +111,19 @@ func (client *VolumeGroupsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete the specified volume group only if there are no volumes under volume group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - volumeGroupName - The name of the volumeGroup @@ -130,7 +135,8 @@ func (client *VolumeGroupsClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller[VolumeGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[VolumeGroupsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumeGroupsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -139,20 +145,22 @@ func (client *VolumeGroupsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete the specified volume group only if there are no volumes under volume group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumeGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string, options *VolumeGroupsClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, volumeGroupName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -179,7 +187,7 @@ func (client *VolumeGroupsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -187,24 +195,27 @@ func (client *VolumeGroupsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get details of the specified volume group // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - volumeGroupName - The name of the volumeGroup // - options - VolumeGroupsClientGetOptions contains the optional parameters for the VolumeGroupsClient.Get method. func (client *VolumeGroupsClient) Get(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string, options *VolumeGroupsClientGetOptions) (VolumeGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, volumeGroupName, options) if err != nil { return VolumeGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumeGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VolumeGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VolumeGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -231,7 +242,7 @@ func (client *VolumeGroupsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +259,7 @@ func (client *VolumeGroupsClient) getHandleResponse(resp *http.Response) (Volume // NewListByNetAppAccountPager - List all volume groups for given account // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - options - VolumeGroupsClientListByNetAppAccountOptions contains the optional parameters for the VolumeGroupsClient.NewListByNetAppAccountPager @@ -295,7 +306,7 @@ func (client *VolumeGroupsClient) listByNetAppAccountCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go deleted file mode 100644 index 304d7d1fbf3b..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go +++ /dev/null @@ -1,265 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeGroups_List.json -func ExampleVolumeGroupsClient_NewListByNetAppAccountPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVolumeGroupsClient().NewListByNetAppAccountPager("myRG", "account1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VolumeGroupList = armnetapp.VolumeGroupList{ - // Value: []*armnetapp.VolumeGroup{ - // { - // Name: to.Ptr("group1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/volumeGroups"), - // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/volumeGroups/group1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.VolumeGroupListProperties{ - // GroupMetaData: &armnetapp.VolumeGroupMetaData{ - // ApplicationIdentifier: to.Ptr("DEV"), - // ApplicationType: to.Ptr(armnetapp.ApplicationTypeSAPHANA), - // GroupDescription: to.Ptr("Volume group"), - // VolumesCount: to.Ptr[int64](5), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeGroups_Get.json -func ExampleVolumeGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVolumeGroupsClient().Get(ctx, "myRG", "account1", "group1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VolumeGroupDetails = armnetapp.VolumeGroupDetails{ - // Name: to.Ptr("group1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/volumeGroups"), - // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/volumeGroups/group1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.VolumeGroupProperties{ - // GroupMetaData: &armnetapp.VolumeGroupMetaData{ - // ApplicationIdentifier: to.Ptr("DEV"), - // ApplicationType: to.Ptr(armnetapp.ApplicationTypeSAPHANA), - // GroupDescription: to.Ptr("Volume group"), - // VolumesCount: to.Ptr[int64](5), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Volumes: []*armnetapp.VolumeGroupVolumeProperties{ - // { - // Name: to.Ptr("account1/pool1/test-data-mnt00001"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), - // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/test-data-mnt00001"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-data-mnt00001"), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - // ThroughputMibps: to.Ptr[float32](10), - // UsageThreshold: to.Ptr[int64](107374182400), - // VolumeSpecName: to.Ptr("data"), - // }, - // }, - // { - // Name: to.Ptr("account1/pool1/test-log-mnt00001"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), - // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/test-log-mnt00001"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-log-mnt00001"), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - // ThroughputMibps: to.Ptr[float32](10), - // UsageThreshold: to.Ptr[int64](107374182400), - // VolumeSpecName: to.Ptr("log"), - // }, - // }, - // { - // Name: to.Ptr("account1/pool1/test-shared"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), - // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/test-shared"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-shared"), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - // ThroughputMibps: to.Ptr[float32](10), - // UsageThreshold: to.Ptr[int64](107374182400), - // VolumeSpecName: to.Ptr("shared"), - // }, - // }, - // { - // Name: to.Ptr("account1/pool1/test-data-backup"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), - // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/test-data-backup"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-log-backup"), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - // ThroughputMibps: to.Ptr[float32](10), - // UsageThreshold: to.Ptr[int64](107374182400), - // VolumeSpecName: to.Ptr("data-backup"), - // }, - // }, - // { - // Name: to.Ptr("account1/pool1/test-log-backup"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), - // ID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/test-log-backup"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-data-backup"), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - // ThroughputMibps: to.Ptr[float32](10), - // UsageThreshold: to.Ptr[int64](107374182400), - // VolumeSpecName: to.Ptr("log-backup"), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeGroups_Create.json -func ExampleVolumeGroupsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumeGroupsClient().BeginCreate(ctx, "myRG", "account1", "group1", armnetapp.VolumeGroupDetails{ - Location: to.Ptr("westus"), - Properties: &armnetapp.VolumeGroupProperties{ - GroupMetaData: &armnetapp.VolumeGroupMetaData{ - ApplicationIdentifier: to.Ptr("DEV"), - ApplicationType: to.Ptr(armnetapp.ApplicationTypeSAPHANA), - DeploymentSpecID: to.Ptr("20542149-bfca-5618-1879-9863dc6767f1"), - GroupDescription: to.Ptr("Volume group"), - }, - Volumes: []*armnetapp.VolumeGroupVolumeProperties{ - { - Name: to.Ptr("test-data-mnt00001"), - Properties: &armnetapp.VolumeProperties{ - CapacityPoolResourceID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - CreationToken: to.Ptr("test-data-mnt00001"), - ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), - ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - ThroughputMibps: to.Ptr[float32](10), - UsageThreshold: to.Ptr[int64](107374182400), - VolumeSpecName: to.Ptr("data"), - }, - }, - { - Name: to.Ptr("test-log-mnt00001"), - Properties: &armnetapp.VolumeProperties{ - CapacityPoolResourceID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - CreationToken: to.Ptr("test-log-mnt00001"), - ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), - ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - ThroughputMibps: to.Ptr[float32](10), - UsageThreshold: to.Ptr[int64](107374182400), - VolumeSpecName: to.Ptr("log"), - }, - }, - { - Name: to.Ptr("test-shared"), - Properties: &armnetapp.VolumeProperties{ - CapacityPoolResourceID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - CreationToken: to.Ptr("test-shared"), - ProximityPlacementGroup: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/cys_sjain_fcp_rg/providers/Microsoft.Compute/proximityPlacementGroups/svlqa_sjain_multivolume_ppg"), - ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - SubnetID: to.Ptr("/subscriptions/d633cc2e-722b-4ae1-b636-bbd9e4c60ed9/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - ThroughputMibps: to.Ptr[float32](10), - UsageThreshold: to.Ptr[int64](107374182400), - VolumeSpecName: to.Ptr("shared"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeGroups_Delete.json -func ExampleVolumeGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumeGroupsClient().BeginDelete(ctx, "myRG", "account1", "group1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go index d65fc6207104..43a78ae8e705 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -47,7 +46,7 @@ func NewVolumeQuotaRulesClient(subscriptionID string, credential azcore.TokenCre // BeginCreate - Create the specified quota rule within the given volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -62,9 +61,10 @@ func (client *VolumeQuotaRulesClient) BeginCreate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumeQuotaRulesClientCreateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumeQuotaRulesClientCreateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumeQuotaRulesClientCreateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,20 +73,22 @@ func (client *VolumeQuotaRulesClient) BeginCreate(ctx context.Context, resourceG // Create - Create the specified quota rule within the given volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumeQuotaRulesClient) create(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, body VolumeQuotaRule, options *VolumeQuotaRulesClientBeginCreateOptions) (*http.Response, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createCreateRequest creates the Create request. @@ -121,16 +123,19 @@ func (client *VolumeQuotaRulesClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete quota rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -144,9 +149,10 @@ func (client *VolumeQuotaRulesClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumeQuotaRulesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumeQuotaRulesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumeQuotaRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -155,20 +161,22 @@ func (client *VolumeQuotaRulesClient) BeginDelete(ctx context.Context, resourceG // Delete - Delete quota rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumeQuotaRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, options *VolumeQuotaRulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -203,7 +211,7 @@ func (client *VolumeQuotaRulesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -211,7 +219,7 @@ func (client *VolumeQuotaRulesClient) deleteCreateRequest(ctx context.Context, r // Get - Get details of the specified quota rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -219,18 +227,21 @@ func (client *VolumeQuotaRulesClient) deleteCreateRequest(ctx context.Context, r // - volumeQuotaRuleName - The name of volume quota rule // - options - VolumeQuotaRulesClientGetOptions contains the optional parameters for the VolumeQuotaRulesClient.Get method. func (client *VolumeQuotaRulesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, options *VolumeQuotaRulesClientGetOptions) (VolumeQuotaRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, options) if err != nil { return VolumeQuotaRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumeQuotaRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VolumeQuotaRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VolumeQuotaRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -265,7 +276,7 @@ func (client *VolumeQuotaRulesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +293,7 @@ func (client *VolumeQuotaRulesClient) getHandleResponse(resp *http.Response) (Vo // NewListByVolumePager - List all quota rules associated with the volume // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -339,7 +350,7 @@ func (client *VolumeQuotaRulesClient) listByVolumeCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -357,7 +368,7 @@ func (client *VolumeQuotaRulesClient) listByVolumeHandleResponse(resp *http.Resp // BeginUpdate - Patch a quota rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -372,9 +383,10 @@ func (client *VolumeQuotaRulesClient) BeginUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumeQuotaRulesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumeQuotaRulesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumeQuotaRulesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -383,20 +395,22 @@ func (client *VolumeQuotaRulesClient) BeginUpdate(ctx context.Context, resourceG // Update - Patch a quota rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumeQuotaRulesClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, volumeQuotaRuleName string, body VolumeQuotaRulePatch, options *VolumeQuotaRulesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -431,8 +445,11 @@ func (client *VolumeQuotaRulesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go deleted file mode 100644 index c7288043f928..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client_example_test.go +++ /dev/null @@ -1,195 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeQuotaRules_List.json -func ExampleVolumeQuotaRulesClient_NewListByVolumePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVolumeQuotaRulesClient().NewListByVolumePager("myRG", "account-9957", "pool-5210", "volume-6387", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VolumeQuotaRulesList = armnetapp.VolumeQuotaRulesList{ - // Value: []*armnetapp.VolumeQuotaRule{ - // { - // Name: to.Ptr("account-9957/pool-5210/volume-6387/rule-0004"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/volumeQuotaRules"), - // ID: to.Ptr("/subscriptions/5275316f-a498-48d6-b324-2cbfdc4311b9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account-9957/capacityPools/pool-5210/volumes/volume-6387/volumeQuotaRules/rule-0004"), - // Location: to.Ptr("westus"), - // Properties: &armnetapp.VolumeQuotaRulesProperties{ - // ProvisioningState: to.Ptr(armnetapp.ProvisioningStateSucceeded), - // QuotaSizeInKiBs: to.Ptr[int64](100005), - // QuotaTarget: to.Ptr("1821"), - // QuotaType: to.Ptr(armnetapp.TypeIndividualUserQuota), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeQuotaRules_Get.json -func ExampleVolumeQuotaRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVolumeQuotaRulesClient().Get(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VolumeQuotaRule = armnetapp.VolumeQuotaRule{ - // Name: to.Ptr("account-9957/pool-5210/volume-6387/rule-0004"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/volumeQuotaRules"), - // ID: to.Ptr("/subscriptions/5275316f-a498-48d6-b324-2cbfdc4311b9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account-9957/capacityPools/pool-5210/volumes/volume-6387/volumeQuotaRules/rule-0004"), - // Location: to.Ptr("westus"), - // Properties: &armnetapp.VolumeQuotaRulesProperties{ - // ProvisioningState: to.Ptr(armnetapp.ProvisioningStateSucceeded), - // QuotaSizeInKiBs: to.Ptr[int64](100005), - // QuotaTarget: to.Ptr("1821"), - // QuotaType: to.Ptr(armnetapp.TypeIndividualUserQuota), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeQuotaRules_Create.json -func ExampleVolumeQuotaRulesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumeQuotaRulesClient().BeginCreate(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", armnetapp.VolumeQuotaRule{ - Location: to.Ptr("westus"), - Properties: &armnetapp.VolumeQuotaRulesProperties{ - QuotaSizeInKiBs: to.Ptr[int64](100005), - QuotaTarget: to.Ptr("1821"), - QuotaType: to.Ptr(armnetapp.TypeIndividualUserQuota), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VolumeQuotaRule = armnetapp.VolumeQuotaRule{ - // Name: to.Ptr("account-9957/pool-5210/volume-6387/rule-0004"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/volumeQuotaRules"), - // ID: to.Ptr("/subscriptions/5275316f-a498-48d6-b324-2cbfdc4311b9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account-9957/capacityPools/pool-5210/volumes/volume-6387/volumeQuotaRules/rule-0004"), - // Location: to.Ptr("westus"), - // Properties: &armnetapp.VolumeQuotaRulesProperties{ - // ProvisioningState: to.Ptr(armnetapp.ProvisioningStateSucceeded), - // QuotaSizeInKiBs: to.Ptr[int64](100005), - // QuotaTarget: to.Ptr("1821"), - // QuotaType: to.Ptr(armnetapp.TypeIndividualUserQuota), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeQuotaRules_Update.json -func ExampleVolumeQuotaRulesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumeQuotaRulesClient().BeginUpdate(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", armnetapp.VolumeQuotaRulePatch{ - Properties: &armnetapp.VolumeQuotaRulesProperties{ - QuotaSizeInKiBs: to.Ptr[int64](100009), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VolumeQuotaRule = armnetapp.VolumeQuotaRule{ - // Name: to.Ptr("account-9957/pool-5210/volume-6387/rule-0004"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes/volumeQuotaRules"), - // ID: to.Ptr("/subscriptions/5275316f-a498-48d6-b324-2cbfdc4311b9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account-9957/capacityPools/pool-5210/volumes/volume-6387/volumeQuotaRules/rule-0004"), - // Location: to.Ptr("westus"), - // Properties: &armnetapp.VolumeQuotaRulesProperties{ - // ProvisioningState: to.Ptr(armnetapp.ProvisioningStateSucceeded), - // QuotaSizeInKiBs: to.Ptr[int64](100005), - // QuotaTarget: to.Ptr("1821"), - // QuotaType: to.Ptr(armnetapp.TypeIndividualUserQuota), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/VolumeQuotaRules_Delete.json -func ExampleVolumeQuotaRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumeQuotaRulesClient().BeginDelete(ctx, "myRG", "account-9957", "pool-5210", "volume-6387", "rule-0004", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/volumes_client.go b/sdk/resourcemanager/netapp/armnetapp/volumes_client.go index 878c6de02766..cde35225dddb 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumes_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumes_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armnetapp @@ -48,7 +47,7 @@ func NewVolumesClient(subscriptionID string, credential azcore.TokenCredential, // BeginAuthorizeReplication - Authorize the replication connection on the source volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -62,9 +61,10 @@ func (client *VolumesClient) BeginAuthorizeReplication(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientAuthorizeReplicationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientAuthorizeReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientAuthorizeReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,20 +73,22 @@ func (client *VolumesClient) BeginAuthorizeReplication(ctx context.Context, reso // AuthorizeReplication - Authorize the replication connection on the source volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) authorizeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body AuthorizeRequest, options *VolumesClientBeginAuthorizeReplicationOptions) (*http.Response, error) { + var err error req, err := client.authorizeReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // authorizeReplicationCreateRequest creates the AuthorizeReplication request. @@ -117,15 +119,18 @@ func (client *VolumesClient) authorizeReplicationCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginBreakFileLocks - Break all the file locks on a volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -138,9 +143,10 @@ func (client *VolumesClient) BeginBreakFileLocks(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientBreakFileLocksResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientBreakFileLocksResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientBreakFileLocksResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -149,20 +155,22 @@ func (client *VolumesClient) BeginBreakFileLocks(ctx context.Context, resourceGr // BreakFileLocks - Break all the file locks on a volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) breakFileLocks(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginBreakFileLocksOptions) (*http.Response, error) { + var err error req, err := client.breakFileLocksCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // breakFileLocksCreateRequest creates the BreakFileLocks request. @@ -193,10 +201,13 @@ func (client *VolumesClient) breakFileLocksCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -204,7 +215,7 @@ func (client *VolumesClient) breakFileLocksCreateRequest(ctx context.Context, re // BeginBreakReplication - Break the replication connection on the destination volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -217,9 +228,10 @@ func (client *VolumesClient) BeginBreakReplication(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientBreakReplicationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientBreakReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientBreakReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -228,20 +240,22 @@ func (client *VolumesClient) BeginBreakReplication(ctx context.Context, resource // BreakReplication - Break the replication connection on the destination volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) breakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginBreakReplicationOptions) (*http.Response, error) { + var err error req, err := client.breakReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // breakReplicationCreateRequest creates the BreakReplication request. @@ -272,10 +286,13 @@ func (client *VolumesClient) breakReplicationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -283,7 +300,7 @@ func (client *VolumesClient) breakReplicationCreateRequest(ctx context.Context, // BeginCreateOrUpdate - Create or update the specified volume within the capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -297,9 +314,10 @@ func (client *VolumesClient) BeginCreateOrUpdate(ctx context.Context, resourceGr if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientCreateOrUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientCreateOrUpdateResponse]{ FinalStateVia: runtime.FinalStateViaAzureAsyncOp, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -308,20 +326,22 @@ func (client *VolumesClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Create or update the specified volume within the capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body Volume, options *VolumesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -352,16 +372,19 @@ func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginDelete - Delete the specified volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -373,9 +396,10 @@ func (client *VolumesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -384,20 +408,22 @@ func (client *VolumesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete the specified volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -431,7 +457,7 @@ func (client *VolumesClient) deleteCreateRequest(ctx context.Context, resourceGr if options != nil && options.ForceDelete != nil { reqQP.Set("forceDelete", strconv.FormatBool(*options.ForceDelete)) } - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -439,7 +465,7 @@ func (client *VolumesClient) deleteCreateRequest(ctx context.Context, resourceGr // BeginDeleteReplication - Delete the replication connection on the destination volume, and send release to the source replication // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -452,9 +478,10 @@ func (client *VolumesClient) BeginDeleteReplication(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientDeleteReplicationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientDeleteReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientDeleteReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -463,20 +490,22 @@ func (client *VolumesClient) BeginDeleteReplication(ctx context.Context, resourc // DeleteReplication - Delete the replication connection on the destination volume, and send release to the source replication // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) deleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginDeleteReplicationOptions) (*http.Response, error) { + var err error req, err := client.deleteReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteReplicationCreateRequest creates the DeleteReplication request. @@ -507,7 +536,7 @@ func (client *VolumesClient) deleteReplicationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -515,7 +544,7 @@ func (client *VolumesClient) deleteReplicationCreateRequest(ctx context.Context, // BeginFinalizeRelocation - Finalizes the relocation of the volume and cleans up the old volume. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -528,7 +557,8 @@ func (client *VolumesClient) BeginFinalizeRelocation(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller[VolumesClientFinalizeRelocationResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[VolumesClientFinalizeRelocationResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientFinalizeRelocationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -537,20 +567,22 @@ func (client *VolumesClient) BeginFinalizeRelocation(ctx context.Context, resour // FinalizeRelocation - Finalizes the relocation of the volume and cleans up the old volume. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) finalizeRelocation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginFinalizeRelocationOptions) (*http.Response, error) { + var err error req, err := client.finalizeRelocationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // finalizeRelocationCreateRequest creates the FinalizeRelocation request. @@ -581,7 +613,7 @@ func (client *VolumesClient) finalizeRelocationCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -589,25 +621,28 @@ func (client *VolumesClient) finalizeRelocationCreateRequest(ctx context.Context // Get - Get the details of the specified volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool // - volumeName - The name of the volume // - options - VolumesClientGetOptions contains the optional parameters for the VolumesClient.Get method. func (client *VolumesClient) Get(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientGetOptions) (VolumesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return VolumesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VolumesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VolumesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -638,7 +673,7 @@ func (client *VolumesClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -655,7 +690,7 @@ func (client *VolumesClient) getHandleResponse(resp *http.Response) (VolumesClie // NewListPager - List all volumes within the capacity pool // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -712,7 +747,7 @@ func (client *VolumesClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -730,7 +765,7 @@ func (client *VolumesClient) listHandleResponse(resp *http.Response) (VolumesCli // BeginListGetGroupIDListForLdapUser - Returns the list of group Ids for a specific LDAP User // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -744,9 +779,10 @@ func (client *VolumesClient) BeginListGetGroupIDListForLdapUser(ctx context.Cont if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientListGetGroupIDListForLdapUserResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientListGetGroupIDListForLdapUserResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientListGetGroupIDListForLdapUserResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -755,20 +791,22 @@ func (client *VolumesClient) BeginListGetGroupIDListForLdapUser(ctx context.Cont // ListGetGroupIDListForLdapUser - Returns the list of group Ids for a specific LDAP User // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) listGetGroupIDListForLdapUser(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body GetGroupIDListForLDAPUserRequest, options *VolumesClientBeginListGetGroupIDListForLdapUserOptions) (*http.Response, error) { + var err error req, err := client.listGetGroupIDListForLdapUserCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // listGetGroupIDListForLdapUserCreateRequest creates the ListGetGroupIDListForLdapUser request. @@ -799,15 +837,18 @@ func (client *VolumesClient) listGetGroupIDListForLdapUserCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // NewListReplicationsPager - List all replications for a specified volume // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -864,7 +905,7 @@ func (client *VolumesClient) listReplicationsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -882,7 +923,7 @@ func (client *VolumesClient) listReplicationsHandleResponse(resp *http.Response) // BeginPoolChange - Moves volume to another pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -895,9 +936,10 @@ func (client *VolumesClient) BeginPoolChange(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientPoolChangeResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientPoolChangeResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientPoolChangeResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -906,20 +948,22 @@ func (client *VolumesClient) BeginPoolChange(ctx context.Context, resourceGroupN // PoolChange - Moves volume to another pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) poolChange(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body PoolChangeRequest, options *VolumesClientBeginPoolChangeOptions) (*http.Response, error) { + var err error req, err := client.poolChangeCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // poolChangeCreateRequest creates the PoolChange request. @@ -950,15 +994,89 @@ func (client *VolumesClient) poolChangeCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil +} + +// PopulateAvailabilityZone - This operation will populate availability zone information for a volume +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - accountName - The name of the NetApp account +// - poolName - The name of the capacity pool +// - volumeName - The name of the volume +// - options - VolumesClientPopulateAvailabilityZoneOptions contains the optional parameters for the VolumesClient.PopulateAvailabilityZone +// method. +func (client *VolumesClient) PopulateAvailabilityZone(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientPopulateAvailabilityZoneOptions) (VolumesClientPopulateAvailabilityZoneResponse, error) { + var err error + req, err := client.populateAvailabilityZoneCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) + if err != nil { + return VolumesClientPopulateAvailabilityZoneResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return VolumesClientPopulateAvailabilityZoneResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return VolumesClientPopulateAvailabilityZoneResponse{}, err + } + resp, err := client.populateAvailabilityZoneHandleResponse(httpResp) + return resp, err +} + +// populateAvailabilityZoneCreateRequest creates the PopulateAvailabilityZone request. +func (client *VolumesClient) populateAvailabilityZoneCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientPopulateAvailabilityZoneOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/populateAvailabilityZone" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if poolName == "" { + return nil, errors.New("parameter poolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{poolName}", url.PathEscape(poolName)) + if volumeName == "" { + return nil, errors.New("parameter volumeName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{volumeName}", url.PathEscape(volumeName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// populateAvailabilityZoneHandleResponse handles the PopulateAvailabilityZone response. +func (client *VolumesClient) populateAvailabilityZoneHandleResponse(resp *http.Response) (VolumesClientPopulateAvailabilityZoneResponse, error) { + result := VolumesClientPopulateAvailabilityZoneResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Volume); err != nil { + return VolumesClientPopulateAvailabilityZoneResponse{}, err + } + return result, nil } // BeginReInitializeReplication - Re-Initializes the replication connection on the destination volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -971,9 +1089,10 @@ func (client *VolumesClient) BeginReInitializeReplication(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientReInitializeReplicationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientReInitializeReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientReInitializeReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -982,20 +1101,22 @@ func (client *VolumesClient) BeginReInitializeReplication(ctx context.Context, r // ReInitializeReplication - Re-Initializes the replication connection on the destination volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) reInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginReInitializeReplicationOptions) (*http.Response, error) { + var err error req, err := client.reInitializeReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // reInitializeReplicationCreateRequest creates the ReInitializeReplication request. @@ -1026,7 +1147,7 @@ func (client *VolumesClient) reInitializeReplicationCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -1035,7 +1156,7 @@ func (client *VolumesClient) reInitializeReplicationCreateRequest(ctx context.Co // or policy-based snapshots // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -1049,9 +1170,10 @@ func (client *VolumesClient) BeginReestablishReplication(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientReestablishReplicationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientReestablishReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientReestablishReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1061,20 +1183,22 @@ func (client *VolumesClient) BeginReestablishReplication(ctx context.Context, re // snapshots // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) reestablishReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body ReestablishReplicationRequest, options *VolumesClientBeginReestablishReplicationOptions) (*http.Response, error) { + var err error req, err := client.reestablishReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // reestablishReplicationCreateRequest creates the ReestablishReplication request. @@ -1105,15 +1229,18 @@ func (client *VolumesClient) reestablishReplicationCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginRelocate - Relocates volume to a new stamp // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -1125,7 +1252,8 @@ func (client *VolumesClient) BeginRelocate(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller[VolumesClientRelocateResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[VolumesClientRelocateResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientRelocateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1134,20 +1262,22 @@ func (client *VolumesClient) BeginRelocate(ctx context.Context, resourceGroupNam // Relocate - Relocates volume to a new stamp // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) relocate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginRelocateOptions) (*http.Response, error) { + var err error req, err := client.relocateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // relocateCreateRequest creates the Relocate request. @@ -1178,10 +1308,13 @@ func (client *VolumesClient) relocateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -1189,7 +1322,7 @@ func (client *VolumesClient) relocateCreateRequest(ctx context.Context, resource // ReplicationStatus - Get the status of the replication // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -1197,18 +1330,21 @@ func (client *VolumesClient) relocateCreateRequest(ctx context.Context, resource // - options - VolumesClientReplicationStatusOptions contains the optional parameters for the VolumesClient.ReplicationStatus // method. func (client *VolumesClient) ReplicationStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientReplicationStatusOptions) (VolumesClientReplicationStatusResponse, error) { + var err error req, err := client.replicationStatusCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return VolumesClientReplicationStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return VolumesClientReplicationStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VolumesClientReplicationStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return VolumesClientReplicationStatusResponse{}, err } - return client.replicationStatusHandleResponse(resp) + resp, err := client.replicationStatusHandleResponse(httpResp) + return resp, err } // replicationStatusCreateRequest creates the ReplicationStatus request. @@ -1239,7 +1375,7 @@ func (client *VolumesClient) replicationStatusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1257,7 +1393,7 @@ func (client *VolumesClient) replicationStatusHandleResponse(resp *http.Response // BeginResetCifsPassword - Reset cifs password from volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -1270,7 +1406,8 @@ func (client *VolumesClient) BeginResetCifsPassword(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller[VolumesClientResetCifsPasswordResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[VolumesClientResetCifsPasswordResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientResetCifsPasswordResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1279,20 +1416,22 @@ func (client *VolumesClient) BeginResetCifsPassword(ctx context.Context, resourc // ResetCifsPassword - Reset cifs password from volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) resetCifsPassword(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginResetCifsPasswordOptions) (*http.Response, error) { + var err error req, err := client.resetCifsPasswordCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resetCifsPasswordCreateRequest creates the ResetCifsPassword request. @@ -1323,7 +1462,7 @@ func (client *VolumesClient) resetCifsPasswordCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -1332,7 +1471,7 @@ func (client *VolumesClient) resetCifsPasswordCreateRequest(ctx context.Context, // it will reverse-resync the connection and sync from destination to source. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -1345,9 +1484,10 @@ func (client *VolumesClient) BeginResyncReplication(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientResyncReplicationResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientResyncReplicationResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientResyncReplicationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1357,20 +1497,22 @@ func (client *VolumesClient) BeginResyncReplication(ctx context.Context, resourc // reverse-resync the connection and sync from destination to source. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) resyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginResyncReplicationOptions) (*http.Response, error) { + var err error req, err := client.resyncReplicationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // resyncReplicationCreateRequest creates the ResyncReplication request. @@ -1401,7 +1543,7 @@ func (client *VolumesClient) resyncReplicationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -1409,7 +1551,7 @@ func (client *VolumesClient) resyncReplicationCreateRequest(ctx context.Context, // BeginRevert - Revert a volume to the snapshot specified in the body // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -1422,9 +1564,10 @@ func (client *VolumesClient) BeginRevert(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientRevertResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientRevertResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientRevertResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1433,20 +1576,22 @@ func (client *VolumesClient) BeginRevert(ctx context.Context, resourceGroupName // Revert - Revert a volume to the snapshot specified in the body // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) revert(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumeRevert, options *VolumesClientBeginRevertOptions) (*http.Response, error) { + var err error req, err := client.revertCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // revertCreateRequest creates the Revert request. @@ -1477,16 +1622,19 @@ func (client *VolumesClient) revertCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // BeginRevertRelocation - Reverts the volume relocation process, cleans up the new volume and starts using the former-existing // volume. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -1499,7 +1647,8 @@ func (client *VolumesClient) BeginRevertRelocation(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[VolumesClientRevertRelocationResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[VolumesClientRevertRelocationResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientRevertRelocationResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1509,20 +1658,22 @@ func (client *VolumesClient) BeginRevertRelocation(ctx context.Context, resource // volume. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) revertRelocation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginRevertRelocationOptions) (*http.Response, error) { + var err error req, err := client.revertRelocationCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // revertRelocationCreateRequest creates the RevertRelocation request. @@ -1553,7 +1704,7 @@ func (client *VolumesClient) revertRelocationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -1561,7 +1712,7 @@ func (client *VolumesClient) revertRelocationCreateRequest(ctx context.Context, // BeginUpdate - Patch the specified volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the NetApp account // - poolName - The name of the capacity pool @@ -1574,9 +1725,10 @@ func (client *VolumesClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientUpdateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientUpdateResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[VolumesClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -1585,20 +1737,22 @@ func (client *VolumesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Patch the specified volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01 +// Generated from API version 2023-05-01 func (client *VolumesClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body VolumePatch, options *VolumesClientBeginUpdateOptions) (*http.Response, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // updateCreateRequest creates the Update request. @@ -1629,8 +1783,11 @@ func (client *VolumesClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01") + reqQP.Set("api-version", "2023-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go deleted file mode 100644 index e69e9d1f3002..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go +++ /dev/null @@ -1,598 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armnetapp_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_List.json -func ExampleVolumesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVolumesClient().NewListPager("myRG", "account1", "pool1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VolumeList = armnetapp.VolumeList{ - // Value: []*armnetapp.Volume{ - // { - // Name: to.Ptr("account1/pool1/volume1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("some-amazing-filepath"), - // FileSystemID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), - // NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard), - // NetworkSiblingSetID: to.Ptr("0f434a03-ce0b-4935-81af-d98652ffb1c4"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // StorageToNetworkProximity: to.Ptr(armnetapp.VolumeStorageToNetworkProximityT2), - // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - // ThroughputMibps: to.Ptr[float32](128), - // UsageThreshold: to.Ptr[int64](107374182400), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_Get.json -func ExampleVolumesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVolumesClient().Get(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Volume = armnetapp.Volume{ - // Name: to.Ptr("account1/pool1/volume1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("some-amazing-filepath"), - // FileSystemID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), - // NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard), - // NetworkSiblingSetID: to.Ptr("0f434a03-ce0b-4935-81af-d98652ffb1c4"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // StorageToNetworkProximity: to.Ptr(armnetapp.VolumeStorageToNetworkProximityT2), - // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - // ThroughputMibps: to.Ptr[float32](128), - // UsageThreshold: to.Ptr[int64](107374182400), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_CreateOrUpdate.json -func ExampleVolumesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginCreateOrUpdate(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.Volume{ - Location: to.Ptr("eastus"), - Properties: &armnetapp.VolumeProperties{ - CreationToken: to.Ptr("my-unique-file-path"), - ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - UsageThreshold: to.Ptr[int64](107374182400), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Volume = armnetapp.Volume{ - // Name: to.Ptr("account1/pool1/volume1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("some-amazing-filepath"), - // EncryptionKeySource: to.Ptr(armnetapp.EncryptionKeySourceMicrosoftNetApp), - // FileSystemID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - // ThroughputMibps: to.Ptr[float32](128), - // UsageThreshold: to.Ptr[int64](107374182400), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_Update.json -func ExampleVolumesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginUpdate(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.VolumePatch{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Volume = armnetapp.Volume{ - // Name: to.Ptr("account1/pool1/volume1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/capacityPools/volumes"), - // ID: to.Ptr("/subscriptions/subscriptionId/resourceGroups/resourceGroup/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("some-amazing-filepath"), - // DataProtection: &armnetapp.VolumePropertiesDataProtection{ - // Snapshot: &armnetapp.VolumeSnapshotProperties{ - // SnapshotPolicyID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRP/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotPolicy1"), - // }, - // }, - // FileSystemID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca7778"), - // NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard), - // NetworkSiblingSetID: to.Ptr("0f434a03-ce0b-4935-81af-d98652ffb1c4"), - // ProvisioningState: to.Ptr("Succeeded"), - // ServiceLevel: to.Ptr(armnetapp.ServiceLevelPremium), - // StorageToNetworkProximity: to.Ptr(armnetapp.VolumeStorageToNetworkProximityT2), - // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testvnet3/subnets/testsubnet3"), - // ThroughputMibps: to.Ptr[float32](128), - // UsageThreshold: to.Ptr[int64](107374182400), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_Delete.json -func ExampleVolumesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginDelete(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginDeleteOptions{ForceDelete: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_Revert.json -func ExampleVolumesClient_BeginRevert() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginRevert(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.VolumeRevert{ - SnapshotID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ResetCifsPassword.json -func ExampleVolumesClient_BeginResetCifsPassword() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginResetCifsPassword(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_BreakFileLocks.json -func ExampleVolumesClient_BeginBreakFileLocks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginBreakFileLocks(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginBreakFileLocksOptions{Body: &armnetapp.BreakFileLocksRequest{ - ClientIP: to.Ptr("101.102.103.104"), - ConfirmRunningDisruptiveOperation: to.Ptr(true), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/GroupIdListForLDAPUser.json -func ExampleVolumesClient_BeginListGetGroupIDListForLdapUser() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginListGetGroupIDListForLdapUser(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.GetGroupIDListForLDAPUserRequest{ - Username: to.Ptr("user1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GetGroupIDListForLDAPUserResponse = armnetapp.GetGroupIDListForLDAPUserResponse{ - // GroupIDsForLdapUser: []*string{ - // to.Ptr("123"), - // to.Ptr("224")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_BreakReplication.json -func ExampleVolumesClient_BeginBreakReplication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginBreakReplication(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginBreakReplicationOptions{Body: &armnetapp.BreakReplicationRequest{ - ForceBreakReplication: to.Ptr(false), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ReestablishReplication.json -func ExampleVolumesClient_BeginReestablishReplication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginReestablishReplication(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.ReestablishReplicationRequest{ - SourceVolumeID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/mySourceRG/providers/Microsoft.NetApp/netAppAccounts/sourceAccount1/capacityPools/sourcePool1/volumes/sourceVolume1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ReplicationStatus.json -func ExampleVolumesClient_ReplicationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVolumesClient().ReplicationStatus(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ReplicationStatus = armnetapp.ReplicationStatus{ - // ErrorMessage: to.Ptr(""), - // Healthy: to.Ptr(true), - // MirrorState: to.Ptr(armnetapp.MirrorStateMirrored), - // RelationshipStatus: to.Ptr(armnetapp.RelationshipStatusIdle), - // TotalProgress: to.Ptr("1048576"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ListReplications.json -func ExampleVolumesClient_NewListReplicationsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVolumesClient().NewListReplicationsPager("myRG", "account1", "pool1", "volume1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListReplications = armnetapp.ListReplications{ - // Value: []*armnetapp.Replication{ - // { - // RemoteVolumeRegion: to.Ptr("westus"), - // RemoteVolumeResourceID: to.Ptr("/subscriptions/36e85c76-e720-473e-881f-e2fe72f462d0/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account-5999/capacityPools/pool-0977/volumes/volume-4508"), - // ReplicationSchedule: to.Ptr(armnetapp.ReplicationScheduleDaily), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ResyncReplication.json -func ExampleVolumesClient_BeginResyncReplication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginResyncReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_DeleteReplication.json -func ExampleVolumesClient_BeginDeleteReplication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginDeleteReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_AuthorizeReplication.json -func ExampleVolumesClient_BeginAuthorizeReplication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginAuthorizeReplication(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.AuthorizeRequest{ - RemoteVolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRemoteRG/providers/Microsoft.NetApp/netAppAccounts/remoteAccount1/capacityPools/remotePool1/volumes/remoteVolume1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_ReInitializeReplication.json -func ExampleVolumesClient_BeginReInitializeReplication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginReInitializeReplication(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_PoolChange.json -func ExampleVolumesClient_BeginPoolChange() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginPoolChange(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.PoolChangeRequest{ - NewPoolResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_Relocate.json -func ExampleVolumesClient_BeginRelocate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginRelocate(ctx, "myRG", "account1", "pool1", "volume1", &armnetapp.VolumesClientBeginRelocateOptions{Body: &armnetapp.RelocateVolumeRequest{}}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_FinalizeRelocation.json -func ExampleVolumesClient_BeginFinalizeRelocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginFinalizeRelocation(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/310a0100f5b020c1900c527a6aa70d21992f078a/specification/netapp/resource-manager/Microsoft.NetApp/stable/2022-11-01/examples/Volumes_RevertRelocation.json -func ExampleVolumesClient_BeginRevertRelocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armnetapp.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVolumesClient().BeginRevertRelocation(ctx, "myRG", "account1", "pool1", "volume1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -}