From a930eb9032d834eab04e769d05918b9d09b7c38f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 21 Dec 2023 06:09:02 +0000 Subject: [PATCH] CodeGen from PR 26989 in Azure/azure-rest-api-specs Merge 5544c89b2525b2b5dce813e7e023143a8fe7128e into a689fc39dffc6d791526631e48949d5f8aebe8c2 --- .../netapp/armnetapp/CHANGELOG.md | 10 + .../netapp/armnetapp/README.md | 6 +- .../netapp/armnetapp/accountbackups_client.go | 264 --- .../accountbackups_client_example_test.go | 113 -- .../netapp/armnetapp/accounts_client.go | 125 +- .../armnetapp/accounts_client_example_test.go | 302 ---- .../netapp/armnetapp/autorest.md | 7 +- .../netapp/armnetapp/backuppolicies_client.go | 27 +- .../backuppolicies_client_example_test.go | 217 --- .../netapp/armnetapp/backups_client.go | 490 +----- .../armnetapp/backups_client_example_test.go | 255 --- .../armnetapp/backupsunderaccount_client.go | 125 -- ...backupsunderaccount_client_example_test.go | 42 - .../backupsunderbackupvault_client.go | 135 -- ...upsunderbackupvault_client_example_test.go | 45 - .../armnetapp/backupsundervolume_client.go | 135 -- .../backupsundervolume_client_example_test.go | 42 - .../netapp/armnetapp/backupvaults_client.go | 432 ----- .../backupvaults_client_example_test.go | 187 -- .../netapp/armnetapp/client_factory.go | 36 - .../netapp/armnetapp/constants.go | 24 +- .../armnetapp/fake/accountbackups_server.go | 220 --- .../netapp/armnetapp/fake/accounts_server.go | 63 - .../netapp/armnetapp/fake/backups_server.go | 354 +--- .../fake/backupsunderaccount_server.go | 119 -- .../fake/backupsunderbackupvault_server.go | 127 -- .../fake/backupsundervolume_server.go | 127 -- .../armnetapp/fake/backupvaults_server.go | 332 ---- .../netapp/armnetapp/fake/internal.go | 8 - .../fake/resourceregioninfos_server.go | 144 -- .../netapp/armnetapp/fake/server_factory.go | 96 +- .../netapp/armnetapp/fake/volumes_server.go | 60 - sdk/resourcemanager/netapp/armnetapp/go.mod | 12 +- sdk/resourcemanager/netapp/armnetapp/go.sum | 19 - .../netapp/armnetapp/models.go | 259 +-- .../netapp/armnetapp/models_serde.go | 655 ------- .../netapp/armnetapp/operations_client.go | 4 +- .../operations_client_example_test.go | 1562 ----------------- .../netapp/armnetapp/options.go | 130 -- .../netapp/armnetapp/pools_client.go | 27 +- .../armnetapp/pools_client_example_test.go | 201 --- .../netapp/armnetapp/resource_client.go | 26 +- .../armnetapp/resource_client_example_test.go | 229 --- .../armnetapp/resourcequotalimits_client.go | 8 +- ...resourcequotalimits_client_example_test.go | 147 -- .../armnetapp/resourceregioninfos_client.go | 163 -- ...resourceregioninfos_client_example_test.go | 108 -- .../netapp/armnetapp/response_types.go | 118 -- .../armnetapp/snapshotpolicies_client.go | 29 +- .../snapshotpolicies_client_example_test.go | 346 ---- .../netapp/armnetapp/snapshots_client.go | 34 +- .../snapshots_client_example_test.go | 193 -- .../netapp/armnetapp/subvolumes_client.go | 33 +- .../subvolumes_client_example_test.go | 216 --- .../netapp/armnetapp/volumegroups_client.go | 21 +- .../volumegroups_client_example_test.go | 1474 ---------------- .../armnetapp/volumequotarules_client.go | 27 +- .../volumequotarules_client_example_test.go | 195 -- .../netapp/armnetapp/volumes_client.go | 223 +-- .../armnetapp/volumes_client_example_test.go | 682 ------- 60 files changed, 274 insertions(+), 11536 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/backupsunderaccount_client.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/backupsunderaccount_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/backupsunderbackupvault_client.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/backupsunderbackupvault_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/backupsundervolume_client.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/backupsundervolume_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/backupvaults_client.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/backupvaults_client_example_test.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/fake/accountbackups_server.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/fake/backupsunderaccount_server.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/fake/backupsunderbackupvault_server.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/fake/backupsundervolume_server.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/fake/backupvaults_server.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/fake/resourceregioninfos_server.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.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/resourceregioninfos_client.go delete mode 100644 sdk/resourcemanager/netapp/armnetapp/resourceregioninfos_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 b049dac57dde..50449fcfa6a1 100644 --- a/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md +++ b/sdk/resourcemanager/netapp/armnetapp/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 6.0.0 (2023-12-21) +### Breaking Changes + +- Field `DeploymentSpecID` of struct `VolumeGroupMetaData` has been removed + +### Features Added + +- New value `RelationshipStatusFailed`, `RelationshipStatusUnknown` added to enum type `RelationshipStatus` + + ## 6.0.0-beta.1 (2023-12-22) ### Breaking Changes diff --git a/sdk/resourcemanager/netapp/armnetapp/README.md b/sdk/resourcemanager/netapp/armnetapp/README.md index 12e8247cdde1..419b260276dd 100644 --- a/sdk/resourcemanager/netapp/armnetapp/README.md +++ b/sdk/resourcemanager/netapp/armnetapp/README.md @@ -1,6 +1,6 @@ # Azure NetApp Files Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v5)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v5) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6) The `armnetapp` module provides operations for working with Azure NetApp Files. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure NetApp Files module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v5 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6 ``` ## Authorization @@ -57,7 +57,7 @@ clientFactory, err := armnetapp.NewClientFactory(, cred, &optio A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewBackupsClient() +client := clientFactory.NewAccountsClient() ``` ## Fakes diff --git a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go b/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go deleted file mode 100644 index d31101b0f5fb..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/accountbackups_client.go +++ /dev/null @@ -1,264 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -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. The value must be an UUID. -// - 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, 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 2023-05-01-preview -// - 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 - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountBackupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountBackupsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete the specified Backup for a Netapp Account -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *AccountBackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *AccountBackupsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "AccountBackupsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, backupName, 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.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, 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", "2023-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - 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 2023-05-01-preview -// - 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) { - var err error - const operationName = "AccountBackupsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, backupName, options) - if err != nil { - return AccountBackupsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AccountBackupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AccountBackupsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// 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", "2023-05-01-preview") - 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 -} - -// NewListByNetAppAccountPager - List all Backups for a Netapp Account -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - options - AccountBackupsClientListByNetAppAccountOptions contains the optional parameters for the AccountBackupsClient.NewListByNetAppAccountPager -// method. -func (client *AccountBackupsClient) NewListByNetAppAccountPager(resourceGroupName string, accountName string, options *AccountBackupsClientListByNetAppAccountOptions) *runtime.Pager[AccountBackupsClientListByNetAppAccountResponse] { - return runtime.NewPager(runtime.PagingHandler[AccountBackupsClientListByNetAppAccountResponse]{ - More: func(page AccountBackupsClientListByNetAppAccountResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *AccountBackupsClientListByNetAppAccountResponse) (AccountBackupsClientListByNetAppAccountResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AccountBackupsClient.NewListByNetAppAccountPager") - req, err := client.listByNetAppAccountCreateRequest(ctx, resourceGroupName, accountName, options) - if err != nil { - return AccountBackupsClientListByNetAppAccountResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AccountBackupsClientListByNetAppAccountResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AccountBackupsClientListByNetAppAccountResponse{}, runtime.NewResponseError(resp) - } - return client.listByNetAppAccountHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByNetAppAccountCreateRequest creates the ListByNetAppAccount request. -func (client *AccountBackupsClient) listByNetAppAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountBackupsClientListByNetAppAccountOptions) (*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", "2023-05-01-preview") - if options != nil && options.IncludeOnlyBackupsFromDeletedVolumes != nil { - reqQP.Set("includeOnlyBackupsFromDeletedVolumes", *options.IncludeOnlyBackupsFromDeletedVolumes) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByNetAppAccountHandleResponse handles the ListByNetAppAccount response. -func (client *AccountBackupsClient) listByNetAppAccountHandleResponse(resp *http.Response) (AccountBackupsClientListByNetAppAccountResponse, error) { - result := AccountBackupsClientListByNetAppAccountResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BackupsList); err != nil { - return AccountBackupsClientListByNetAppAccountResponse{}, 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 b3b8bd190e63..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Backups_Account_List.json -func ExampleAccountBackupsClient_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.NewAccountBackupsClient().NewListByNetAppAccountPager("myRG", "account1", &armnetapp.AccountBackupsClientListByNetAppAccountOptions{IncludeOnlyBackupsFromDeletedVolumes: 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"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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 af030472c681..758c0e983707 100644 --- a/sdk/resourcemanager/netapp/armnetapp/accounts_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/accounts_client.go @@ -46,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 2023-05-01-preview +// Generated from API version 2023-07-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. @@ -73,7 +73,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *AccountsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, body Account, options *AccountsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *AccountsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -127,7 +127,7 @@ func (client *AccountsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete the specified NetApp account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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. @@ -152,7 +152,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *AccountsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginDelete" @@ -194,15 +194,16 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get the NetApp account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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. @@ -248,7 +249,7 @@ func (client *AccountsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +266,7 @@ func (client *AccountsClient) getHandleResponse(resp *http.Response) (AccountsCl // NewListPager - List and describe all NetApp accounts in the resource group. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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] { @@ -307,7 +308,7 @@ func (client *AccountsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +325,7 @@ func (client *AccountsClient) listHandleResponse(resp *http.Response) (AccountsC // NewListBySubscriptionPager - List and describe all NetApp accounts in the subscription. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-01 // - options - AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.NewListBySubscriptionPager // method. func (client *AccountsClient) NewListBySubscriptionPager(options *AccountsClientListBySubscriptionOptions) *runtime.Pager[AccountsClientListBySubscriptionResponse] { @@ -362,7 +363,7 @@ func (client *AccountsClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -377,99 +378,12 @@ func (client *AccountsClient) listBySubscriptionHandleResponse(resp *http.Respon return result, nil } -// BeginMigrateEncryptionKey - Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key -// or Azure Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from -// another account. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - options - AccountsClientBeginMigrateEncryptionKeyOptions contains the optional parameters for the AccountsClient.BeginMigrateEncryptionKey -// method. -func (client *AccountsClient) BeginMigrateEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginMigrateEncryptionKeyOptions) (*runtime.Poller[AccountsClientMigrateEncryptionKeyResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.migrateEncryptionKey(ctx, resourceGroupName, accountName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AccountsClientMigrateEncryptionKeyResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AccountsClientMigrateEncryptionKeyResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// MigrateEncryptionKey - Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure -// Key Vault). Operation fails if targeted volumes share encryption sibling set with volumes from -// another account. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *AccountsClient) migrateEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginMigrateEncryptionKeyOptions) (*http.Response, error) { - var err error - const operationName = "AccountsClient.BeginMigrateEncryptionKey" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.migrateEncryptionKeyCreateRequest(ctx, resourceGroupName, accountName, 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.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// migrateEncryptionKeyCreateRequest creates the MigrateEncryptionKey request. -func (client *AccountsClient) migrateEncryptionKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginMigrateEncryptionKeyOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/migrateEncryption" - 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.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-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.Body != nil { - if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { - return nil, err - } - return req, nil - } - return req, nil -} - // BeginRenewCredentials - Renew identity credentials that are used to authenticate to key vault, for customer-managed key // encryption. If encryption.identity.principalId does not match identity.principalId, running this // operation will fix it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -497,7 +411,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *AccountsClient) renewCredentials(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginRenewCredentialsOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginRenewCredentials" @@ -539,15 +453,16 @@ func (client *AccountsClient) renewCredentialsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginUpdate - Patch the specified NetApp account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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. @@ -573,7 +488,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *AccountsClient) update(ctx context.Context, resourceGroupName string, accountName string, body AccountPatch, options *AccountsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginUpdate" @@ -615,7 +530,7 @@ func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 a62f7ff04f92..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/accounts_client_example_test.go +++ /dev/null @@ -1,302 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Accounts_MigrateEncryptionKey.json -func ExampleAccountsClient_BeginMigrateEncryptionKey() { - 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().BeginMigrateEncryptionKey(ctx, "myRG", "account1", &armnetapp.AccountsClientBeginMigrateEncryptionKeyOptions{Body: &armnetapp.EncryptionMigrationRequest{ - PrivateEndpointID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/privateEndpoints/privip1"), - VirtualNetworkID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/vnet1"), - }, - }) - 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 a8c8b335f2d0..9bd01efa5997 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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/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: 6.0.0-beta.1 -tag: package-preview-2023-05 +module-version: 6.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 f56891a7fb9e..d2c081013cac 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/backuppolicies_client.go @@ -46,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 2023-05-01-preview +// Generated from API version 2023-07-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. @@ -74,7 +74,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *BackupPoliciesClient) create(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicy, options *BackupPoliciesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "BackupPoliciesClient.BeginCreate" @@ -120,7 +120,7 @@ func (client *BackupPoliciesClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -132,7 +132,7 @@ func (client *BackupPoliciesClient) createCreateRequest(ctx context.Context, res // BeginDelete - Delete backup policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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. @@ -159,7 +159,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *BackupPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, options *BackupPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "BackupPoliciesClient.BeginDelete" @@ -205,15 +205,16 @@ func (client *BackupPoliciesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get a particular backup Policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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. @@ -264,7 +265,7 @@ func (client *BackupPoliciesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +282,7 @@ func (client *BackupPoliciesClient) getHandleResponse(resp *http.Response) (Back // NewListPager - List backup policies for Netapp Account // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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. @@ -329,7 +330,7 @@ func (client *BackupPoliciesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,7 +348,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 2023-05-01-preview +// Generated from API version 2023-07-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. @@ -375,7 +376,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *BackupPoliciesClient) update(ctx context.Context, resourceGroupName string, accountName string, backupPolicyName string, body BackupPolicyPatch, options *BackupPoliciesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "BackupPoliciesClient.BeginUpdate" @@ -421,7 +422,7 @@ func (client *BackupPoliciesClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 9808a03c5e70..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/backupPolicies/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/backupPolicies/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/backupPolicies/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/backupPolicies/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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 1d623382eec3..8f22be0f04ad 100644 --- a/sdk/resourcemanager/netapp/armnetapp/backups_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/backups_client.go @@ -43,334 +43,10 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } -// BeginCreate - Create a backup under the Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupVaultName - The name of the Backup Vault -// - 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, backupVaultName string, backupName string, body Backup, options *BackupsClientBeginCreateOptions) (*runtime.Poller[BackupsClientCreateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, accountName, backupVaultName, backupName, body, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientCreateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsClientCreateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Create - Create a backup under the Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *BackupsClient) create(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, body Backup, options *BackupsClientBeginCreateOptions) (*http.Response, error) { - var err error - const operationName = "BackupsClient.BeginCreate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, backupVaultName, backupName, 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.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createCreateRequest creates the Create request. -func (client *BackupsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, body Backup, options *BackupsClientBeginCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/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 backupVaultName == "" { - return nil, errors.New("parameter backupVaultName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupVaultName}", url.PathEscape(backupVaultName)) - 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", "2023-05-01-preview") - 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 -} - -// BeginDelete - Delete a Backup under the Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupVaultName - The name of the Backup Vault -// - 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, backupVaultName string, backupName string, options *BackupsClientBeginDeleteOptions) (*runtime.Poller[BackupsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, backupVaultName, backupName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a Backup under the Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *BackupsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, options *BackupsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "BackupsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, backupVaultName, backupName, 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.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *BackupsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, options *BackupsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/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 backupVaultName == "" { - return nil, errors.New("parameter backupVaultName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupVaultName}", url.PathEscape(backupVaultName)) - 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", "2023-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get the specified Backup under Backup Vault. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupVaultName - The name of the Backup Vault -// - 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, backupVaultName string, backupName string, options *BackupsClientGetOptions) (BackupsClientGetResponse, error) { - var err error - const operationName = "BackupsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, backupVaultName, backupName, options) - if err != nil { - return BackupsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return BackupsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return BackupsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *BackupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, options *BackupsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/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 backupVaultName == "" { - return nil, errors.New("parameter backupVaultName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupVaultName}", url.PathEscape(backupVaultName)) - 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", "2023-05-01-preview") - 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 -} - -// GetLatestStatus - Get the latest status of the backup for a volume -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - 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 - BackupsClientGetLatestStatusOptions contains the optional parameters for the BackupsClient.GetLatestStatus method. -func (client *BackupsClient) GetLatestStatus(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *BackupsClientGetLatestStatusOptions) (BackupsClientGetLatestStatusResponse, error) { - var err error - const operationName = "BackupsClient.GetLatestStatus" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getLatestStatusCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, options) - if err != nil { - return BackupsClientGetLatestStatusResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return BackupsClientGetLatestStatusResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return BackupsClientGetLatestStatusResponse{}, err - } - resp, err := client.getLatestStatusHandleResponse(httpResp) - return resp, err -} - -// getLatestStatusCreateRequest creates the GetLatestStatus request. -func (client *BackupsClient) getLatestStatusCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *BackupsClientGetLatestStatusOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/latestBackupStatus/current" - 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", "2023-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getLatestStatusHandleResponse handles the GetLatestStatus response. -func (client *BackupsClient) getLatestStatusHandleResponse(resp *http.Response) (BackupsClientGetLatestStatusResponse, error) { - result := BackupsClientGetLatestStatusResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BackupStatus); err != nil { - return BackupsClientGetLatestStatusResponse{}, 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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -427,7 +103,7 @@ func (client *BackupsClient) getVolumeRestoreStatusCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -441,165 +117,3 @@ func (client *BackupsClient) getVolumeRestoreStatusHandleResponse(resp *http.Res } return result, nil } - -// NewListByVaultPager - List all backups Under a Backup Vault -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupVaultName - The name of the Backup Vault -// - options - BackupsClientListByVaultOptions contains the optional parameters for the BackupsClient.NewListByVaultPager method. -func (client *BackupsClient) NewListByVaultPager(resourceGroupName string, accountName string, backupVaultName string, options *BackupsClientListByVaultOptions) *runtime.Pager[BackupsClientListByVaultResponse] { - return runtime.NewPager(runtime.PagingHandler[BackupsClientListByVaultResponse]{ - More: func(page BackupsClientListByVaultResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *BackupsClientListByVaultResponse) (BackupsClientListByVaultResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BackupsClient.NewListByVaultPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByVaultCreateRequest(ctx, resourceGroupName, accountName, backupVaultName, options) - }, nil) - if err != nil { - return BackupsClientListByVaultResponse{}, err - } - return client.listByVaultHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByVaultCreateRequest creates the ListByVault request. -func (client *BackupsClient) listByVaultCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, options *BackupsClientListByVaultOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/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 backupVaultName == "" { - return nil, errors.New("parameter backupVaultName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupVaultName}", url.PathEscape(backupVaultName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - if options != nil && options.Filter != nil { - reqQP.Set("$filter", *options.Filter) - } - reqQP.Set("api-version", "2023-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByVaultHandleResponse handles the ListByVault response. -func (client *BackupsClient) listByVaultHandleResponse(resp *http.Response) (BackupsClientListByVaultResponse, error) { - result := BackupsClientListByVaultResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BackupsList); err != nil { - return BackupsClientListByVaultResponse{}, err - } - return result, nil -} - -// BeginUpdate - Patch a Backup under the Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupVaultName - The name of the Backup Vault -// - 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, backupVaultName string, backupName string, body BackupPatch, options *BackupsClientBeginUpdateOptions) (*runtime.Poller[BackupsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, accountName, backupVaultName, backupName, body, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Patch a Backup under the Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *BackupsClient) update(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, body BackupPatch, options *BackupsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "BackupsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, backupVaultName, backupName, 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 -} - -// updateCreateRequest creates the Update request. -func (client *BackupsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, body BackupPatch, options *BackupsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/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 backupVaultName == "" { - return nil, errors.New("parameter backupVaultName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupVaultName}", url.PathEscape(backupVaultName)) - 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", "2023-05-01-preview") - 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/backups_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go deleted file mode 100644 index 898a4157f13a..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backups_client_example_test.go +++ /dev/null @@ -1,255 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_LatestBackupStatus.json -func ExampleBackupsClient_GetLatestStatus() { - 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().GetLatestStatus(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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_List.json -func ExampleBackupsClient_NewListByVaultPager() { - 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().NewListByVaultPager("myRG", "account1", "backupVault1", &armnetapp.BackupsClientListByVaultOptions{Filter: 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/backupVault1/backup1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults/backups"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1/backups/backup1"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // SnapshotName: to.Ptr("backup1"), - // VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_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", "backupVault1", "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/backupVault1/backup1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults/backups"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1/backups/backup1"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // SnapshotName: to.Ptr("backup1"), - // VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_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", "backupVault1", "backup1", armnetapp.Backup{ - Properties: &armnetapp.BackupProperties{ - Label: to.Ptr("myLabel"), - VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"), - }, - }, 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/backupVault1/backup1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults/backups"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1/backups/backup1"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // SnapshotName: to.Ptr("backup1"), - // VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_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", "backupVault1", "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/backupVault1/backup1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults/backups"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1/backups/backup1"), - // Properties: &armnetapp.BackupProperties{ - // BackupType: to.Ptr(armnetapp.BackupTypeManual), - // CreationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()), - // Label: to.Ptr("myLabel"), - // ProvisioningState: to.Ptr("Succeeded"), - // Size: to.Ptr[int64](10011), - // SnapshotName: to.Ptr("backup1"), - // VolumeResourceID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPool/pool1/volumes/volume1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_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", "account1", "backupVault1", "backup1", 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/backupsunderaccount_client.go b/sdk/resourcemanager/netapp/armnetapp/backupsunderaccount_client.go deleted file mode 100644 index d96f662de940..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backupsunderaccount_client.go +++ /dev/null @@ -1,125 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -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" -) - -// BackupsUnderAccountClient contains the methods for the BackupsUnderAccount group. -// Don't use this type directly, use NewBackupsUnderAccountClient() instead. -type BackupsUnderAccountClient struct { - internal *arm.Client - subscriptionID string -} - -// NewBackupsUnderAccountClient creates a new instance of BackupsUnderAccountClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewBackupsUnderAccountClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsUnderAccountClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &BackupsUnderAccountClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginMigrateBackups - Migrate the backups under a NetApp account to backup vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - body - Migrate backups under an account payload supplied in the body of the operation. -// - options - BackupsUnderAccountClientBeginMigrateBackupsOptions contains the optional parameters for the BackupsUnderAccountClient.BeginMigrateBackups -// method. -func (client *BackupsUnderAccountClient) BeginMigrateBackups(ctx context.Context, resourceGroupName string, accountName string, body BackupsMigrationRequest, options *BackupsUnderAccountClientBeginMigrateBackupsOptions) (*runtime.Poller[BackupsUnderAccountClientMigrateBackupsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.migrateBackups(ctx, resourceGroupName, accountName, body, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsUnderAccountClientMigrateBackupsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsUnderAccountClientMigrateBackupsResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// MigrateBackups - Migrate the backups under a NetApp account to backup vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *BackupsUnderAccountClient) migrateBackups(ctx context.Context, resourceGroupName string, accountName string, body BackupsMigrationRequest, options *BackupsUnderAccountClientBeginMigrateBackupsOptions) (*http.Response, error) { - var err error - const operationName = "BackupsUnderAccountClient.BeginMigrateBackups" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.migrateBackupsCreateRequest(ctx, resourceGroupName, accountName, 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.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// migrateBackupsCreateRequest creates the MigrateBackups request. -func (client *BackupsUnderAccountClient) migrateBackupsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, body BackupsMigrationRequest, options *BackupsUnderAccountClientBeginMigrateBackupsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/migrateBackups" - 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.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-preview") - 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/backupsunderaccount_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backupsunderaccount_client_example_test.go deleted file mode 100644 index 505924f83693..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backupsunderaccount_client_example_test.go +++ /dev/null @@ -1,42 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderAccount_Migrate.json -func ExampleBackupsUnderAccountClient_BeginMigrateBackups() { - 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.NewBackupsUnderAccountClient().BeginMigrateBackups(ctx, "myRG", "account1", armnetapp.BackupsMigrationRequest{ - BackupVaultID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"), - }, 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/backupsunderbackupvault_client.go b/sdk/resourcemanager/netapp/armnetapp/backupsunderbackupvault_client.go deleted file mode 100644 index 29c29e8d11e9..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backupsunderbackupvault_client.go +++ /dev/null @@ -1,135 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -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" -) - -// BackupsUnderBackupVaultClient contains the methods for the BackupsUnderBackupVault group. -// Don't use this type directly, use NewBackupsUnderBackupVaultClient() instead. -type BackupsUnderBackupVaultClient struct { - internal *arm.Client - subscriptionID string -} - -// NewBackupsUnderBackupVaultClient creates a new instance of BackupsUnderBackupVaultClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewBackupsUnderBackupVaultClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsUnderBackupVaultClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &BackupsUnderBackupVaultClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, 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 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupVaultName - The name of the Backup Vault -// - backupName - The name of the backup -// - body - Restore payload supplied in the body of the operation. -// - options - BackupsUnderBackupVaultClientBeginRestoreFilesOptions contains the optional parameters for the BackupsUnderBackupVaultClient.BeginRestoreFiles -// method. -func (client *BackupsUnderBackupVaultClient) BeginRestoreFiles(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, body BackupRestoreFiles, options *BackupsUnderBackupVaultClientBeginRestoreFilesOptions) (*runtime.Poller[BackupsUnderBackupVaultClientRestoreFilesResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.restoreFiles(ctx, resourceGroupName, accountName, backupVaultName, backupName, body, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsUnderBackupVaultClientRestoreFilesResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsUnderBackupVaultClientRestoreFilesResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// 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 2023-05-01-preview -func (client *BackupsUnderBackupVaultClient) restoreFiles(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, body BackupRestoreFiles, options *BackupsUnderBackupVaultClientBeginRestoreFilesOptions) (*http.Response, error) { - var err error - const operationName = "BackupsUnderBackupVaultClient.BeginRestoreFiles" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.restoreFilesCreateRequest(ctx, resourceGroupName, accountName, backupVaultName, backupName, 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.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// restoreFilesCreateRequest creates the RestoreFiles request. -func (client *BackupsUnderBackupVaultClient) restoreFilesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, body BackupRestoreFiles, options *BackupsUnderBackupVaultClientBeginRestoreFilesOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}/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 backupVaultName == "" { - return nil, errors.New("parameter backupVaultName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupVaultName}", url.PathEscape(backupVaultName)) - 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", "2023-05-01-preview") - 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/backupsunderbackupvault_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backupsunderbackupvault_client_example_test.go deleted file mode 100644 index ff47b8aa68ca..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backupsunderbackupvault_client_example_test.go +++ /dev/null @@ -1,45 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderBackupVault_SingleFileRestore.json -func ExampleBackupsUnderBackupVaultClient_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.NewBackupsUnderBackupVaultClient().BeginRestoreFiles(ctx, "myRG", "account1", "backupVault1", "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/backupsundervolume_client.go b/sdk/resourcemanager/netapp/armnetapp/backupsundervolume_client.go deleted file mode 100644 index 05013131fbed..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backupsundervolume_client.go +++ /dev/null @@ -1,135 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -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" -) - -// BackupsUnderVolumeClient contains the methods for the BackupsUnderVolume group. -// Don't use this type directly, use NewBackupsUnderVolumeClient() instead. -type BackupsUnderVolumeClient struct { - internal *arm.Client - subscriptionID string -} - -// NewBackupsUnderVolumeClient creates a new instance of BackupsUnderVolumeClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewBackupsUnderVolumeClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsUnderVolumeClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &BackupsUnderVolumeClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginMigrateBackups - Migrate the backups under volume to backup vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - 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 -// - body - Migrate backups under volume payload supplied in the body of the operation. -// - options - BackupsUnderVolumeClientBeginMigrateBackupsOptions contains the optional parameters for the BackupsUnderVolumeClient.BeginMigrateBackups -// method. -func (client *BackupsUnderVolumeClient) BeginMigrateBackups(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body BackupsMigrationRequest, options *BackupsUnderVolumeClientBeginMigrateBackupsOptions) (*runtime.Poller[BackupsUnderVolumeClientMigrateBackupsResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.migrateBackups(ctx, resourceGroupName, accountName, poolName, volumeName, body, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupsUnderVolumeClientMigrateBackupsResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupsUnderVolumeClientMigrateBackupsResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// MigrateBackups - Migrate the backups under volume to backup vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *BackupsUnderVolumeClient) migrateBackups(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body BackupsMigrationRequest, options *BackupsUnderVolumeClientBeginMigrateBackupsOptions) (*http.Response, error) { - var err error - const operationName = "BackupsUnderVolumeClient.BeginMigrateBackups" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.migrateBackupsCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, 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.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// migrateBackupsCreateRequest creates the MigrateBackups request. -func (client *BackupsUnderVolumeClient) migrateBackupsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body BackupsMigrationRequest, options *BackupsUnderVolumeClientBeginMigrateBackupsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/migrateBackups" - 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-preview") - 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/backupsundervolume_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backupsundervolume_client_example_test.go deleted file mode 100644 index 00d037e56cf1..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backupsundervolume_client_example_test.go +++ /dev/null @@ -1,42 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupsUnderVolume_Migrate.json -func ExampleBackupsUnderVolumeClient_BeginMigrateBackups() { - 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.NewBackupsUnderVolumeClient().BeginMigrateBackups(ctx, "myRG", "account1", "pool1", "volume1", armnetapp.BackupsMigrationRequest{ - BackupVaultID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"), - }, 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/backupvaults_client.go b/sdk/resourcemanager/netapp/armnetapp/backupvaults_client.go deleted file mode 100644 index 2797f869c2dc..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backupvaults_client.go +++ /dev/null @@ -1,432 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -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" -) - -// BackupVaultsClient contains the methods for the BackupVaults group. -// Don't use this type directly, use NewBackupVaultsClient() instead. -type BackupVaultsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewBackupVaultsClient creates a new instance of BackupVaultsClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewBackupVaultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupVaultsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &BackupVaultsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update the specified Backup Vault in the NetApp account -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupVaultName - The name of the Backup Vault -// - body - BackupVault object supplied in the body of the operation. -// - options - BackupVaultsClientBeginCreateOrUpdateOptions contains the optional parameters for the BackupVaultsClient.BeginCreateOrUpdate -// method. -func (client *BackupVaultsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, body BackupVault, options *BackupVaultsClientBeginCreateOrUpdateOptions) (*runtime.Poller[BackupVaultsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, backupVaultName, body, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupVaultsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupVaultsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update the specified Backup Vault in the NetApp account -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *BackupVaultsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, body BackupVault, options *BackupVaultsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "BackupVaultsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, backupVaultName, 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.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *BackupVaultsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, body BackupVault, options *BackupVaultsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}" - 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 backupVaultName == "" { - return nil, errors.New("parameter backupVaultName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupVaultName}", url.PathEscape(backupVaultName)) - 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", "2023-05-01-preview") - 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 -} - -// BeginDelete - Delete the specified Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupVaultName - The name of the Backup Vault -// - options - BackupVaultsClientBeginDeleteOptions contains the optional parameters for the BackupVaultsClient.BeginDelete -// method. -func (client *BackupVaultsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, options *BackupVaultsClientBeginDeleteOptions) (*runtime.Poller[BackupVaultsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, backupVaultName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupVaultsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupVaultsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete the specified Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *BackupVaultsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, options *BackupVaultsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "BackupVaultsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, backupVaultName, 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.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *BackupVaultsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, options *BackupVaultsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}" - 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 backupVaultName == "" { - return nil, errors.New("parameter backupVaultName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupVaultName}", url.PathEscape(backupVaultName)) - 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", "2023-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Get the Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupVaultName - The name of the Backup Vault -// - options - BackupVaultsClientGetOptions contains the optional parameters for the BackupVaultsClient.Get method. -func (client *BackupVaultsClient) Get(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, options *BackupVaultsClientGetOptions) (BackupVaultsClientGetResponse, error) { - var err error - const operationName = "BackupVaultsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, backupVaultName, options) - if err != nil { - return BackupVaultsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return BackupVaultsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return BackupVaultsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *BackupVaultsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, options *BackupVaultsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}" - 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 backupVaultName == "" { - return nil, errors.New("parameter backupVaultName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupVaultName}", url.PathEscape(backupVaultName)) - 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", "2023-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *BackupVaultsClient) getHandleResponse(resp *http.Response) (BackupVaultsClientGetResponse, error) { - result := BackupVaultsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BackupVault); err != nil { - return BackupVaultsClientGetResponse{}, err - } - return result, nil -} - -// NewListByNetAppAccountPager - List and describe all Backup Vaults in the NetApp account. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - options - BackupVaultsClientListByNetAppAccountOptions contains the optional parameters for the BackupVaultsClient.NewListByNetAppAccountPager -// method. -func (client *BackupVaultsClient) NewListByNetAppAccountPager(resourceGroupName string, accountName string, options *BackupVaultsClientListByNetAppAccountOptions) *runtime.Pager[BackupVaultsClientListByNetAppAccountResponse] { - return runtime.NewPager(runtime.PagingHandler[BackupVaultsClientListByNetAppAccountResponse]{ - More: func(page BackupVaultsClientListByNetAppAccountResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *BackupVaultsClientListByNetAppAccountResponse) (BackupVaultsClientListByNetAppAccountResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "BackupVaultsClient.NewListByNetAppAccountPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByNetAppAccountCreateRequest(ctx, resourceGroupName, accountName, options) - }, nil) - if err != nil { - return BackupVaultsClientListByNetAppAccountResponse{}, err - } - return client.listByNetAppAccountHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByNetAppAccountCreateRequest creates the ListByNetAppAccount request. -func (client *BackupVaultsClient) listByNetAppAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BackupVaultsClientListByNetAppAccountOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults" - 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", "2023-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByNetAppAccountHandleResponse handles the ListByNetAppAccount response. -func (client *BackupVaultsClient) listByNetAppAccountHandleResponse(resp *http.Response) (BackupVaultsClientListByNetAppAccountResponse, error) { - result := BackupVaultsClientListByNetAppAccountResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.BackupVaultsList); err != nil { - return BackupVaultsClientListByNetAppAccountResponse{}, err - } - return result, nil -} - -// BeginUpdate - Patch the specified NetApp Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - accountName - The name of the NetApp account -// - backupVaultName - The name of the Backup Vault -// - body - Backup Vault object supplied in the body of the operation. -// - options - BackupVaultsClientBeginUpdateOptions contains the optional parameters for the BackupVaultsClient.BeginUpdate -// method. -func (client *BackupVaultsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, body BackupVaultPatch, options *BackupVaultsClientBeginUpdateOptions) (*runtime.Poller[BackupVaultsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, accountName, backupVaultName, body, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupVaultsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupVaultsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Patch the specified NetApp Backup Vault -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *BackupVaultsClient) update(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, body BackupVaultPatch, options *BackupVaultsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "BackupVaultsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, backupVaultName, 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 -} - -// updateCreateRequest creates the Update request. -func (client *BackupVaultsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, body BackupVaultPatch, options *BackupVaultsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupVaults/{backupVaultName}" - 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 backupVaultName == "" { - return nil, errors.New("parameter backupVaultName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{backupVaultName}", url.PathEscape(backupVaultName)) - 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", "2023-05-01-preview") - 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/backupvaults_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/backupvaults_client_example_test.go deleted file mode 100644 index 71e03d478e5c..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/backupvaults_client_example_test.go +++ /dev/null @@ -1,187 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_List.json -func ExampleBackupVaultsClient_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.NewBackupVaultsClient().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.BackupVaultsList = armnetapp.BackupVaultsList{ - // Value: []*armnetapp.BackupVault{ - // { - // Name: to.Ptr("account1/backupVault1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "Tag1": to.Ptr("Value1"), - // }, - // Properties: &armnetapp.BackupVaultProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Get.json -func ExampleBackupVaultsClient_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.NewBackupVaultsClient().Get(ctx, "myRG", "account1", "backupVault1", 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.BackupVault = armnetapp.BackupVault{ - // Name: to.Ptr("account1/backupVault1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "Tag1": to.Ptr("Value1"), - // }, - // Properties: &armnetapp.BackupVaultProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Create.json -func ExampleBackupVaultsClient_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.NewBackupVaultsClient().BeginCreateOrUpdate(ctx, "myRG", "account1", "backupVault1", armnetapp.BackupVault{ - Location: to.Ptr("eastus"), - }, 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.BackupVault = armnetapp.BackupVault{ - // Name: to.Ptr("account1/backupVault1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"), - // Location: to.Ptr("eastus"), - // Properties: &armnetapp.BackupVaultProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Update.json -func ExampleBackupVaultsClient_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.NewBackupVaultsClient().BeginUpdate(ctx, "myRG", "account1", "backupVault1", armnetapp.BackupVaultPatch{ - 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.BackupVault = armnetapp.BackupVault{ - // Name: to.Ptr("account1/backupVault1"), - // Type: to.Ptr("Microsoft.NetApp/netAppAccounts/backupVaults"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "Tag1": to.Ptr("Value1"), - // }, - // Properties: &armnetapp.BackupVaultProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/BackupVaults_Delete.json -func ExampleBackupVaultsClient_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.NewBackupVaultsClient().BeginDelete(ctx, "resourceGroup", "account1", "backupVault1", 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 a58510ee706b..472fb8bdb004 100644 --- a/sdk/resourcemanager/netapp/armnetapp/client_factory.go +++ b/sdk/resourcemanager/netapp/armnetapp/client_factory.go @@ -37,12 +37,6 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -// NewAccountBackupsClient creates a new instance of AccountBackupsClient. -func (c *ClientFactory) NewAccountBackupsClient() *AccountBackupsClient { - subClient, _ := NewAccountBackupsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - // NewAccountsClient creates a new instance of AccountsClient. func (c *ClientFactory) NewAccountsClient() *AccountsClient { subClient, _ := NewAccountsClient(c.subscriptionID, c.credential, c.options) @@ -55,36 +49,12 @@ func (c *ClientFactory) NewBackupPoliciesClient() *BackupPoliciesClient { return subClient } -// NewBackupVaultsClient creates a new instance of BackupVaultsClient. -func (c *ClientFactory) NewBackupVaultsClient() *BackupVaultsClient { - subClient, _ := NewBackupVaultsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - // NewBackupsClient creates a new instance of BackupsClient. func (c *ClientFactory) NewBackupsClient() *BackupsClient { subClient, _ := NewBackupsClient(c.subscriptionID, c.credential, c.options) return subClient } -// NewBackupsUnderAccountClient creates a new instance of BackupsUnderAccountClient. -func (c *ClientFactory) NewBackupsUnderAccountClient() *BackupsUnderAccountClient { - subClient, _ := NewBackupsUnderAccountClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -// NewBackupsUnderBackupVaultClient creates a new instance of BackupsUnderBackupVaultClient. -func (c *ClientFactory) NewBackupsUnderBackupVaultClient() *BackupsUnderBackupVaultClient { - subClient, _ := NewBackupsUnderBackupVaultClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -// NewBackupsUnderVolumeClient creates a new instance of BackupsUnderVolumeClient. -func (c *ClientFactory) NewBackupsUnderVolumeClient() *BackupsUnderVolumeClient { - subClient, _ := NewBackupsUnderVolumeClient(c.subscriptionID, c.credential, c.options) - return subClient -} - // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { subClient, _ := NewOperationsClient(c.credential, c.options) @@ -109,12 +79,6 @@ func (c *ClientFactory) NewResourceQuotaLimitsClient() *ResourceQuotaLimitsClien return subClient } -// NewResourceRegionInfosClient creates a new instance of ResourceRegionInfosClient. -func (c *ClientFactory) NewResourceRegionInfosClient() *ResourceRegionInfosClient { - subClient, _ := NewResourceRegionInfosClient(c.subscriptionID, c.credential, c.options) - return subClient -} - // NewSnapshotPoliciesClient creates a new instance of SnapshotPoliciesClient. func (c *ClientFactory) NewSnapshotPoliciesClient() *SnapshotPoliciesClient { subClient, _ := NewSnapshotPoliciesClient(c.subscriptionID, c.credential, c.options) diff --git a/sdk/resourcemanager/netapp/armnetapp/constants.go b/sdk/resourcemanager/netapp/armnetapp/constants.go index fd2a78038966..67684c669104 100644 --- a/sdk/resourcemanager/netapp/armnetapp/constants.go +++ b/sdk/resourcemanager/netapp/armnetapp/constants.go @@ -10,7 +10,7 @@ package armnetapp const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp" - moduleVersion = "v6.0.0-beta.1" + moduleVersion = "v6.0.0" ) // ActiveDirectoryStatus - Status of the Active Directory @@ -74,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 @@ -525,15 +507,19 @@ func PossibleRegionStorageToNetworkProximityValues() []RegionStorageToNetworkPro type RelationshipStatus string const ( + RelationshipStatusFailed RelationshipStatus = "Failed" RelationshipStatusIdle RelationshipStatus = "Idle" RelationshipStatusTransferring RelationshipStatus = "Transferring" + RelationshipStatusUnknown RelationshipStatus = "Unknown" ) // PossibleRelationshipStatusValues returns the possible values for the RelationshipStatus const type. func PossibleRelationshipStatusValues() []RelationshipStatus { return []RelationshipStatus{ + RelationshipStatusFailed, RelationshipStatusIdle, RelationshipStatusTransferring, + RelationshipStatusUnknown, } } diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/accountbackups_server.go b/sdk/resourcemanager/netapp/armnetapp/fake/accountbackups_server.go deleted file mode 100644 index 25c9a6102ad6..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/fake/accountbackups_server.go +++ /dev/null @@ -1,220 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6" - "net/http" - "net/url" - "regexp" -) - -// AccountBackupsServer is a fake server for instances of the armnetapp.AccountBackupsClient type. -type AccountBackupsServer struct { - // BeginDelete is the fake for method AccountBackupsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *armnetapp.AccountBackupsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetapp.AccountBackupsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method AccountBackupsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, accountName string, backupName string, options *armnetapp.AccountBackupsClientGetOptions) (resp azfake.Responder[armnetapp.AccountBackupsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByNetAppAccountPager is the fake for method AccountBackupsClient.NewListByNetAppAccountPager - // HTTP status codes to indicate success: http.StatusOK - NewListByNetAppAccountPager func(resourceGroupName string, accountName string, options *armnetapp.AccountBackupsClientListByNetAppAccountOptions) (resp azfake.PagerResponder[armnetapp.AccountBackupsClientListByNetAppAccountResponse]) -} - -// NewAccountBackupsServerTransport creates a new instance of AccountBackupsServerTransport with the provided implementation. -// The returned AccountBackupsServerTransport instance is connected to an instance of armnetapp.AccountBackupsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewAccountBackupsServerTransport(srv *AccountBackupsServer) *AccountBackupsServerTransport { - return &AccountBackupsServerTransport{ - srv: srv, - beginDelete: newTracker[azfake.PollerResponder[armnetapp.AccountBackupsClientDeleteResponse]](), - newListByNetAppAccountPager: newTracker[azfake.PagerResponder[armnetapp.AccountBackupsClientListByNetAppAccountResponse]](), - } -} - -// AccountBackupsServerTransport connects instances of armnetapp.AccountBackupsClient to instances of AccountBackupsServer. -// Don't use this type directly, use NewAccountBackupsServerTransport instead. -type AccountBackupsServerTransport struct { - srv *AccountBackupsServer - beginDelete *tracker[azfake.PollerResponder[armnetapp.AccountBackupsClientDeleteResponse]] - newListByNetAppAccountPager *tracker[azfake.PagerResponder[armnetapp.AccountBackupsClientListByNetAppAccountResponse]] -} - -// Do implements the policy.Transporter interface for AccountBackupsServerTransport. -func (a *AccountBackupsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "AccountBackupsClient.BeginDelete": - resp, err = a.dispatchBeginDelete(req) - case "AccountBackupsClient.Get": - resp, err = a.dispatchGet(req) - case "AccountBackupsClient.NewListByNetAppAccountPager": - resp, err = a.dispatchNewListByNetAppAccountPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (a *AccountBackupsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if a.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := a.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accountBackups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.BeginDelete(req.Context(), resourceGroupNameParam, accountNameParam, backupNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - a.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - a.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - a.beginDelete.remove(req) - } - - return resp, nil -} - -func (a *AccountBackupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if a.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accountBackups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, accountNameParam, backupNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Backup, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AccountBackupsServerTransport) dispatchNewListByNetAppAccountPager(req *http.Request) (*http.Response, error) { - if a.srv.NewListByNetAppAccountPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByNetAppAccountPager not implemented")} - } - newListByNetAppAccountPager := a.newListByNetAppAccountPager.get(req) - if newListByNetAppAccountPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/accountBackups` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - includeOnlyBackupsFromDeletedVolumesUnescaped, err := url.QueryUnescape(qp.Get("includeOnlyBackupsFromDeletedVolumes")) - if err != nil { - return nil, err - } - includeOnlyBackupsFromDeletedVolumesParam := getOptional(includeOnlyBackupsFromDeletedVolumesUnescaped) - var options *armnetapp.AccountBackupsClientListByNetAppAccountOptions - if includeOnlyBackupsFromDeletedVolumesParam != nil { - options = &armnetapp.AccountBackupsClientListByNetAppAccountOptions{ - IncludeOnlyBackupsFromDeletedVolumes: includeOnlyBackupsFromDeletedVolumesParam, - } - } - resp := a.srv.NewListByNetAppAccountPager(resourceGroupNameParam, accountNameParam, options) - newListByNetAppAccountPager = &resp - a.newListByNetAppAccountPager.add(req, newListByNetAppAccountPager) - } - resp, err := server.PagerResponderNext(newListByNetAppAccountPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - a.newListByNetAppAccountPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByNetAppAccountPager) { - a.newListByNetAppAccountPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/accounts_server.go b/sdk/resourcemanager/netapp/armnetapp/fake/accounts_server.go index d2d98f598cfa..60a6d6f3e08b 100644 --- a/sdk/resourcemanager/netapp/armnetapp/fake/accounts_server.go +++ b/sdk/resourcemanager/netapp/armnetapp/fake/accounts_server.go @@ -19,7 +19,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6" "net/http" "net/url" - "reflect" "regexp" ) @@ -45,10 +44,6 @@ type AccountsServer struct { // HTTP status codes to indicate success: http.StatusOK NewListBySubscriptionPager func(options *armnetapp.AccountsClientListBySubscriptionOptions) (resp azfake.PagerResponder[armnetapp.AccountsClientListBySubscriptionResponse]) - // BeginMigrateEncryptionKey is the fake for method AccountsClient.BeginMigrateEncryptionKey - // HTTP status codes to indicate success: http.StatusAccepted - BeginMigrateEncryptionKey func(ctx context.Context, resourceGroupName string, accountName string, options *armnetapp.AccountsClientBeginMigrateEncryptionKeyOptions) (resp azfake.PollerResponder[armnetapp.AccountsClientMigrateEncryptionKeyResponse], errResp azfake.ErrorResponder) - // BeginRenewCredentials is the fake for method AccountsClient.BeginRenewCredentials // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginRenewCredentials func(ctx context.Context, resourceGroupName string, accountName string, options *armnetapp.AccountsClientBeginRenewCredentialsOptions) (resp azfake.PollerResponder[armnetapp.AccountsClientRenewCredentialsResponse], errResp azfake.ErrorResponder) @@ -68,7 +63,6 @@ func NewAccountsServerTransport(srv *AccountsServer) *AccountsServerTransport { beginDelete: newTracker[azfake.PollerResponder[armnetapp.AccountsClientDeleteResponse]](), newListPager: newTracker[azfake.PagerResponder[armnetapp.AccountsClientListResponse]](), newListBySubscriptionPager: newTracker[azfake.PagerResponder[armnetapp.AccountsClientListBySubscriptionResponse]](), - beginMigrateEncryptionKey: newTracker[azfake.PollerResponder[armnetapp.AccountsClientMigrateEncryptionKeyResponse]](), beginRenewCredentials: newTracker[azfake.PollerResponder[armnetapp.AccountsClientRenewCredentialsResponse]](), beginUpdate: newTracker[azfake.PollerResponder[armnetapp.AccountsClientUpdateResponse]](), } @@ -82,7 +76,6 @@ type AccountsServerTransport struct { beginDelete *tracker[azfake.PollerResponder[armnetapp.AccountsClientDeleteResponse]] newListPager *tracker[azfake.PagerResponder[armnetapp.AccountsClientListResponse]] newListBySubscriptionPager *tracker[azfake.PagerResponder[armnetapp.AccountsClientListBySubscriptionResponse]] - beginMigrateEncryptionKey *tracker[azfake.PollerResponder[armnetapp.AccountsClientMigrateEncryptionKeyResponse]] beginRenewCredentials *tracker[azfake.PollerResponder[armnetapp.AccountsClientRenewCredentialsResponse]] beginUpdate *tracker[azfake.PollerResponder[armnetapp.AccountsClientUpdateResponse]] } @@ -109,8 +102,6 @@ func (a *AccountsServerTransport) Do(req *http.Request) (*http.Response, error) resp, err = a.dispatchNewListPager(req) case "AccountsClient.NewListBySubscriptionPager": resp, err = a.dispatchNewListBySubscriptionPager(req) - case "AccountsClient.BeginMigrateEncryptionKey": - resp, err = a.dispatchBeginMigrateEncryptionKey(req) case "AccountsClient.BeginRenewCredentials": resp, err = a.dispatchBeginRenewCredentials(req) case "AccountsClient.BeginUpdate": @@ -321,60 +312,6 @@ func (a *AccountsServerTransport) dispatchNewListBySubscriptionPager(req *http.R return resp, nil } -func (a *AccountsServerTransport) dispatchBeginMigrateEncryptionKey(req *http.Request) (*http.Response, error) { - if a.srv.BeginMigrateEncryptionKey == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginMigrateEncryptionKey not implemented")} - } - beginMigrateEncryptionKey := a.beginMigrateEncryptionKey.get(req) - if beginMigrateEncryptionKey == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrateEncryption` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armnetapp.EncryptionMigrationRequest](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - var options *armnetapp.AccountsClientBeginMigrateEncryptionKeyOptions - if !reflect.ValueOf(body).IsZero() { - options = &armnetapp.AccountsClientBeginMigrateEncryptionKeyOptions{ - Body: &body, - } - } - respr, errRespr := a.srv.BeginMigrateEncryptionKey(req.Context(), resourceGroupNameParam, accountNameParam, options) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginMigrateEncryptionKey = &respr - a.beginMigrateEncryptionKey.add(req, beginMigrateEncryptionKey) - } - - resp, err := server.PollerResponderNext(beginMigrateEncryptionKey, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { - a.beginMigrateEncryptionKey.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginMigrateEncryptionKey) { - a.beginMigrateEncryptionKey.remove(req) - } - - return resp, nil -} - func (a *AccountsServerTransport) dispatchBeginRenewCredentials(req *http.Request) (*http.Response, error) { if a.srv.BeginRenewCredentials == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRenewCredentials not implemented")} diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/backups_server.go b/sdk/resourcemanager/netapp/armnetapp/fake/backups_server.go index ae8f559e5e0c..49d9756f1907 100644 --- a/sdk/resourcemanager/netapp/armnetapp/fake/backups_server.go +++ b/sdk/resourcemanager/netapp/armnetapp/fake/backups_server.go @@ -15,7 +15,6 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6" "net/http" "net/url" @@ -24,56 +23,22 @@ import ( // BackupsServer is a fake server for instances of the armnetapp.BackupsClient type. type BackupsServer struct { - // BeginCreate is the fake for method BackupsClient.BeginCreate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreate func(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, body armnetapp.Backup, options *armnetapp.BackupsClientBeginCreateOptions) (resp azfake.PollerResponder[armnetapp.BackupsClientCreateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method BackupsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, options *armnetapp.BackupsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetapp.BackupsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method BackupsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, options *armnetapp.BackupsClientGetOptions) (resp azfake.Responder[armnetapp.BackupsClientGetResponse], errResp azfake.ErrorResponder) - - // GetLatestStatus is the fake for method BackupsClient.GetLatestStatus - // HTTP status codes to indicate success: http.StatusOK - GetLatestStatus func(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *armnetapp.BackupsClientGetLatestStatusOptions) (resp azfake.Responder[armnetapp.BackupsClientGetLatestStatusResponse], errResp azfake.ErrorResponder) - // GetVolumeRestoreStatus is the fake for method BackupsClient.GetVolumeRestoreStatus // HTTP status codes to indicate success: http.StatusOK GetVolumeRestoreStatus func(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *armnetapp.BackupsClientGetVolumeRestoreStatusOptions) (resp azfake.Responder[armnetapp.BackupsClientGetVolumeRestoreStatusResponse], errResp azfake.ErrorResponder) - - // NewListByVaultPager is the fake for method BackupsClient.NewListByVaultPager - // HTTP status codes to indicate success: http.StatusOK - NewListByVaultPager func(resourceGroupName string, accountName string, backupVaultName string, options *armnetapp.BackupsClientListByVaultOptions) (resp azfake.PagerResponder[armnetapp.BackupsClientListByVaultResponse]) - - // BeginUpdate is the fake for method BackupsClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, body armnetapp.BackupPatch, options *armnetapp.BackupsClientBeginUpdateOptions) (resp azfake.PollerResponder[armnetapp.BackupsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewBackupsServerTransport creates a new instance of BackupsServerTransport with the provided implementation. // The returned BackupsServerTransport instance is connected to an instance of armnetapp.BackupsClient via the // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewBackupsServerTransport(srv *BackupsServer) *BackupsServerTransport { - return &BackupsServerTransport{ - srv: srv, - beginCreate: newTracker[azfake.PollerResponder[armnetapp.BackupsClientCreateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armnetapp.BackupsClientDeleteResponse]](), - newListByVaultPager: newTracker[azfake.PagerResponder[armnetapp.BackupsClientListByVaultResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armnetapp.BackupsClientUpdateResponse]](), - } + return &BackupsServerTransport{srv: srv} } // BackupsServerTransport connects instances of armnetapp.BackupsClient to instances of BackupsServer. // Don't use this type directly, use NewBackupsServerTransport instead. type BackupsServerTransport struct { - srv *BackupsServer - beginCreate *tracker[azfake.PollerResponder[armnetapp.BackupsClientCreateResponse]] - beginDelete *tracker[azfake.PollerResponder[armnetapp.BackupsClientDeleteResponse]] - newListByVaultPager *tracker[azfake.PagerResponder[armnetapp.BackupsClientListByVaultResponse]] - beginUpdate *tracker[azfake.PollerResponder[armnetapp.BackupsClientUpdateResponse]] + srv *BackupsServer } // Do implements the policy.Transporter interface for BackupsServerTransport. @@ -88,20 +53,8 @@ func (b *BackupsServerTransport) Do(req *http.Request) (*http.Response, error) { var err error switch method { - case "BackupsClient.BeginCreate": - resp, err = b.dispatchBeginCreate(req) - case "BackupsClient.BeginDelete": - resp, err = b.dispatchBeginDelete(req) - case "BackupsClient.Get": - resp, err = b.dispatchGet(req) - case "BackupsClient.GetLatestStatus": - resp, err = b.dispatchGetLatestStatus(req) case "BackupsClient.GetVolumeRestoreStatus": resp, err = b.dispatchGetVolumeRestoreStatus(req) - case "BackupsClient.NewListByVaultPager": - resp, err = b.dispatchNewListByVaultPager(req) - case "BackupsClient.BeginUpdate": - resp, err = b.dispatchBeginUpdate(req) default: err = fmt.Errorf("unhandled API %s", method) } @@ -113,196 +66,6 @@ func (b *BackupsServerTransport) Do(req *http.Request) (*http.Response, error) { return resp, nil } -func (b *BackupsServerTransport) dispatchBeginCreate(req *http.Request) (*http.Response, error) { - if b.srv.BeginCreate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} - } - beginCreate := b.beginCreate.get(req) - if beginCreate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armnetapp.Backup](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupVaultName")]) - if err != nil { - return nil, err - } - backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginCreate(req.Context(), resourceGroupNameParam, accountNameParam, backupVaultNameParam, backupNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreate = &respr - b.beginCreate.add(req, beginCreate) - } - - resp, err := server.PollerResponderNext(beginCreate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - b.beginCreate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreate) { - b.beginCreate.remove(req) - } - - return resp, nil -} - -func (b *BackupsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if b.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := b.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupVaultName")]) - if err != nil { - return nil, err - } - backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginDelete(req.Context(), resourceGroupNameParam, accountNameParam, backupVaultNameParam, backupNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - b.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - b.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - b.beginDelete.remove(req) - } - - return resp, nil -} - -func (b *BackupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if b.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupVaultName")]) - if err != nil { - return nil, err - } - backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.Get(req.Context(), resourceGroupNameParam, accountNameParam, backupVaultNameParam, backupNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Backup, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (b *BackupsServerTransport) dispatchGetLatestStatus(req *http.Request) (*http.Response, error) { - if b.srv.GetLatestStatus == nil { - return nil, &nonRetriableError{errors.New("fake for method GetLatestStatus not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capacityPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/volumes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/latestBackupStatus/current` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) - if err != nil { - return nil, err - } - volumeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("volumeName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.GetLatestStatus(req.Context(), resourceGroupNameParam, accountNameParam, poolNameParam, volumeNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BackupStatus, req) - if err != nil { - return nil, err - } - return resp, nil -} - func (b *BackupsServerTransport) dispatchGetVolumeRestoreStatus(req *http.Request) (*http.Response, error) { if b.srv.GetVolumeRestoreStatus == nil { return nil, &nonRetriableError{errors.New("fake for method GetVolumeRestoreStatus not implemented")} @@ -343,116 +106,3 @@ func (b *BackupsServerTransport) dispatchGetVolumeRestoreStatus(req *http.Reques } return resp, nil } - -func (b *BackupsServerTransport) dispatchNewListByVaultPager(req *http.Request) (*http.Response, error) { - if b.srv.NewListByVaultPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByVaultPager not implemented")} - } - newListByVaultPager := b.newListByVaultPager.get(req) - if newListByVaultPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupVaultName")]) - if err != nil { - return nil, err - } - filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) - if err != nil { - return nil, err - } - filterParam := getOptional(filterUnescaped) - var options *armnetapp.BackupsClientListByVaultOptions - if filterParam != nil { - options = &armnetapp.BackupsClientListByVaultOptions{ - Filter: filterParam, - } - } - resp := b.srv.NewListByVaultPager(resourceGroupNameParam, accountNameParam, backupVaultNameParam, options) - newListByVaultPager = &resp - b.newListByVaultPager.add(req, newListByVaultPager) - server.PagerResponderInjectNextLinks(newListByVaultPager, req, func(page *armnetapp.BackupsClientListByVaultResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByVaultPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - b.newListByVaultPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByVaultPager) { - b.newListByVaultPager.remove(req) - } - return resp, nil -} - -func (b *BackupsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if b.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := b.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armnetapp.BackupPatch](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupVaultName")]) - if err != nil { - return nil, err - } - backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginUpdate(req.Context(), resourceGroupNameParam, accountNameParam, backupVaultNameParam, backupNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - b.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - b.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - b.beginUpdate.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/backupsunderaccount_server.go b/sdk/resourcemanager/netapp/armnetapp/fake/backupsunderaccount_server.go deleted file mode 100644 index 734d0e8c5522..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/fake/backupsunderaccount_server.go +++ /dev/null @@ -1,119 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6" - "net/http" - "net/url" - "regexp" -) - -// BackupsUnderAccountServer is a fake server for instances of the armnetapp.BackupsUnderAccountClient type. -type BackupsUnderAccountServer struct { - // BeginMigrateBackups is the fake for method BackupsUnderAccountClient.BeginMigrateBackups - // HTTP status codes to indicate success: http.StatusAccepted - BeginMigrateBackups func(ctx context.Context, resourceGroupName string, accountName string, body armnetapp.BackupsMigrationRequest, options *armnetapp.BackupsUnderAccountClientBeginMigrateBackupsOptions) (resp azfake.PollerResponder[armnetapp.BackupsUnderAccountClientMigrateBackupsResponse], errResp azfake.ErrorResponder) -} - -// NewBackupsUnderAccountServerTransport creates a new instance of BackupsUnderAccountServerTransport with the provided implementation. -// The returned BackupsUnderAccountServerTransport instance is connected to an instance of armnetapp.BackupsUnderAccountClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewBackupsUnderAccountServerTransport(srv *BackupsUnderAccountServer) *BackupsUnderAccountServerTransport { - return &BackupsUnderAccountServerTransport{ - srv: srv, - beginMigrateBackups: newTracker[azfake.PollerResponder[armnetapp.BackupsUnderAccountClientMigrateBackupsResponse]](), - } -} - -// BackupsUnderAccountServerTransport connects instances of armnetapp.BackupsUnderAccountClient to instances of BackupsUnderAccountServer. -// Don't use this type directly, use NewBackupsUnderAccountServerTransport instead. -type BackupsUnderAccountServerTransport struct { - srv *BackupsUnderAccountServer - beginMigrateBackups *tracker[azfake.PollerResponder[armnetapp.BackupsUnderAccountClientMigrateBackupsResponse]] -} - -// Do implements the policy.Transporter interface for BackupsUnderAccountServerTransport. -func (b *BackupsUnderAccountServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "BackupsUnderAccountClient.BeginMigrateBackups": - resp, err = b.dispatchBeginMigrateBackups(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (b *BackupsUnderAccountServerTransport) dispatchBeginMigrateBackups(req *http.Request) (*http.Response, error) { - if b.srv.BeginMigrateBackups == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginMigrateBackups not implemented")} - } - beginMigrateBackups := b.beginMigrateBackups.get(req) - if beginMigrateBackups == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrateBackups` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armnetapp.BackupsMigrationRequest](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginMigrateBackups(req.Context(), resourceGroupNameParam, accountNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginMigrateBackups = &respr - b.beginMigrateBackups.add(req, beginMigrateBackups) - } - - resp, err := server.PollerResponderNext(beginMigrateBackups, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { - b.beginMigrateBackups.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginMigrateBackups) { - b.beginMigrateBackups.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/backupsunderbackupvault_server.go b/sdk/resourcemanager/netapp/armnetapp/fake/backupsunderbackupvault_server.go deleted file mode 100644 index 4aac734f25a2..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/fake/backupsunderbackupvault_server.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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6" - "net/http" - "net/url" - "regexp" -) - -// BackupsUnderBackupVaultServer is a fake server for instances of the armnetapp.BackupsUnderBackupVaultClient type. -type BackupsUnderBackupVaultServer struct { - // BeginRestoreFiles is the fake for method BackupsUnderBackupVaultClient.BeginRestoreFiles - // HTTP status codes to indicate success: http.StatusAccepted - BeginRestoreFiles func(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, backupName string, body armnetapp.BackupRestoreFiles, options *armnetapp.BackupsUnderBackupVaultClientBeginRestoreFilesOptions) (resp azfake.PollerResponder[armnetapp.BackupsUnderBackupVaultClientRestoreFilesResponse], errResp azfake.ErrorResponder) -} - -// NewBackupsUnderBackupVaultServerTransport creates a new instance of BackupsUnderBackupVaultServerTransport with the provided implementation. -// The returned BackupsUnderBackupVaultServerTransport instance is connected to an instance of armnetapp.BackupsUnderBackupVaultClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewBackupsUnderBackupVaultServerTransport(srv *BackupsUnderBackupVaultServer) *BackupsUnderBackupVaultServerTransport { - return &BackupsUnderBackupVaultServerTransport{ - srv: srv, - beginRestoreFiles: newTracker[azfake.PollerResponder[armnetapp.BackupsUnderBackupVaultClientRestoreFilesResponse]](), - } -} - -// BackupsUnderBackupVaultServerTransport connects instances of armnetapp.BackupsUnderBackupVaultClient to instances of BackupsUnderBackupVaultServer. -// Don't use this type directly, use NewBackupsUnderBackupVaultServerTransport instead. -type BackupsUnderBackupVaultServerTransport struct { - srv *BackupsUnderBackupVaultServer - beginRestoreFiles *tracker[azfake.PollerResponder[armnetapp.BackupsUnderBackupVaultClientRestoreFilesResponse]] -} - -// Do implements the policy.Transporter interface for BackupsUnderBackupVaultServerTransport. -func (b *BackupsUnderBackupVaultServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "BackupsUnderBackupVaultClient.BeginRestoreFiles": - resp, err = b.dispatchBeginRestoreFiles(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (b *BackupsUnderBackupVaultServerTransport) dispatchBeginRestoreFiles(req *http.Request) (*http.Response, error) { - if b.srv.BeginRestoreFiles == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginRestoreFiles not implemented")} - } - beginRestoreFiles := b.beginRestoreFiles.get(req) - if beginRestoreFiles == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restoreFiles` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armnetapp.BackupRestoreFiles](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupVaultName")]) - if err != nil { - return nil, err - } - backupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginRestoreFiles(req.Context(), resourceGroupNameParam, accountNameParam, backupVaultNameParam, backupNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginRestoreFiles = &respr - b.beginRestoreFiles.add(req, beginRestoreFiles) - } - - resp, err := server.PollerResponderNext(beginRestoreFiles, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { - b.beginRestoreFiles.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginRestoreFiles) { - b.beginRestoreFiles.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/backupsundervolume_server.go b/sdk/resourcemanager/netapp/armnetapp/fake/backupsundervolume_server.go deleted file mode 100644 index ce22cfef441c..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/fake/backupsundervolume_server.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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6" - "net/http" - "net/url" - "regexp" -) - -// BackupsUnderVolumeServer is a fake server for instances of the armnetapp.BackupsUnderVolumeClient type. -type BackupsUnderVolumeServer struct { - // BeginMigrateBackups is the fake for method BackupsUnderVolumeClient.BeginMigrateBackups - // HTTP status codes to indicate success: http.StatusAccepted - BeginMigrateBackups func(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body armnetapp.BackupsMigrationRequest, options *armnetapp.BackupsUnderVolumeClientBeginMigrateBackupsOptions) (resp azfake.PollerResponder[armnetapp.BackupsUnderVolumeClientMigrateBackupsResponse], errResp azfake.ErrorResponder) -} - -// NewBackupsUnderVolumeServerTransport creates a new instance of BackupsUnderVolumeServerTransport with the provided implementation. -// The returned BackupsUnderVolumeServerTransport instance is connected to an instance of armnetapp.BackupsUnderVolumeClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewBackupsUnderVolumeServerTransport(srv *BackupsUnderVolumeServer) *BackupsUnderVolumeServerTransport { - return &BackupsUnderVolumeServerTransport{ - srv: srv, - beginMigrateBackups: newTracker[azfake.PollerResponder[armnetapp.BackupsUnderVolumeClientMigrateBackupsResponse]](), - } -} - -// BackupsUnderVolumeServerTransport connects instances of armnetapp.BackupsUnderVolumeClient to instances of BackupsUnderVolumeServer. -// Don't use this type directly, use NewBackupsUnderVolumeServerTransport instead. -type BackupsUnderVolumeServerTransport struct { - srv *BackupsUnderVolumeServer - beginMigrateBackups *tracker[azfake.PollerResponder[armnetapp.BackupsUnderVolumeClientMigrateBackupsResponse]] -} - -// Do implements the policy.Transporter interface for BackupsUnderVolumeServerTransport. -func (b *BackupsUnderVolumeServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "BackupsUnderVolumeClient.BeginMigrateBackups": - resp, err = b.dispatchBeginMigrateBackups(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (b *BackupsUnderVolumeServerTransport) dispatchBeginMigrateBackups(req *http.Request) (*http.Response, error) { - if b.srv.BeginMigrateBackups == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginMigrateBackups not implemented")} - } - beginMigrateBackups := b.beginMigrateBackups.get(req) - if beginMigrateBackups == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capacityPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/volumes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrateBackups` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armnetapp.BackupsMigrationRequest](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) - if err != nil { - return nil, err - } - volumeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("volumeName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginMigrateBackups(req.Context(), resourceGroupNameParam, accountNameParam, poolNameParam, volumeNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginMigrateBackups = &respr - b.beginMigrateBackups.add(req, beginMigrateBackups) - } - - resp, err := server.PollerResponderNext(beginMigrateBackups, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { - b.beginMigrateBackups.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginMigrateBackups) { - b.beginMigrateBackups.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/backupvaults_server.go b/sdk/resourcemanager/netapp/armnetapp/fake/backupvaults_server.go deleted file mode 100644 index b16df92e5cae..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/fake/backupvaults_server.go +++ /dev/null @@ -1,332 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6" - "net/http" - "net/url" - "regexp" -) - -// BackupVaultsServer is a fake server for instances of the armnetapp.BackupVaultsClient type. -type BackupVaultsServer struct { - // BeginCreateOrUpdate is the fake for method BackupVaultsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, body armnetapp.BackupVault, options *armnetapp.BackupVaultsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armnetapp.BackupVaultsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method BackupVaultsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, options *armnetapp.BackupVaultsClientBeginDeleteOptions) (resp azfake.PollerResponder[armnetapp.BackupVaultsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method BackupVaultsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, options *armnetapp.BackupVaultsClientGetOptions) (resp azfake.Responder[armnetapp.BackupVaultsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByNetAppAccountPager is the fake for method BackupVaultsClient.NewListByNetAppAccountPager - // HTTP status codes to indicate success: http.StatusOK - NewListByNetAppAccountPager func(resourceGroupName string, accountName string, options *armnetapp.BackupVaultsClientListByNetAppAccountOptions) (resp azfake.PagerResponder[armnetapp.BackupVaultsClientListByNetAppAccountResponse]) - - // BeginUpdate is the fake for method BackupVaultsClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginUpdate func(ctx context.Context, resourceGroupName string, accountName string, backupVaultName string, body armnetapp.BackupVaultPatch, options *armnetapp.BackupVaultsClientBeginUpdateOptions) (resp azfake.PollerResponder[armnetapp.BackupVaultsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewBackupVaultsServerTransport creates a new instance of BackupVaultsServerTransport with the provided implementation. -// The returned BackupVaultsServerTransport instance is connected to an instance of armnetapp.BackupVaultsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewBackupVaultsServerTransport(srv *BackupVaultsServer) *BackupVaultsServerTransport { - return &BackupVaultsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armnetapp.BackupVaultsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armnetapp.BackupVaultsClientDeleteResponse]](), - newListByNetAppAccountPager: newTracker[azfake.PagerResponder[armnetapp.BackupVaultsClientListByNetAppAccountResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armnetapp.BackupVaultsClientUpdateResponse]](), - } -} - -// BackupVaultsServerTransport connects instances of armnetapp.BackupVaultsClient to instances of BackupVaultsServer. -// Don't use this type directly, use NewBackupVaultsServerTransport instead. -type BackupVaultsServerTransport struct { - srv *BackupVaultsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armnetapp.BackupVaultsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armnetapp.BackupVaultsClientDeleteResponse]] - newListByNetAppAccountPager *tracker[azfake.PagerResponder[armnetapp.BackupVaultsClientListByNetAppAccountResponse]] - beginUpdate *tracker[azfake.PollerResponder[armnetapp.BackupVaultsClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for BackupVaultsServerTransport. -func (b *BackupVaultsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "BackupVaultsClient.BeginCreateOrUpdate": - resp, err = b.dispatchBeginCreateOrUpdate(req) - case "BackupVaultsClient.BeginDelete": - resp, err = b.dispatchBeginDelete(req) - case "BackupVaultsClient.Get": - resp, err = b.dispatchGet(req) - case "BackupVaultsClient.NewListByNetAppAccountPager": - resp, err = b.dispatchNewListByNetAppAccountPager(req) - case "BackupVaultsClient.BeginUpdate": - resp, err = b.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (b *BackupVaultsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if b.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := b.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armnetapp.BackupVault](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupVaultName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, accountNameParam, backupVaultNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - b.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - b.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - b.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (b *BackupVaultsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if b.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := b.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupVaultName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginDelete(req.Context(), resourceGroupNameParam, accountNameParam, backupVaultNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - b.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - b.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - b.beginDelete.remove(req) - } - - return resp, nil -} - -func (b *BackupVaultsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if b.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupVaultName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.Get(req.Context(), resourceGroupNameParam, accountNameParam, backupVaultNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).BackupVault, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (b *BackupVaultsServerTransport) dispatchNewListByNetAppAccountPager(req *http.Request) (*http.Response, error) { - if b.srv.NewListByNetAppAccountPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByNetAppAccountPager not implemented")} - } - newListByNetAppAccountPager := b.newListByNetAppAccountPager.get(req) - if newListByNetAppAccountPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - resp := b.srv.NewListByNetAppAccountPager(resourceGroupNameParam, accountNameParam, nil) - newListByNetAppAccountPager = &resp - b.newListByNetAppAccountPager.add(req, newListByNetAppAccountPager) - server.PagerResponderInjectNextLinks(newListByNetAppAccountPager, req, func(page *armnetapp.BackupVaultsClientListByNetAppAccountResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByNetAppAccountPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - b.newListByNetAppAccountPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByNetAppAccountPager) { - b.newListByNetAppAccountPager.remove(req) - } - return resp, nil -} - -func (b *BackupVaultsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if b.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := b.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/backupVaults/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armnetapp.BackupVaultPatch](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - backupVaultNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("backupVaultName")]) - if err != nil { - return nil, err - } - respr, errRespr := b.srv.BeginUpdate(req.Context(), resourceGroupNameParam, accountNameParam, backupVaultNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - b.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - b.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - b.beginUpdate.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/internal.go b/sdk/resourcemanager/netapp/armnetapp/fake/internal.go index 7d2f89ba4bb2..4d8bd36394ec 100644 --- a/sdk/resourcemanager/netapp/armnetapp/fake/internal.go +++ b/sdk/resourcemanager/netapp/armnetapp/fake/internal.go @@ -11,7 +11,6 @@ package fake import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "net/http" - "reflect" "sync" ) @@ -32,13 +31,6 @@ func contains[T comparable](s []T, v T) bool { return false } -func getOptional[T any](v T) *T { - if reflect.ValueOf(v).IsZero() { - return nil - } - return &v -} - func parseOptional[T any](v string, parse func(v string) (T, error)) (*T, error) { if v == "" { return nil, nil diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/resourceregioninfos_server.go b/sdk/resourcemanager/netapp/armnetapp/fake/resourceregioninfos_server.go deleted file mode 100644 index 085b0517fa0b..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/fake/resourceregioninfos_server.go +++ /dev/null @@ -1,144 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6" - "net/http" - "net/url" - "regexp" -) - -// ResourceRegionInfosServer is a fake server for instances of the armnetapp.ResourceRegionInfosClient type. -type ResourceRegionInfosServer struct { - // Get is the fake for method ResourceRegionInfosClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, location string, options *armnetapp.ResourceRegionInfosClientGetOptions) (resp azfake.Responder[armnetapp.ResourceRegionInfosClientGetResponse], errResp azfake.ErrorResponder) - - // NewListPager is the fake for method ResourceRegionInfosClient.NewListPager - // HTTP status codes to indicate success: http.StatusOK - NewListPager func(location string, options *armnetapp.ResourceRegionInfosClientListOptions) (resp azfake.PagerResponder[armnetapp.ResourceRegionInfosClientListResponse]) -} - -// NewResourceRegionInfosServerTransport creates a new instance of ResourceRegionInfosServerTransport with the provided implementation. -// The returned ResourceRegionInfosServerTransport instance is connected to an instance of armnetapp.ResourceRegionInfosClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewResourceRegionInfosServerTransport(srv *ResourceRegionInfosServer) *ResourceRegionInfosServerTransport { - return &ResourceRegionInfosServerTransport{ - srv: srv, - newListPager: newTracker[azfake.PagerResponder[armnetapp.ResourceRegionInfosClientListResponse]](), - } -} - -// ResourceRegionInfosServerTransport connects instances of armnetapp.ResourceRegionInfosClient to instances of ResourceRegionInfosServer. -// Don't use this type directly, use NewResourceRegionInfosServerTransport instead. -type ResourceRegionInfosServerTransport struct { - srv *ResourceRegionInfosServer - newListPager *tracker[azfake.PagerResponder[armnetapp.ResourceRegionInfosClientListResponse]] -} - -// Do implements the policy.Transporter interface for ResourceRegionInfosServerTransport. -func (r *ResourceRegionInfosServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "ResourceRegionInfosClient.Get": - resp, err = r.dispatchGet(req) - case "ResourceRegionInfosClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (r *ResourceRegionInfosServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if r.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/regionInfos/default` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - respr, errRespr := r.srv.Get(req.Context(), locationParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).RegionInfoResource, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (r *ResourceRegionInfosServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { - if r.srv.NewListPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} - } - newListPager := r.newListPager.get(req) - if newListPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/regionInfos` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 2 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) - if err != nil { - return nil, err - } - resp := r.srv.NewListPager(locationParam, nil) - newListPager = &resp - r.newListPager.add(req, newListPager) - server.PagerResponderInjectNextLinks(newListPager, req, func(page *armnetapp.ResourceRegionInfosClientListResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - r.newListPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListPager) { - r.newListPager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/server_factory.go b/sdk/resourcemanager/netapp/armnetapp/fake/server_factory.go index 34a6f5169f11..59dd4cebb237 100644 --- a/sdk/resourcemanager/netapp/armnetapp/fake/server_factory.go +++ b/sdk/resourcemanager/netapp/armnetapp/fake/server_factory.go @@ -19,25 +19,19 @@ import ( // ServerFactory is a fake server for instances of the armnetapp.ClientFactory type. type ServerFactory struct { - AccountBackupsServer AccountBackupsServer - AccountsServer AccountsServer - BackupPoliciesServer BackupPoliciesServer - BackupVaultsServer BackupVaultsServer - BackupsServer BackupsServer - BackupsUnderAccountServer BackupsUnderAccountServer - BackupsUnderBackupVaultServer BackupsUnderBackupVaultServer - BackupsUnderVolumeServer BackupsUnderVolumeServer - OperationsServer OperationsServer - PoolsServer PoolsServer - ResourceServer ResourceServer - ResourceQuotaLimitsServer ResourceQuotaLimitsServer - ResourceRegionInfosServer ResourceRegionInfosServer - SnapshotPoliciesServer SnapshotPoliciesServer - SnapshotsServer SnapshotsServer - SubvolumesServer SubvolumesServer - VolumeGroupsServer VolumeGroupsServer - VolumeQuotaRulesServer VolumeQuotaRulesServer - VolumesServer VolumesServer + AccountsServer AccountsServer + BackupPoliciesServer BackupPoliciesServer + BackupsServer BackupsServer + OperationsServer OperationsServer + PoolsServer PoolsServer + ResourceServer ResourceServer + ResourceQuotaLimitsServer ResourceQuotaLimitsServer + SnapshotPoliciesServer SnapshotPoliciesServer + SnapshotsServer SnapshotsServer + SubvolumesServer SubvolumesServer + VolumeGroupsServer VolumeGroupsServer + VolumeQuotaRulesServer VolumeQuotaRulesServer + VolumesServer VolumesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -52,27 +46,21 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armnetapp.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trAccountBackupsServer *AccountBackupsServerTransport - trAccountsServer *AccountsServerTransport - trBackupPoliciesServer *BackupPoliciesServerTransport - trBackupVaultsServer *BackupVaultsServerTransport - trBackupsServer *BackupsServerTransport - trBackupsUnderAccountServer *BackupsUnderAccountServerTransport - trBackupsUnderBackupVaultServer *BackupsUnderBackupVaultServerTransport - trBackupsUnderVolumeServer *BackupsUnderVolumeServerTransport - trOperationsServer *OperationsServerTransport - trPoolsServer *PoolsServerTransport - trResourceServer *ResourceServerTransport - trResourceQuotaLimitsServer *ResourceQuotaLimitsServerTransport - trResourceRegionInfosServer *ResourceRegionInfosServerTransport - trSnapshotPoliciesServer *SnapshotPoliciesServerTransport - trSnapshotsServer *SnapshotsServerTransport - trSubvolumesServer *SubvolumesServerTransport - trVolumeGroupsServer *VolumeGroupsServerTransport - trVolumeQuotaRulesServer *VolumeQuotaRulesServerTransport - trVolumesServer *VolumesServerTransport + srv *ServerFactory + trMu sync.Mutex + trAccountsServer *AccountsServerTransport + trBackupPoliciesServer *BackupPoliciesServerTransport + trBackupsServer *BackupsServerTransport + trOperationsServer *OperationsServerTransport + trPoolsServer *PoolsServerTransport + trResourceServer *ResourceServerTransport + trResourceQuotaLimitsServer *ResourceQuotaLimitsServerTransport + trSnapshotPoliciesServer *SnapshotPoliciesServerTransport + trSnapshotsServer *SnapshotsServerTransport + trSubvolumesServer *SubvolumesServerTransport + trVolumeGroupsServer *VolumeGroupsServerTransport + trVolumeQuotaRulesServer *VolumeQuotaRulesServerTransport + trVolumesServer *VolumesServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -88,11 +76,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { var err error switch client { - case "AccountBackupsClient": - initServer(s, &s.trAccountBackupsServer, func() *AccountBackupsServerTransport { - return NewAccountBackupsServerTransport(&s.srv.AccountBackupsServer) - }) - resp, err = s.trAccountBackupsServer.Do(req) case "AccountsClient": initServer(s, &s.trAccountsServer, func() *AccountsServerTransport { return NewAccountsServerTransport(&s.srv.AccountsServer) }) resp, err = s.trAccountsServer.Do(req) @@ -101,27 +84,9 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewBackupPoliciesServerTransport(&s.srv.BackupPoliciesServer) }) resp, err = s.trBackupPoliciesServer.Do(req) - case "BackupVaultsClient": - initServer(s, &s.trBackupVaultsServer, func() *BackupVaultsServerTransport { return NewBackupVaultsServerTransport(&s.srv.BackupVaultsServer) }) - resp, err = s.trBackupVaultsServer.Do(req) case "BackupsClient": initServer(s, &s.trBackupsServer, func() *BackupsServerTransport { return NewBackupsServerTransport(&s.srv.BackupsServer) }) resp, err = s.trBackupsServer.Do(req) - case "BackupsUnderAccountClient": - initServer(s, &s.trBackupsUnderAccountServer, func() *BackupsUnderAccountServerTransport { - return NewBackupsUnderAccountServerTransport(&s.srv.BackupsUnderAccountServer) - }) - resp, err = s.trBackupsUnderAccountServer.Do(req) - case "BackupsUnderBackupVaultClient": - initServer(s, &s.trBackupsUnderBackupVaultServer, func() *BackupsUnderBackupVaultServerTransport { - return NewBackupsUnderBackupVaultServerTransport(&s.srv.BackupsUnderBackupVaultServer) - }) - resp, err = s.trBackupsUnderBackupVaultServer.Do(req) - case "BackupsUnderVolumeClient": - initServer(s, &s.trBackupsUnderVolumeServer, func() *BackupsUnderVolumeServerTransport { - return NewBackupsUnderVolumeServerTransport(&s.srv.BackupsUnderVolumeServer) - }) - resp, err = s.trBackupsUnderVolumeServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) @@ -136,11 +101,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewResourceQuotaLimitsServerTransport(&s.srv.ResourceQuotaLimitsServer) }) resp, err = s.trResourceQuotaLimitsServer.Do(req) - case "ResourceRegionInfosClient": - initServer(s, &s.trResourceRegionInfosServer, func() *ResourceRegionInfosServerTransport { - return NewResourceRegionInfosServerTransport(&s.srv.ResourceRegionInfosServer) - }) - resp, err = s.trResourceRegionInfosServer.Do(req) case "SnapshotPoliciesClient": initServer(s, &s.trSnapshotPoliciesServer, func() *SnapshotPoliciesServerTransport { return NewSnapshotPoliciesServerTransport(&s.srv.SnapshotPoliciesServer) diff --git a/sdk/resourcemanager/netapp/armnetapp/fake/volumes_server.go b/sdk/resourcemanager/netapp/armnetapp/fake/volumes_server.go index 97e74bbd4809..87ca6508c473 100644 --- a/sdk/resourcemanager/netapp/armnetapp/fake/volumes_server.go +++ b/sdk/resourcemanager/netapp/armnetapp/fake/volumes_server.go @@ -110,10 +110,6 @@ type VolumesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginRevertRelocation func(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *armnetapp.VolumesClientBeginRevertRelocationOptions) (resp azfake.PollerResponder[armnetapp.VolumesClientRevertRelocationResponse], errResp azfake.ErrorResponder) - // BeginSplitCloneFromParent is the fake for method VolumesClient.BeginSplitCloneFromParent - // HTTP status codes to indicate success: http.StatusAccepted - BeginSplitCloneFromParent func(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *armnetapp.VolumesClientBeginSplitCloneFromParentOptions) (resp azfake.PollerResponder[armnetapp.VolumesClientSplitCloneFromParentResponse], errResp azfake.ErrorResponder) - // BeginUpdate is the fake for method VolumesClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginUpdate func(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, body armnetapp.VolumePatch, options *armnetapp.VolumesClientBeginUpdateOptions) (resp azfake.PollerResponder[armnetapp.VolumesClientUpdateResponse], errResp azfake.ErrorResponder) @@ -144,7 +140,6 @@ func NewVolumesServerTransport(srv *VolumesServer) *VolumesServerTransport { beginResyncReplication: newTracker[azfake.PollerResponder[armnetapp.VolumesClientResyncReplicationResponse]](), beginRevert: newTracker[azfake.PollerResponder[armnetapp.VolumesClientRevertResponse]](), beginRevertRelocation: newTracker[azfake.PollerResponder[armnetapp.VolumesClientRevertRelocationResponse]](), - beginSplitCloneFromParent: newTracker[azfake.PollerResponder[armnetapp.VolumesClientSplitCloneFromParentResponse]](), beginUpdate: newTracker[azfake.PollerResponder[armnetapp.VolumesClientUpdateResponse]](), } } @@ -172,7 +167,6 @@ type VolumesServerTransport struct { beginResyncReplication *tracker[azfake.PollerResponder[armnetapp.VolumesClientResyncReplicationResponse]] beginRevert *tracker[azfake.PollerResponder[armnetapp.VolumesClientRevertResponse]] beginRevertRelocation *tracker[azfake.PollerResponder[armnetapp.VolumesClientRevertRelocationResponse]] - beginSplitCloneFromParent *tracker[azfake.PollerResponder[armnetapp.VolumesClientSplitCloneFromParentResponse]] beginUpdate *tracker[azfake.PollerResponder[armnetapp.VolumesClientUpdateResponse]] } @@ -230,8 +224,6 @@ func (v *VolumesServerTransport) Do(req *http.Request) (*http.Response, error) { resp, err = v.dispatchBeginRevert(req) case "VolumesClient.BeginRevertRelocation": resp, err = v.dispatchBeginRevertRelocation(req) - case "VolumesClient.BeginSplitCloneFromParent": - resp, err = v.dispatchBeginSplitCloneFromParent(req) case "VolumesClient.BeginUpdate": resp, err = v.dispatchBeginUpdate(req) default: @@ -1371,58 +1363,6 @@ func (v *VolumesServerTransport) dispatchBeginRevertRelocation(req *http.Request return resp, nil } -func (v *VolumesServerTransport) dispatchBeginSplitCloneFromParent(req *http.Request) (*http.Response, error) { - if v.srv.BeginSplitCloneFromParent == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginSplitCloneFromParent not implemented")} - } - beginSplitCloneFromParent := v.beginSplitCloneFromParent.get(req) - if beginSplitCloneFromParent == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.NetApp/netAppAccounts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capacityPools/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/volumes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/splitCloneFromParent` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - accountNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("accountName")]) - if err != nil { - return nil, err - } - poolNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("poolName")]) - if err != nil { - return nil, err - } - volumeNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("volumeName")]) - if err != nil { - return nil, err - } - respr, errRespr := v.srv.BeginSplitCloneFromParent(req.Context(), resourceGroupNameParam, accountNameParam, poolNameParam, volumeNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginSplitCloneFromParent = &respr - v.beginSplitCloneFromParent.add(req, beginSplitCloneFromParent) - } - - resp, err := server.PollerResponderNext(beginSplitCloneFromParent, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { - v.beginSplitCloneFromParent.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginSplitCloneFromParent) { - v.beginSplitCloneFromParent.remove(req) - } - - return resp, nil -} - func (v *VolumesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { if v.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} diff --git a/sdk/resourcemanager/netapp/armnetapp/go.mod b/sdk/resourcemanager/netapp/armnetapp/go.mod index 2b74b860398f..f790d254e9a7 100644 --- a/sdk/resourcemanager/netapp/armnetapp/go.mod +++ b/sdk/resourcemanager/netapp/armnetapp/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect - github.com/golang-jwt/jwt/v5 v5.0.0 // indirect - github.com/google/uuid v1.3.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.14.0 // indirect golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect ) diff --git a/sdk/resourcemanager/netapp/armnetapp/go.sum b/sdk/resourcemanager/netapp/armnetapp/go.sum index 7985f1da436f..428cd71de305 100644 --- a/sdk/resourcemanager/netapp/armnetapp/go.sum +++ b/sdk/resourcemanager/netapp/armnetapp/go.sum @@ -1,31 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 h1:fb8kj/Dh4CSwgsOzHeZY4Xh68cFVbzXx+ONXGMY//4w= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0/go.mod h1:uReU2sSxZExRPBAg3qKzmAucSi51+SP1OhohieR821Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 h1:d81/ng9rET2YqdVkVwkb6EXeRrLJIwyGnJcAlAWKwhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= 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/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/netapp/armnetapp/models.go b/sdk/resourcemanager/netapp/armnetapp/models.go index 5e261437e3ae..757ee4193349 100644 --- a/sdk/resourcemanager/netapp/armnetapp/models.go +++ b/sdk/resourcemanager/netapp/armnetapp/models.go @@ -93,16 +93,9 @@ type AccountProperties struct { // Encryption settings Encryption *AccountEncryption - // Domain for NFSv4 user ID mapping. This property will be set for all NetApp accounts in the subscription and region and - // only affect non ldap NFSv4 volumes. - NfsV4IDDomain *string - // READ-ONLY; Shows the status of disableShowmount for all volumes under the subscription, null equals false DisableShowmount *bool - // READ-ONLY; This will have true value only if account is Multiple AD enabled. - IsMultiAdEnabled *bool - // READ-ONLY; Azure lifecycle management ProvisioningState *string } @@ -190,36 +183,6 @@ type AuthorizeRequest struct { RemoteVolumeResourceID *string } -// Backup under a Backup Vault -type Backup struct { - // REQUIRED; Backup Properties - Properties *BackupProperties - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 Patch Properties - Properties *BackupPatchProperties -} - -// BackupPatchProperties - Backup patch properties -type BackupPatchProperties struct { - // Label for backup - Label *string -} - // BackupPoliciesList - List of Backup Policies type BackupPoliciesList struct { // A list of backup policies @@ -301,146 +264,6 @@ type BackupPolicyProperties struct { VolumesAssigned *int32 } -// BackupProperties - Backup properties -type BackupProperties struct { - // REQUIRED; ResourceId used to identify the Volume - VolumeResourceID *string - - // Label for backup - Label *string - - // The name of the snapshot - SnapshotName *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; ResourceId used to identify the backup policy - BackupPolicyResourceID *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 in bytes - Size *int64 -} - -// 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; Displays the total number of bytes transferred for the ongoing operation - TransferProgressBytes *int64 - - // READ-ONLY; Reason for the unhealthy backup relationship - UnhealthyReason *string -} - -// BackupVault - Backup Vault information -type BackupVault struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Backup Vault Properties - Properties *BackupVaultProperties - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 -} - -// BackupVaultPatch - Backup Vault information -type BackupVaultPatch struct { - // Resource tags - Tags map[string]*string -} - -// BackupVaultProperties - Backup Vault properties -type BackupVaultProperties struct { - // READ-ONLY; Azure lifecycle management - ProvisioningState *string -} - -// BackupVaultsList - List of Backup Vaults -type BackupVaultsList struct { - // URL to get the next set of results. - NextLink *string - - // A list of Backup Vaults - Value []*BackupVault -} - -// BackupsList - List of Backups -type BackupsList struct { - // URL to get the next set of results. - NextLink *string - - // A list of Backups - Value []*Backup -} - -// BackupsMigrationRequest - Migrate Backups Request -type BackupsMigrationRequest struct { - // REQUIRED; The ResourceId of the Backup Vault - BackupVaultID *string -} - // BreakFileLocksRequest - Break file locks request type BreakFileLocksRequest struct { // To clear file locks on a volume for a particular client @@ -563,15 +386,6 @@ type EncryptionIdentity struct { PrincipalID *string } -// EncryptionMigrationRequest - Encryption migration request -type EncryptionMigrationRequest struct { - // REQUIRED; Identifier of the private endpoint to reach the Azure Key Vault - PrivateEndpointID *string - - // REQUIRED; Identifier for the virtual network - VirtualNetworkID *string -} - // ExportPolicyRule - Volume Export Policy Rule type ExportPolicyRule struct { // Client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names @@ -981,51 +795,12 @@ type RegionInfoAvailabilityZoneMappingsItem struct { IsAvailable *bool } -// RegionInfoResource - Information regarding regionInfo Item. -type RegionInfoResource struct { - // regionInfo properties - Properties *RegionInfo - - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/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 -} - -// RegionInfosList - List of regionInfo resources -type RegionInfosList struct { - // URL to get the next set of results. - NextLink *string - - // A list of regionInfo resources - Value []*RegionInfoResource -} - // RelocateVolumeRequest - Relocate volume request type RelocateVolumeRequest struct { // New creation token for the volume that controls the mount point name CreationToken *string } -// RemotePath - The full path to a volume that is to be migrated into ANF. Required for Migration volumes -type RemotePath struct { - // REQUIRED; The Path to a Ontap Host - ExternalHostName *string - - // REQUIRED; The name of a server on the Ontap Host - ServerName *string - - // REQUIRED; The name of a volume on the server - VolumeName *string -} - // Replication properties type Replication struct { // REQUIRED; The resource ID of the remote volume. @@ -1043,15 +818,12 @@ type Replication struct { // ReplicationObject - Replication properties type ReplicationObject struct { - // REQUIRED; The resource ID of the remote volume. Required for cross region and cross zone replication + // REQUIRED; The resource ID of the remote volume. RemoteVolumeResourceID *string // Indicates whether the local volume is the source or destination for the Volume Replication EndpointType *EndpointType - // The full path to a volume that is to be migrated into ANF. Required for Migration volumes - RemotePath *RemotePath - // The remote region for the other end of the Volume Replication. RemoteVolumeRegion *string @@ -1412,7 +1184,7 @@ type SystemData struct { // UpdateNetworkSiblingSetRequest - Network sibling set update. type UpdateNetworkSiblingSetRequest struct { - // REQUIRED; Network features available to the volume + // 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. @@ -1465,21 +1237,6 @@ type Volume struct { Type *string } -// VolumeBackupProperties - Volume Backup Properties -type VolumeBackupProperties struct { - // Backup Enabled - BackupEnabled *bool - - // Backup Policy Resource ID - BackupPolicyID *string - - // Backup Vault Resource ID - BackupVaultID *string - - // Policy Enforced - PolicyEnforced *bool -} - // VolumeBackups - Volume details using the backup policy type VolumeBackups struct { // Total count of backups for volume @@ -1686,9 +1443,6 @@ type VolumePatchProperties struct { // VolumePatchPropertiesDataProtection - DataProtection type volumes include an object containing details of the replication type VolumePatchPropertiesDataProtection struct { - // Backup Properties - Backup *VolumeBackupProperties - // Snapshot properties. Snapshot *VolumeSnapshotProperties } @@ -1830,8 +1584,7 @@ type VolumeProperties struct { // e.g. data, log VolumeSpecName *string - // What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection. For creating - // clone volume, set type to ShortTermClone + // What type of volume is this. For destination volumes in Cross Region Replication, set type to DataProtection VolumeType *string // READ-ONLY; Actual throughput in MiB/s for auto qosType volumes calculated based on size and serviceLevel @@ -1858,9 +1611,6 @@ type VolumeProperties struct { // READ-ONLY; Unique FileSystem Identifier. FileSystemID *string - // READ-ONLY; Space shared by short term clone volume with parent volume in bytes. - InheritedSizeInBytes *int64 - // READ-ONLY; Maximum number of files allowed. Needs a service request in order to be changed. Only allowed to be changed // if volume quota is more than 4TiB. MaximumNumberOfFiles *int64 @@ -1893,9 +1643,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 diff --git a/sdk/resourcemanager/netapp/armnetapp/models_serde.go b/sdk/resourcemanager/netapp/armnetapp/models_serde.go index 3a4057d0424e..b8a1e3fb6527 100644 --- a/sdk/resourcemanager/netapp/armnetapp/models_serde.go +++ b/sdk/resourcemanager/netapp/armnetapp/models_serde.go @@ -197,8 +197,6 @@ func (a AccountProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "activeDirectories", a.ActiveDirectories) populate(objectMap, "disableShowmount", a.DisableShowmount) populate(objectMap, "encryption", a.Encryption) - populate(objectMap, "isMultiAdEnabled", a.IsMultiAdEnabled) - populate(objectMap, "nfsV4IDDomain", a.NfsV4IDDomain) populate(objectMap, "provisioningState", a.ProvisioningState) return json.Marshal(objectMap) } @@ -221,12 +219,6 @@ func (a *AccountProperties) UnmarshalJSON(data []byte) error { case "encryption": err = unpopulate(val, "Encryption", &a.Encryption) delete(rawMsg, key) - case "isMultiAdEnabled": - err = unpopulate(val, "IsMultiAdEnabled", &a.IsMultiAdEnabled) - delete(rawMsg, key) - case "nfsV4IDDomain": - err = unpopulate(val, "NfsV4IDDomain", &a.NfsV4IDDomain) - delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) delete(rawMsg, key) @@ -380,103 +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, "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 "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) - 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) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type BackupPatchProperties. -func (b BackupPatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "label", b.Label) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupPatchProperties. -func (b *BackupPatchProperties) 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 "label": - err = unpopulate(val, "Label", &b.Label) - 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) @@ -661,361 +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, "backupPolicyResourceId", b.BackupPolicyResourceID) - populate(objectMap, "backupType", b.BackupType) - populateDateTimeRFC3339(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, "snapshotName", b.SnapshotName) - populate(objectMap, "useExistingSnapshot", b.UseExistingSnapshot) - populate(objectMap, "volumeResourceId", b.VolumeResourceID) - 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 "backupPolicyResourceId": - err = unpopulate(val, "BackupPolicyResourceID", &b.BackupPolicyResourceID) - delete(rawMsg, key) - case "backupType": - err = unpopulate(val, "BackupType", &b.BackupType) - delete(rawMsg, key) - case "creationDate": - err = unpopulateDateTimeRFC3339(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 "snapshotName": - err = unpopulate(val, "SnapshotName", &b.SnapshotName) - delete(rawMsg, key) - case "useExistingSnapshot": - err = unpopulate(val, "UseExistingSnapshot", &b.UseExistingSnapshot) - delete(rawMsg, key) - case "volumeResourceId": - err = unpopulate(val, "VolumeResourceID", &b.VolumeResourceID) - 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, "transferProgressBytes", b.TransferProgressBytes) - 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 "transferProgressBytes": - err = unpopulate(val, "TransferProgressBytes", &b.TransferProgressBytes) - 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 BackupVault. -func (b BackupVault) 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, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupVault. -func (b *BackupVault) 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 "tags": - err = unpopulate(val, "Tags", &b.Tags) - 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 BackupVaultPatch. -func (b BackupVaultPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "tags", b.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupVaultPatch. -func (b *BackupVaultPatch) 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 "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 BackupVaultProperties. -func (b BackupVaultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", b.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupVaultProperties. -func (b *BackupVaultProperties) 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 "provisioningState": - err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) - 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 BackupVaultsList. -func (b BackupVaultsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupVaultsList. -func (b *BackupVaultsList) 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 "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) - delete(rawMsg, 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 BackupsList. -func (b BackupsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", b.NextLink) - 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 "nextLink": - err = unpopulate(val, "NextLink", &b.NextLink) - delete(rawMsg, 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 BackupsMigrationRequest. -func (b BackupsMigrationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "backupVaultId", b.BackupVaultID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupsMigrationRequest. -func (b *BackupsMigrationRequest) 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 "backupVaultId": - err = unpopulate(val, "BackupVaultID", &b.BackupVaultID) - 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) @@ -1343,37 +883,6 @@ func (e *EncryptionIdentity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type EncryptionMigrationRequest. -func (e EncryptionMigrationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "privateEndpointId", e.PrivateEndpointID) - populate(objectMap, "virtualNetworkId", e.VirtualNetworkID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionMigrationRequest. -func (e *EncryptionMigrationRequest) 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", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "privateEndpointId": - err = unpopulate(val, "PrivateEndpointID", &e.PrivateEndpointID) - delete(rawMsg, key) - case "virtualNetworkId": - err = unpopulate(val, "VirtualNetworkID", &e.VirtualNetworkID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ExportPolicyRule. func (e ExportPolicyRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2438,80 +1947,6 @@ func (r *RegionInfoAvailabilityZoneMappingsItem) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type RegionInfoResource. -func (r RegionInfoResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegionInfoResource. -func (r *RegionInfoResource) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &r.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type RegionInfosList. -func (r RegionInfosList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegionInfosList. -func (r *RegionInfosList) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &r.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type RelocateVolumeRequest. func (r RelocateVolumeRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2539,41 +1974,6 @@ func (r *RelocateVolumeRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type RemotePath. -func (r RemotePath) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "externalHostName", r.ExternalHostName) - populate(objectMap, "serverName", r.ServerName) - populate(objectMap, "volumeName", r.VolumeName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RemotePath. -func (r *RemotePath) 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", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "externalHostName": - err = unpopulate(val, "ExternalHostName", &r.ExternalHostName) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &r.ServerName) - delete(rawMsg, key) - case "volumeName": - err = unpopulate(val, "VolumeName", &r.VolumeName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type Replication. func (r Replication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2617,7 +2017,6 @@ func (r *Replication) UnmarshalJSON(data []byte) error { func (r ReplicationObject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "endpointType", r.EndpointType) - populate(objectMap, "remotePath", r.RemotePath) populate(objectMap, "remoteVolumeRegion", r.RemoteVolumeRegion) populate(objectMap, "remoteVolumeResourceId", r.RemoteVolumeResourceID) populate(objectMap, "replicationId", r.ReplicationID) @@ -2637,9 +2036,6 @@ func (r *ReplicationObject) UnmarshalJSON(data []byte) error { case "endpointType": err = unpopulate(val, "EndpointType", &r.EndpointType) delete(rawMsg, key) - case "remotePath": - err = unpopulate(val, "RemotePath", &r.RemotePath) - delete(rawMsg, key) case "remoteVolumeRegion": err = unpopulate(val, "RemoteVolumeRegion", &r.RemoteVolumeRegion) delete(rawMsg, key) @@ -3709,45 +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, "backupVaultId", v.BackupVaultID) - 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 "backupVaultId": - err = unpopulate(val, "BackupVaultID", &v.BackupVaultID) - 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) @@ -4216,7 +3573,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) } @@ -4230,9 +3586,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) @@ -4295,7 +3648,6 @@ func (v VolumeProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "exportPolicy", v.ExportPolicy) populate(objectMap, "fileAccessLogs", v.FileAccessLogs) populate(objectMap, "fileSystemId", v.FileSystemID) - populate(objectMap, "inheritedSizeInBytes", v.InheritedSizeInBytes) populate(objectMap, "isDefaultQuotaEnabled", v.IsDefaultQuotaEnabled) populate(objectMap, "isLargeVolume", v.IsLargeVolume) populate(objectMap, "isRestoring", v.IsRestoring) @@ -4404,9 +3756,6 @@ func (v *VolumeProperties) UnmarshalJSON(data []byte) error { case "fileSystemId": err = unpopulate(val, "FileSystemID", &v.FileSystemID) delete(rawMsg, key) - case "inheritedSizeInBytes": - err = unpopulate(val, "InheritedSizeInBytes", &v.InheritedSizeInBytes) - delete(rawMsg, key) case "isDefaultQuotaEnabled": err = unpopulate(val, "IsDefaultQuotaEnabled", &v.IsDefaultQuotaEnabled) delete(rawMsg, key) @@ -4517,7 +3866,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) @@ -4533,9 +3881,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 a5cba7712eec..28c78f56bc51 100644 --- a/sdk/resourcemanager/netapp/armnetapp/operations_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/operations_client.go @@ -39,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 2023-05-01-preview +// Generated from API version 2023-07-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]{ @@ -73,7 +73,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-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 b3be15b07774..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/operations_client_example_test.go +++ /dev/null @@ -1,1562 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/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 index 572f165061f6..1bc240ccd04c 100644 --- a/sdk/resourcemanager/netapp/armnetapp/options.go +++ b/sdk/resourcemanager/netapp/armnetapp/options.go @@ -8,24 +8,6 @@ package armnetapp -// 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 -} - -// AccountBackupsClientListByNetAppAccountOptions contains the optional parameters for the AccountBackupsClient.NewListByNetAppAccountPager -// method. -type AccountBackupsClientListByNetAppAccountOptions struct { - // An option to specify whether to return backups only from deleted volumes - IncludeOnlyBackupsFromDeletedVolumes *string -} - // AccountsClientBeginCreateOrUpdateOptions contains the optional parameters for the AccountsClient.BeginCreateOrUpdate method. type AccountsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. @@ -38,16 +20,6 @@ type AccountsClientBeginDeleteOptions struct { ResumeToken string } -// AccountsClientBeginMigrateEncryptionKeyOptions contains the optional parameters for the AccountsClient.BeginMigrateEncryptionKey -// method. -type AccountsClientBeginMigrateEncryptionKeyOptions struct { - // The required parameters to perform encryption migration. - Body *EncryptionMigrationRequest - - // Resumes the LRO from the provided token. - ResumeToken string -} - // AccountsClientBeginRenewCredentialsOptions contains the optional parameters for the AccountsClient.BeginRenewCredentials // method. type AccountsClientBeginRenewCredentialsOptions struct { @@ -105,97 +77,12 @@ type BackupPoliciesClientListOptions struct { // placeholder for future optional parameters } -// BackupVaultsClientBeginCreateOrUpdateOptions contains the optional parameters for the BackupVaultsClient.BeginCreateOrUpdate -// method. -type BackupVaultsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupVaultsClientBeginDeleteOptions contains the optional parameters for the BackupVaultsClient.BeginDelete method. -type BackupVaultsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupVaultsClientBeginUpdateOptions contains the optional parameters for the BackupVaultsClient.BeginUpdate method. -type BackupVaultsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupVaultsClientGetOptions contains the optional parameters for the BackupVaultsClient.Get method. -type BackupVaultsClientGetOptions struct { - // placeholder for future optional parameters -} - -// BackupVaultsClientListByNetAppAccountOptions contains the optional parameters for the BackupVaultsClient.NewListByNetAppAccountPager -// method. -type BackupVaultsClientListByNetAppAccountOptions struct { - // placeholder for future optional parameters -} - -// 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 -} - -// BackupsClientBeginUpdateOptions contains the optional parameters for the BackupsClient.BeginUpdate method. -type BackupsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupsClientGetLatestStatusOptions contains the optional parameters for the BackupsClient.GetLatestStatus method. -type BackupsClientGetLatestStatusOptions struct { - // placeholder for future optional parameters -} - -// BackupsClientGetOptions contains the optional parameters for the BackupsClient.Get method. -type BackupsClientGetOptions struct { - // placeholder for future optional parameters -} - // BackupsClientGetVolumeRestoreStatusOptions contains the optional parameters for the BackupsClient.GetVolumeRestoreStatus // method. type BackupsClientGetVolumeRestoreStatusOptions struct { // placeholder for future optional parameters } -// BackupsClientListByVaultOptions contains the optional parameters for the BackupsClient.NewListByVaultPager method. -type BackupsClientListByVaultOptions struct { - // An option to specify the VolumeResourceId. If present, then only returns the backups under the specified volume - Filter *string -} - -// BackupsUnderAccountClientBeginMigrateBackupsOptions contains the optional parameters for the BackupsUnderAccountClient.BeginMigrateBackups -// method. -type BackupsUnderAccountClientBeginMigrateBackupsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupsUnderBackupVaultClientBeginRestoreFilesOptions contains the optional parameters for the BackupsUnderBackupVaultClient.BeginRestoreFiles -// method. -type BackupsUnderBackupVaultClientBeginRestoreFilesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// BackupsUnderVolumeClientBeginMigrateBackupsOptions contains the optional parameters for the BackupsUnderVolumeClient.BeginMigrateBackups -// method. -type BackupsUnderVolumeClientBeginMigrateBackupsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters @@ -275,16 +162,6 @@ type ResourceQuotaLimitsClientListOptions struct { // placeholder for future optional parameters } -// ResourceRegionInfosClientGetOptions contains the optional parameters for the ResourceRegionInfosClient.Get method. -type ResourceRegionInfosClientGetOptions struct { - // placeholder for future optional parameters -} - -// ResourceRegionInfosClientListOptions contains the optional parameters for the ResourceRegionInfosClient.NewListPager method. -type ResourceRegionInfosClientListOptions 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. @@ -562,13 +439,6 @@ type VolumesClientBeginRevertRelocationOptions struct { ResumeToken string } -// VolumesClientBeginSplitCloneFromParentOptions contains the optional parameters for the VolumesClient.BeginSplitCloneFromParent -// method. -type VolumesClientBeginSplitCloneFromParentOptions 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. diff --git a/sdk/resourcemanager/netapp/armnetapp/pools_client.go b/sdk/resourcemanager/netapp/armnetapp/pools_client.go index 6caf17db48f4..e176cb4501b5 100644 --- a/sdk/resourcemanager/netapp/armnetapp/pools_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/pools_client.go @@ -46,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -74,7 +74,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *PoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, poolName string, body CapacityPool, options *PoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "PoolsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *PoolsClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -132,7 +132,7 @@ func (client *PoolsClient) createOrUpdateCreateRequest(ctx context.Context, reso // BeginDelete - Delete the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -158,7 +158,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *PoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, options *PoolsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PoolsClient.BeginDelete" @@ -204,15 +204,16 @@ func (client *PoolsClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get details of the specified capacity pool // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -263,7 +264,7 @@ func (client *PoolsClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +281,7 @@ func (client *PoolsClient) getHandleResponse(resp *http.Response) (PoolsClientGe // NewListPager - List all capacity pools in the NetApp Account // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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. @@ -327,7 +328,7 @@ func (client *PoolsClient) listCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +346,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 2023-05-01-preview +// Generated from API version 2023-07-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,7 +373,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *PoolsClient) update(ctx context.Context, resourceGroupName string, accountName string, poolName string, body CapacityPoolPatch, options *PoolsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "PoolsClient.BeginUpdate" @@ -418,7 +419,7 @@ func (client *PoolsClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 c7ae429fb8ff..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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 0a5d66948fb6..318f93a66fc1 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resource_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/resource_client.go @@ -46,7 +46,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 // - location - The name of the Azure region. // - body - File path availability request. // - options - ResourceClientCheckFilePathAvailabilityOptions contains the optional parameters for the ResourceClient.CheckFilePathAvailability @@ -89,7 +89,7 @@ func (client *ResourceClient) checkFilePathAvailabilityCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -110,7 +110,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 // - location - The name of the Azure region. // - body - Name availability request. // - options - ResourceClientCheckNameAvailabilityOptions contains the optional parameters for the ResourceClient.CheckNameAvailability @@ -153,7 +153,7 @@ func (client *ResourceClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -174,7 +174,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 // - location - The name of the Azure region. // - body - Quota availability request. // - options - ResourceClientCheckQuotaAvailabilityOptions contains the optional parameters for the ResourceClient.CheckQuotaAvailability @@ -217,7 +217,7 @@ func (client *ResourceClient) checkQuotaAvailabilityCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -238,7 +238,7 @@ func (client *ResourceClient) checkQuotaAvailabilityHandleResponse(resp *http.Re // 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-preview +// Generated from API version 2023-07-01 // - location - The name of the Azure region. // - body - Network sibling set to query. // - options - ResourceClientQueryNetworkSiblingSetOptions contains the optional parameters for the ResourceClient.QueryNetworkSiblingSet @@ -281,7 +281,7 @@ func (client *ResourceClient) queryNetworkSiblingSetCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -302,7 +302,7 @@ func (client *ResourceClient) queryNetworkSiblingSetHandleResponse(resp *http.Re // 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 2023-05-01-preview +// Generated from API version 2023-07-01 // - location - The name of the Azure region. // - options - ResourceClientQueryRegionInfoOptions contains the optional parameters for the ResourceClient.QueryRegionInfo // method. @@ -344,7 +344,7 @@ func (client *ResourceClient) queryRegionInfoCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -362,7 +362,7 @@ func (client *ResourceClient) queryRegionInfoHandleResponse(resp *http.Response) // 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-preview +// Generated from API version 2023-07-01 // - location - The name of the Azure region. // - body - Update for the specified network sibling set. // - options - ResourceClientBeginUpdateNetworkSiblingSetOptions contains the optional parameters for the ResourceClient.BeginUpdateNetworkSiblingSet @@ -388,7 +388,7 @@ func (client *ResourceClient) BeginUpdateNetworkSiblingSet(ctx context.Context, // 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-preview +// Generated from API version 2023-07-01 func (client *ResourceClient) updateNetworkSiblingSet(ctx context.Context, location string, body UpdateNetworkSiblingSetRequest, options *ResourceClientBeginUpdateNetworkSiblingSetOptions) (*http.Response, error) { var err error const operationName = "ResourceClient.BeginUpdateNetworkSiblingSet" @@ -426,7 +426,7 @@ func (client *ResourceClient) updateNetworkSiblingSetCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 2f561fe54a61..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/resource_client_example_test.go +++ /dev/null @@ -1,229 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Query.json -func ExampleResourceClient_QueryNetworkSiblingSet() { - 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().QueryNetworkSiblingSet(ctx, "eastus", armnetapp.QueryNetworkSiblingSetRequest{ - NetworkSiblingSetID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"), - SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"), - }, 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.NetworkSiblingSet = armnetapp.NetworkSiblingSet{ - // NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard), - // NetworkSiblingSetID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"), - // NetworkSiblingSetStateID: to.Ptr("12345_44420.8001578125"), - // NicInfoList: []*armnetapp.NicInfo{ - // { - // IPAddress: to.Ptr("1.2.3.4"), - // VolumeResourceIDs: []*string{ - // to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume10"), - // to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume11")}, - // }, - // { - // IPAddress: to.Ptr("1.2.3.5"), - // VolumeResourceIDs: []*string{ - // to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account2/capacityPools/pool2/volumes/volume20"), - // to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account2/capacityPools/pool2/volumes/volume21")}, - // }, - // { - // IPAddress: to.Ptr("1.2.3.9"), - // VolumeResourceIDs: []*string{ - // }, - // }}, - // ProvisioningState: to.Ptr(armnetapp.NetworkSiblingSetProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/NetworkSiblingSet_Update.json -func ExampleResourceClient_BeginUpdateNetworkSiblingSet() { - 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.NewResourceClient().BeginUpdateNetworkSiblingSet(ctx, "eastus", armnetapp.UpdateNetworkSiblingSetRequest{ - NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard), - NetworkSiblingSetID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"), - NetworkSiblingSetStateID: to.Ptr("12345_44420.8001578125"), - SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"), - }, 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.NetworkSiblingSet = armnetapp.NetworkSiblingSet{ - // NetworkFeatures: to.Ptr(armnetapp.NetworkFeaturesStandard), - // NetworkSiblingSetID: to.Ptr("9760acf5-4638-11e7-9bdb-020073ca3333"), - // NetworkSiblingSetStateID: to.Ptr("12345_44420.8001578125"), - // NicInfoList: []*armnetapp.NicInfo{ - // { - // IPAddress: to.Ptr("1.2.3.4"), - // VolumeResourceIDs: []*string{ - // to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume10"), - // to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume11")}, - // }, - // { - // IPAddress: to.Ptr("1.2.3.5"), - // VolumeResourceIDs: []*string{ - // to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account2/capacityPools/pool2/volumes/volume20"), - // to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account2/capacityPools/pool2/volumes/volume21")}, - // }, - // { - // IPAddress: to.Ptr("1.2.3.9"), - // VolumeResourceIDs: []*string{ - // }, - // }}, - // ProvisioningState: to.Ptr(armnetapp.NetworkSiblingSetProvisioningStateSucceeded), - // SubnetID: to.Ptr("/subscriptions/9760acf5-4638-11e7-9bdb-020073ca7778/resourceGroups/myRP/providers/Microsoft.Network/virtualNetworks/testVnet/subnets/testSubnet"), - // } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go index 5a464a31a12a..781e7ad2cdda 100644 --- a/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/resourcequotalimits_client.go @@ -46,7 +46,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 // - location - The name of the Azure region. // - quotaLimitName - The name of the Quota Limit // - options - ResourceQuotaLimitsClientGetOptions contains the optional parameters for the ResourceQuotaLimitsClient.Get method. @@ -92,7 +92,7 @@ func (client *ResourceQuotaLimitsClient) getCreateRequest(ctx context.Context, l return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *ResourceQuotaLimitsClient) getHandleResponse(resp *http.Response) // NewListPager - Get the default and current limits for quotas // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-01 // - location - The name of the Azure region. // - options - ResourceQuotaLimitsClientListOptions contains the optional parameters for the ResourceQuotaLimitsClient.NewListPager // method. @@ -153,7 +153,7 @@ func (client *ResourceQuotaLimitsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-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 b94a481b6474..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/resourceregioninfos_client.go b/sdk/resourcemanager/netapp/armnetapp/resourceregioninfos_client.go deleted file mode 100644 index aacce94e36a7..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/resourceregioninfos_client.go +++ /dev/null @@ -1,163 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -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" -) - -// ResourceRegionInfosClient contains the methods for the NetAppResourceRegionInfos group. -// Don't use this type directly, use NewResourceRegionInfosClient() instead. -type ResourceRegionInfosClient struct { - internal *arm.Client - subscriptionID string -} - -// NewResourceRegionInfosClient creates a new instance of ResourceRegionInfosClient with the specified values. -// - subscriptionID - The ID of the target subscription. The value must be an UUID. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewResourceRegionInfosClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceRegionInfosClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ResourceRegionInfosClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Provides storage to network proximity and logical zone mapping information. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - location - The name of the Azure region. -// - options - ResourceRegionInfosClientGetOptions contains the optional parameters for the ResourceRegionInfosClient.Get method. -func (client *ResourceRegionInfosClient) Get(ctx context.Context, location string, options *ResourceRegionInfosClientGetOptions) (ResourceRegionInfosClientGetResponse, error) { - var err error - const operationName = "ResourceRegionInfosClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, location, options) - if err != nil { - return ResourceRegionInfosClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ResourceRegionInfosClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return ResourceRegionInfosClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *ResourceRegionInfosClient) getCreateRequest(ctx context.Context, location string, options *ResourceRegionInfosClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfos/default" - 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ResourceRegionInfosClient) getHandleResponse(resp *http.Response) (ResourceRegionInfosClientGetResponse, error) { - result := ResourceRegionInfosClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RegionInfoResource); err != nil { - return ResourceRegionInfosClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Provides region specific information. -// -// Generated from API version 2023-05-01-preview -// - location - The name of the Azure region. -// - options - ResourceRegionInfosClientListOptions contains the optional parameters for the ResourceRegionInfosClient.NewListPager -// method. -func (client *ResourceRegionInfosClient) NewListPager(location string, options *ResourceRegionInfosClientListOptions) *runtime.Pager[ResourceRegionInfosClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ResourceRegionInfosClientListResponse]{ - More: func(page ResourceRegionInfosClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ResourceRegionInfosClientListResponse) (ResourceRegionInfosClientListResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "ResourceRegionInfosClient.NewListPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, location, options) - }, nil) - if err != nil { - return ResourceRegionInfosClientListResponse{}, err - } - return client.listHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listCreateRequest creates the List request. -func (client *ResourceRegionInfosClient) listCreateRequest(ctx context.Context, location string, options *ResourceRegionInfosClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfos" - 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ResourceRegionInfosClient) listHandleResponse(resp *http.Response) (ResourceRegionInfosClientListResponse, error) { - result := ResourceRegionInfosClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.RegionInfosList); err != nil { - return ResourceRegionInfosClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/netapp/armnetapp/resourceregioninfos_client_example_test.go b/sdk/resourcemanager/netapp/armnetapp/resourceregioninfos_client_example_test.go deleted file mode 100644 index a38faca41108..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/resourceregioninfos_client_example_test.go +++ /dev/null @@ -1,108 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_List.json -func ExampleResourceRegionInfosClient_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.NewResourceRegionInfosClient().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.RegionInfosList = armnetapp.RegionInfosList{ - // Value: []*armnetapp.RegionInfoResource{ - // { - // Name: to.Ptr("eastus/default"), - // Type: to.Ptr("Microsoft.NetApp/locations/regionInfos"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/regionInfos/default"), - // Properties: &armnetapp.RegionInfo{ - // AvailabilityZoneMappings: []*armnetapp.RegionInfoAvailabilityZoneMappingsItem{ - // { - // AvailabilityZone: to.Ptr("1"), - // IsAvailable: to.Ptr(true), - // }, - // { - // AvailabilityZone: to.Ptr("2"), - // IsAvailable: to.Ptr(true), - // }, - // { - // AvailabilityZone: to.Ptr("3"), - // IsAvailable: to.Ptr(true), - // }}, - // StorageToNetworkProximity: to.Ptr(armnetapp.RegionStorageToNetworkProximityT2), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/RegionInfos_Get.json -func ExampleResourceRegionInfosClient_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.NewResourceRegionInfosClient().Get(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.RegionInfoResource = armnetapp.RegionInfoResource{ - // Name: to.Ptr("eastus/default"), - // Type: to.Ptr("Microsoft.NetApp/locations/regionInfos"), - // ID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/regionInfos/default"), - // Properties: &armnetapp.RegionInfo{ - // AvailabilityZoneMappings: []*armnetapp.RegionInfoAvailabilityZoneMappingsItem{ - // { - // AvailabilityZone: to.Ptr("1"), - // IsAvailable: to.Ptr(true), - // }, - // { - // AvailabilityZone: to.Ptr("2"), - // IsAvailable: to.Ptr(true), - // }, - // { - // AvailabilityZone: to.Ptr("3"), - // IsAvailable: to.Ptr(true), - // }}, - // StorageToNetworkProximity: to.Ptr(armnetapp.RegionStorageToNetworkProximityT2), - // }, - // } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/response_types.go b/sdk/resourcemanager/netapp/armnetapp/response_types.go index e443dc0fd583..c9c840a001e6 100644 --- a/sdk/resourcemanager/netapp/armnetapp/response_types.go +++ b/sdk/resourcemanager/netapp/armnetapp/response_types.go @@ -8,23 +8,6 @@ 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 under a Backup Vault - Backup -} - -// AccountBackupsClientListByNetAppAccountResponse contains the response from method AccountBackupsClient.NewListByNetAppAccountPager. -type AccountBackupsClientListByNetAppAccountResponse struct { - // List of Backups - BackupsList -} - // AccountsClientCreateOrUpdateResponse contains the response from method AccountsClient.BeginCreateOrUpdate. type AccountsClientCreateOrUpdateResponse struct { // NetApp account resource @@ -54,11 +37,6 @@ type AccountsClientListResponse struct { AccountList } -// AccountsClientMigrateEncryptionKeyResponse contains the response from method AccountsClient.BeginMigrateEncryptionKey. -type AccountsClientMigrateEncryptionKeyResponse struct { - // placeholder for future response values -} - // AccountsClientRenewCredentialsResponse contains the response from method AccountsClient.BeginRenewCredentials. type AccountsClientRenewCredentialsResponse struct { // placeholder for future response values @@ -99,91 +77,12 @@ type BackupPoliciesClientUpdateResponse struct { BackupPolicy } -// BackupVaultsClientCreateOrUpdateResponse contains the response from method BackupVaultsClient.BeginCreateOrUpdate. -type BackupVaultsClientCreateOrUpdateResponse struct { - // Backup Vault information - BackupVault -} - -// BackupVaultsClientDeleteResponse contains the response from method BackupVaultsClient.BeginDelete. -type BackupVaultsClientDeleteResponse struct { - // placeholder for future response values -} - -// BackupVaultsClientGetResponse contains the response from method BackupVaultsClient.Get. -type BackupVaultsClientGetResponse struct { - // Backup Vault information - BackupVault -} - -// BackupVaultsClientListByNetAppAccountResponse contains the response from method BackupVaultsClient.NewListByNetAppAccountPager. -type BackupVaultsClientListByNetAppAccountResponse struct { - // List of Backup Vaults - BackupVaultsList -} - -// BackupVaultsClientUpdateResponse contains the response from method BackupVaultsClient.BeginUpdate. -type BackupVaultsClientUpdateResponse struct { - // Backup Vault information - BackupVault -} - -// BackupsClientCreateResponse contains the response from method BackupsClient.BeginCreate. -type BackupsClientCreateResponse struct { - // Backup under a Backup Vault - Backup -} - -// BackupsClientDeleteResponse contains the response from method BackupsClient.BeginDelete. -type BackupsClientDeleteResponse struct { - // placeholder for future response values -} - -// BackupsClientGetLatestStatusResponse contains the response from method BackupsClient.GetLatestStatus. -type BackupsClientGetLatestStatusResponse struct { - // Backup status - BackupStatus -} - -// BackupsClientGetResponse contains the response from method BackupsClient.Get. -type BackupsClientGetResponse struct { - // Backup under a Backup Vault - Backup -} - // BackupsClientGetVolumeRestoreStatusResponse contains the response from method BackupsClient.GetVolumeRestoreStatus. type BackupsClientGetVolumeRestoreStatusResponse struct { // Restore status RestoreStatus } -// BackupsClientListByVaultResponse contains the response from method BackupsClient.NewListByVaultPager. -type BackupsClientListByVaultResponse struct { - // List of Backups - BackupsList -} - -// BackupsClientUpdateResponse contains the response from method BackupsClient.BeginUpdate. -type BackupsClientUpdateResponse struct { - // Backup under a Backup Vault - Backup -} - -// BackupsUnderAccountClientMigrateBackupsResponse contains the response from method BackupsUnderAccountClient.BeginMigrateBackups. -type BackupsUnderAccountClientMigrateBackupsResponse struct { - // placeholder for future response values -} - -// BackupsUnderBackupVaultClientRestoreFilesResponse contains the response from method BackupsUnderBackupVaultClient.BeginRestoreFiles. -type BackupsUnderBackupVaultClientRestoreFilesResponse struct { - // placeholder for future response values -} - -// BackupsUnderVolumeClientMigrateBackupsResponse contains the response from method BackupsUnderVolumeClient.BeginMigrateBackups. -type BackupsUnderVolumeClientMigrateBackupsResponse struct { - // placeholder for future response values -} - // 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 @@ -268,18 +167,6 @@ type ResourceQuotaLimitsClientListResponse struct { SubscriptionQuotaItemList } -// ResourceRegionInfosClientGetResponse contains the response from method ResourceRegionInfosClient.Get. -type ResourceRegionInfosClientGetResponse struct { - // Information regarding regionInfo Item. - RegionInfoResource -} - -// ResourceRegionInfosClientListResponse contains the response from method ResourceRegionInfosClient.NewListPager. -type ResourceRegionInfosClientListResponse struct { - // List of regionInfo resources - RegionInfosList -} - // SnapshotPoliciesClientCreateResponse contains the response from method SnapshotPoliciesClient.Create. type SnapshotPoliciesClientCreateResponse struct { // Snapshot policy information @@ -548,11 +435,6 @@ type VolumesClientRevertResponse struct { // placeholder for future response values } -// VolumesClientSplitCloneFromParentResponse contains the response from method VolumesClient.BeginSplitCloneFromParent. -type VolumesClientSplitCloneFromParentResponse struct { - // placeholder for future response values -} - // VolumesClientUpdateResponse contains the response from method VolumesClient.BeginUpdate. type VolumesClientUpdateResponse struct { // Volume resource diff --git a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go index c06f298bb1f9..47537ceac433 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshotpolicies_client.go @@ -46,7 +46,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -98,7 +98,7 @@ func (client *SnapshotPoliciesClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -119,7 +119,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -146,7 +146,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *SnapshotPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, options *SnapshotPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SnapshotPoliciesClient.BeginDelete" @@ -192,15 +192,16 @@ func (client *SnapshotPoliciesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get a snapshot Policy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -251,7 +252,7 @@ func (client *SnapshotPoliciesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +269,7 @@ func (client *SnapshotPoliciesClient) getHandleResponse(resp *http.Response) (Sn // NewListPager - List snapshot policy // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -317,7 +318,7 @@ func (client *SnapshotPoliciesClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,7 +336,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -387,7 +388,7 @@ func (client *SnapshotPoliciesClient) listVolumesCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -405,7 +406,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -433,7 +434,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *SnapshotPoliciesClient) update(ctx context.Context, resourceGroupName string, accountName string, snapshotPolicyName string, body SnapshotPolicyPatch, options *SnapshotPoliciesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "SnapshotPoliciesClient.BeginUpdate" @@ -479,7 +480,7 @@ func (client *SnapshotPoliciesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 0fc7f3f31dab..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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 ba5e46b24b93..81cc3a3d4249 100644 --- a/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/snapshots_client.go @@ -46,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -75,7 +75,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "SnapshotsClient.BeginCreate" @@ -129,7 +129,7 @@ func (client *SnapshotsClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -141,7 +141,7 @@ func (client *SnapshotsClient) createCreateRequest(ctx context.Context, resource // BeginDelete - Delete snapshot // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -169,7 +169,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "SnapshotsClient.BeginDelete" @@ -223,15 +223,16 @@ func (client *SnapshotsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get details of the specified snapshot // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -292,7 +293,7 @@ func (client *SnapshotsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -309,7 +310,7 @@ func (client *SnapshotsClient) getHandleResponse(resp *http.Response) (Snapshots // NewListPager - List all snapshots associated with the volume // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -367,7 +368,7 @@ func (client *SnapshotsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +386,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -415,7 +416,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "SnapshotsClient.BeginRestoreFiles" @@ -469,8 +470,9 @@ func (client *SnapshotsClient) restoreFilesCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-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 } @@ -480,7 +482,7 @@ func (client *SnapshotsClient) restoreFilesCreateRequest(ctx context.Context, re // BeginUpdate - Patch a snapshot // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -509,7 +511,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "SnapshotsClient.BeginUpdate" @@ -563,7 +565,7 @@ func (client *SnapshotsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 77cfc41b3679..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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:33.000Z"); 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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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:33.000Z"); 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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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:33.000Z"); 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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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 cec20fc66edc..27e1555465f9 100644 --- a/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/subvolumes_client.go @@ -46,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -75,7 +75,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "SubvolumesClient.BeginCreate" @@ -129,7 +129,7 @@ func (client *SubvolumesClient) createCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -141,7 +141,7 @@ func (client *SubvolumesClient) createCreateRequest(ctx context.Context, resourc // BeginDelete - Delete subvolume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -169,7 +169,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "SubvolumesClient.BeginDelete" @@ -223,15 +223,16 @@ func (client *SubvolumesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Returns the path associated with the subvolumeName provided // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -292,7 +293,7 @@ func (client *SubvolumesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -310,7 +311,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 2023-05-01-preview +// Generated from API version 2023-07-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 +340,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "SubvolumesClient.BeginGetMetadata" @@ -393,7 +394,7 @@ func (client *SubvolumesClient) getMetadataCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -401,7 +402,7 @@ func (client *SubvolumesClient) getMetadataCreateRequest(ctx context.Context, re // NewListByVolumePager - Returns a list of the subvolumes in the volume // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -459,7 +460,7 @@ func (client *SubvolumesClient) listByVolumeCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -477,7 +478,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -506,7 +507,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "SubvolumesClient.BeginUpdate" @@ -560,7 +561,7 @@ func (client *SubvolumesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 b0eed9f995e1..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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:33.000Z"); return t}()), - // BytesUsed: to.Ptr[int64](5), - // ChangedTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()), - // CreationTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()), - // ModifiedTimeStamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T13:23:33.000Z"); return t}()), - // Permissions: to.Ptr("777"), - // Size: to.Ptr[int64](5), - // }, - // } -} diff --git a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go index 5d82d141b5d6..72057cdd02f6 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumegroups_client.go @@ -46,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -73,7 +73,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumeGroupsClient) create(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string, body VolumeGroupDetails, options *VolumeGroupsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "VolumeGroupsClient.BeginCreate" @@ -119,7 +119,7 @@ func (client *VolumeGroupsClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -131,7 +131,7 @@ func (client *VolumeGroupsClient) createCreateRequest(ctx context.Context, resou // 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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -157,7 +157,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumeGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, volumeGroupName string, options *VolumeGroupsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VolumeGroupsClient.BeginDelete" @@ -203,15 +203,16 @@ func (client *VolumeGroupsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get details of the specified volume group // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -262,7 +263,7 @@ func (client *VolumeGroupsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -279,7 +280,7 @@ func (client *VolumeGroupsClient) getHandleResponse(resp *http.Response) (Volume // NewListByNetAppAccountPager - List all volume groups for given account // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -328,7 +329,7 @@ func (client *VolumeGroupsClient) listByNetAppAccountCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-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 e4c49c180034..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/volumegroups_client_example_test.go +++ /dev/null @@ -1,1474 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_List_Oracle.json -func ExampleVolumeGroupsClient_NewListByNetAppAccountPager_volumeGroupsListOracle() { - 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.ApplicationTypeORACLE), - // GroupDescription: to.Ptr("Volume group"), - // VolumesCount: to.Ptr[int64](12), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_List_SapHana.json -func ExampleVolumeGroupsClient_NewListByNetAppAccountPager_volumeGroupsListSapHana() { - 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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Get_Oracle.json -func ExampleVolumeGroupsClient_Get_volumeGroupsGetOracle() { - 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("OR2"), - // ApplicationType: to.Ptr(armnetapp.ApplicationTypeORACLE), - // GroupDescription: to.Ptr("Volume group"), - // VolumesCount: to.Ptr[int64](12), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Volumes: []*armnetapp.VolumeGroupVolumeProperties{ - // { - // Name: to.Ptr("account1/pool1/test-ora-data1"), - // 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-ora-data1"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-data1"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-data1"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-data2"), - // 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-ora-data2"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-data2"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-data2"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-data3"), - // 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-ora-data3"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-data3"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-data3"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-data4"), - // 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-ora-data4"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-data4"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-data4"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-data5"), - // 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-ora-data5"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-data5"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-data5"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-data6"), - // 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-ora-data6"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-data6"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-data6"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-data7"), - // 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-ora-data7"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-data7"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-data7"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-data8"), - // 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-ora-data8"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-data8"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-data8"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-log"), - // 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-ora-log"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-log"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-log"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-log-mirror"), - // 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-ora-log-mirror"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-log-mirror"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-log-mirror"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-binary"), - // 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-ora-binary"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-binary"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-binary"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("account1/pool1/test-ora-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-ora-backup"), - // Properties: &armnetapp.VolumeProperties{ - // CreationToken: to.Ptr("test-ora-backup"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // ProvisioningState: to.Ptr("Succeeded"), - // 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("ora-backup"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Get_SapHana.json -func ExampleVolumeGroupsClient_Get_volumeGroupsGetSapHana() { - 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("SH9"), - // 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"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // 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"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // 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"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // 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-data-backup"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // 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-log-backup"), - // ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - // Rules: []*armnetapp.ExportPolicyRule{ - // { - // AllowedClients: to.Ptr("0.0.0.0/0"), - // Cifs: to.Ptr(false), - // HasRootAccess: to.Ptr(true), - // Kerberos5ReadOnly: to.Ptr(false), - // Kerberos5ReadWrite: to.Ptr(false), - // Kerberos5IReadOnly: to.Ptr(false), - // Kerberos5IReadWrite: to.Ptr(false), - // Kerberos5PReadOnly: to.Ptr(false), - // Kerberos5PReadWrite: to.Ptr(false), - // Nfsv3: to.Ptr(false), - // Nfsv41: to.Ptr(true), - // RuleIndex: to.Ptr[int32](1), - // UnixReadOnly: to.Ptr(true), - // UnixReadWrite: to.Ptr(true), - // }}, - // }, - // ProtocolTypes: []*string{ - // to.Ptr("NFSv4.1")}, - // 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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Create_Oracle.json -func ExampleVolumeGroupsClient_BeginCreate_volumeGroupsCreateOracle() { - 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("OR2"), - ApplicationType: to.Ptr(armnetapp.ApplicationTypeORACLE), - GroupDescription: to.Ptr("Volume group"), - }, - Volumes: []*armnetapp.VolumeGroupVolumeProperties{ - { - Name: to.Ptr("test-ora-data1"), - 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-ora-data1"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-data1"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-data2"), - 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-ora-data2"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-data2"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-data3"), - 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-ora-data3"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-data3"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-data4"), - 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-ora-data4"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-data4"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-data5"), - 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-ora-data5"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-data5"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-data6"), - 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-ora-data6"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-data6"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-data7"), - 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-ora-data7"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-data7"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-data8"), - 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-ora-data8"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-data8"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-log"), - 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-ora-log"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-log"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-log-mirror"), - 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-ora-log-mirror"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-log-mirror"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-binary"), - 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-ora-binary"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-binary"), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - { - Name: to.Ptr("test-ora-backup"), - 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-ora-backup"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("ora-backup"), - }, - Zones: []*string{ - to.Ptr("1")}, - }}, - }, - }, 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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/VolumeGroups_Create_SapHana.json -func ExampleVolumeGroupsClient_BeginCreate_volumeGroupsCreateSapHana() { - 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("SH9"), - ApplicationType: to.Ptr(armnetapp.ApplicationTypeSAPHANA), - 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"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("test-data-backup"), - 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-backup"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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("test-log-backup"), - 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-backup"), - ExportPolicy: &armnetapp.VolumePropertiesExportPolicy{ - Rules: []*armnetapp.ExportPolicyRule{ - { - AllowedClients: to.Ptr("0.0.0.0/0"), - Cifs: to.Ptr(false), - HasRootAccess: to.Ptr(true), - Kerberos5ReadOnly: to.Ptr(false), - Kerberos5ReadWrite: to.Ptr(false), - Kerberos5IReadOnly: to.Ptr(false), - Kerberos5IReadWrite: to.Ptr(false), - Kerberos5PReadOnly: to.Ptr(false), - Kerberos5PReadWrite: to.Ptr(false), - Nfsv3: to.Ptr(false), - Nfsv41: to.Ptr(true), - RuleIndex: to.Ptr[int32](1), - UnixReadOnly: to.Ptr(true), - UnixReadWrite: to.Ptr(true), - }}, - }, - ProtocolTypes: []*string{ - to.Ptr("NFSv4.1")}, - 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"), - }, - }}, - }, - }, 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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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 405976bcbafe..522994975558 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumequotarules_client.go @@ -46,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -76,7 +76,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "VolumeQuotaRulesClient.BeginCreate" @@ -130,7 +130,7 @@ func (client *VolumeQuotaRulesClient) createCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -142,7 +142,7 @@ func (client *VolumeQuotaRulesClient) createCreateRequest(ctx context.Context, r // BeginDelete - Delete quota rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -171,7 +171,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "VolumeQuotaRulesClient.BeginDelete" @@ -225,15 +225,16 @@ func (client *VolumeQuotaRulesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get details of the specified quota rule // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -294,7 +295,7 @@ func (client *VolumeQuotaRulesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -311,7 +312,7 @@ func (client *VolumeQuotaRulesClient) getHandleResponse(resp *http.Response) (Vo // NewListByVolumePager - List all quota rules associated with the volume // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -370,7 +371,7 @@ func (client *VolumeQuotaRulesClient) listByVolumeCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,7 +389,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -418,7 +419,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "VolumeQuotaRulesClient.BeginUpdate" @@ -472,7 +473,7 @@ func (client *VolumeQuotaRulesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 49f2efe86b03..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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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 5aed2a6a1e15..e544fbc40c98 100644 --- a/sdk/resourcemanager/netapp/armnetapp/volumes_client.go +++ b/sdk/resourcemanager/netapp/armnetapp/volumes_client.go @@ -47,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -76,7 +76,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "VolumesClient.BeginAuthorizeReplication" @@ -126,8 +126,9 @@ func (client *VolumesClient) authorizeReplicationCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-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 } @@ -137,7 +138,7 @@ func (client *VolumesClient) authorizeReplicationCreateRequest(ctx context.Conte // BeginBreakFileLocks - Break all the file locks on a volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -165,7 +166,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) breakFileLocks(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginBreakFileLocksOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginBreakFileLocks" @@ -215,8 +216,9 @@ func (client *VolumesClient) breakFileLocksCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { return nil, err @@ -229,7 +231,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -257,7 +259,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) breakReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginBreakReplicationOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginBreakReplication" @@ -307,8 +309,9 @@ func (client *VolumesClient) breakReplicationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { return nil, err @@ -321,7 +324,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -350,7 +353,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "VolumesClient.BeginCreateOrUpdate" @@ -400,7 +403,7 @@ func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -412,7 +415,7 @@ func (client *VolumesClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Delete the specified volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -439,7 +442,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginDelete" @@ -492,15 +495,16 @@ 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", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2023-05-01-preview +// Generated from API version 2023-07-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 +532,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) deleteReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginDeleteReplicationOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginDeleteReplication" @@ -578,15 +582,16 @@ func (client *VolumesClient) deleteReplicationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -613,7 +618,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) finalizeRelocation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginFinalizeRelocationOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginFinalizeRelocation" @@ -663,15 +668,16 @@ func (client *VolumesClient) finalizeRelocationCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Get the details of the specified volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -727,7 +733,7 @@ func (client *VolumesClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -744,7 +750,7 @@ func (client *VolumesClient) getHandleResponse(resp *http.Response) (VolumesClie // NewListPager - List all volumes within the capacity pool // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -796,7 +802,7 @@ func (client *VolumesClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -814,7 +820,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -843,7 +849,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "VolumesClient.BeginListGetGroupIDListForLdapUser" @@ -893,7 +899,7 @@ func (client *VolumesClient) listGetGroupIDListForLdapUserCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -904,7 +910,7 @@ func (client *VolumesClient) listGetGroupIDListForLdapUserCreateRequest(ctx cont // NewListReplicationsPager - List all replications for a specified volume // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -963,7 +969,7 @@ func (client *VolumesClient) listReplicationsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -981,7 +987,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -1009,7 +1015,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "VolumesClient.BeginPoolChange" @@ -1059,8 +1065,9 @@ func (client *VolumesClient) poolChangeCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-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 } @@ -1070,7 +1077,7 @@ func (client *VolumesClient) poolChangeCreateRequest(ctx context.Context, resour // BeginPopulateAvailabilityZone - 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-preview +// Generated from API version 2023-07-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 @@ -1098,7 +1105,7 @@ func (client *VolumesClient) BeginPopulateAvailabilityZone(ctx context.Context, // 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-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) populateAvailabilityZone(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginPopulateAvailabilityZoneOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginPopulateAvailabilityZone" @@ -1148,7 +1155,7 @@ func (client *VolumesClient) populateAvailabilityZoneCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1157,7 +1164,7 @@ func (client *VolumesClient) populateAvailabilityZoneCreateRequest(ctx context.C // BeginReInitializeReplication - Re-Initializes the replication connection on the destination volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -1185,7 +1192,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) reInitializeReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginReInitializeReplicationOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginReInitializeReplication" @@ -1235,8 +1242,9 @@ func (client *VolumesClient) reInitializeReplicationCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1244,7 +1252,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -1274,7 +1282,7 @@ func (client *VolumesClient) BeginReestablishReplication(ctx context.Context, re // snapshots // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "VolumesClient.BeginReestablishReplication" @@ -1324,8 +1332,9 @@ func (client *VolumesClient) reestablishReplicationCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-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 } @@ -1335,7 +1344,7 @@ func (client *VolumesClient) reestablishReplicationCreateRequest(ctx context.Con // BeginRelocate - Relocates volume to a new stamp // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -1361,7 +1370,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) relocate(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginRelocateOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginRelocate" @@ -1411,8 +1420,9 @@ func (client *VolumesClient) relocateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { return nil, err @@ -1425,7 +1435,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -1482,7 +1492,7 @@ func (client *VolumesClient) replicationStatusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1500,7 +1510,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -1527,7 +1537,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) resetCifsPassword(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginResetCifsPasswordOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginResetCifsPassword" @@ -1577,8 +1587,9 @@ func (client *VolumesClient) resetCifsPasswordCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -1586,7 +1597,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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -1615,7 +1626,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) resyncReplication(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginResyncReplicationOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginResyncReplication" @@ -1665,15 +1676,16 @@ func (client *VolumesClient) resyncReplicationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // 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 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -1701,7 +1713,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "VolumesClient.BeginRevert" @@ -1751,8 +1763,9 @@ func (client *VolumesClient) revertCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-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 } @@ -1763,7 +1776,7 @@ func (client *VolumesClient) revertCreateRequest(ctx context.Context, resourceGr // volume. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -1791,7 +1804,7 @@ func (client *VolumesClient) BeginRevertRelocation(ctx context.Context, resource // volume. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-01 func (client *VolumesClient) revertRelocation(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginRevertRelocationOptions) (*http.Response, error) { var err error const operationName = "VolumesClient.BeginRevertRelocation" @@ -1841,93 +1854,7 @@ func (client *VolumesClient) revertRelocationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// BeginSplitCloneFromParent - Split operation to convert clone volume to an independent volume. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -// - 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 - VolumesClientBeginSplitCloneFromParentOptions contains the optional parameters for the VolumesClient.BeginSplitCloneFromParent -// method. -func (client *VolumesClient) BeginSplitCloneFromParent(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginSplitCloneFromParentOptions) (*runtime.Poller[VolumesClientSplitCloneFromParentResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.splitCloneFromParent(ctx, resourceGroupName, accountName, poolName, volumeName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[VolumesClientSplitCloneFromParentResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[VolumesClientSplitCloneFromParentResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// SplitCloneFromParent - Split operation to convert clone volume to an independent volume. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-05-01-preview -func (client *VolumesClient) splitCloneFromParent(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginSplitCloneFromParentOptions) (*http.Response, error) { - var err error - const operationName = "VolumesClient.BeginSplitCloneFromParent" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.splitCloneFromParentCreateRequest(ctx, resourceGroupName, accountName, poolName, volumeName, 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.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// splitCloneFromParentCreateRequest creates the SplitCloneFromParent request. -func (client *VolumesClient) splitCloneFromParentCreateRequest(ctx context.Context, resourceGroupName string, accountName string, poolName string, volumeName string, options *VolumesClientBeginSplitCloneFromParentOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/splitCloneFromParent" - 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-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1936,7 +1863,7 @@ func (client *VolumesClient) splitCloneFromParentCreateRequest(ctx context.Conte // BeginUpdate - Patch the specified volume // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01-preview +// Generated from API version 2023-07-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 @@ -1964,7 +1891,7 @@ 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 2023-05-01-preview +// Generated from API version 2023-07-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 const operationName = "VolumesClient.BeginUpdate" @@ -2014,7 +1941,7 @@ func (client *VolumesClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01-preview") + reqQP.Set("api-version", "2023-07-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != 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 e85b9c743e3a..000000000000 --- a/sdk/resourcemanager/netapp/armnetapp/volumes_client_example_test.go +++ /dev/null @@ -1,682 +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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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{ - // ActualThroughputMibps: to.Ptr[float32](128), - // 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](0), - // UsageThreshold: to.Ptr[int64](107374182400), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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{ - // ActualThroughputMibps: to.Ptr[float32](128), - // 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](0), - // UsageThreshold: to.Ptr[int64](107374182400), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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"), - EncryptionKeySource: to.Ptr(armnetapp.EncryptionKeySourceMicrosoftKeyVault), - 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), - }, - }, 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.EncryptionKeySourceMicrosoftKeyVault), - // 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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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{ - Location: to.Ptr("eastus"), - Properties: &armnetapp.VolumePatchProperties{ - DataProtection: &armnetapp.VolumePatchPropertiesDataProtection{ - Backup: &armnetapp.VolumeBackupProperties{ - BackupEnabled: to.Ptr(true), - BackupVaultID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRP/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"), - PolicyEnforced: to.Ptr(false), - }, - }, - }, - }, 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{ - // ActualThroughputMibps: to.Ptr[float32](128), - // CreationToken: to.Ptr("some-amazing-filepath"), - // DataProtection: &armnetapp.VolumePropertiesDataProtection{ - // Backup: &armnetapp.VolumeBackupProperties{ - // BackupEnabled: to.Ptr(true), - // BackupVaultID: to.Ptr("/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRP/providers/Microsoft.NetApp/netAppAccounts/account1/backupVaults/backupVault1"), - // PolicyEnforced: to.Ptr(false), - // }, - // 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](0), - // UsageThreshold: to.Ptr[int64](107374182400), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_PopulateAvailabilityZones.json -func ExampleVolumesClient_BeginPopulateAvailabilityZone() { - 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().BeginPopulateAvailabilityZone(ctx, "myRG", "account1", "pool1", "volume1", 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"), - // 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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/examples/Volumes_SplitClone.json -func ExampleVolumesClient_BeginSplitCloneFromParent() { - 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().BeginSplitCloneFromParent(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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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/639ecfad68419328658bd4cfe7094af4ce472be2/specification/netapp/resource-manager/Microsoft.NetApp/preview/2023-05-01-preview/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) - } -}