From b6a04cef4befcb4fb8e08cbd4e233c51ed8dfb18 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 26 Dec 2024 07:29:39 +0000 Subject: [PATCH] CodeGen from PR 31959 in Azure/azure-rest-api-specs Merge 12a7fb8e8b1411718ad6325db3c6cbc4bf0b597e into 64f6997950d8bee63f314563cedaa20148db2186 --- .../armrecoveryservicesbackup/CHANGELOG.md | 7 + .../armrecoveryservicesbackup/autorest.md | 7 +- .../backupengines_client.go | 8 +- .../backupengines_client_example_test.go | 136 -- .../backupjobs_client.go | 4 +- .../backupjobs_client_example_test.go | 191 --- .../backupoperationresults_client.go | 4 +- ...kupoperationresults_client_example_test.go | 35 - .../backupoperationstatuses_client.go | 4 +- ...upoperationstatuses_client_example_test.go | 45 - .../backuppolicies_client.go | 4 +- .../backuppolicies_client_example_test.go | 292 ---- .../backupprotectableitems_client.go | 4 +- ...kupprotectableitems_client_example_test.go | 62 - .../backupprotecteditems_client.go | 4 +- ...ackupprotecteditems_client_example_test.go | 71 - .../backupprotectioncontainers_client.go | 4 +- ...rotectioncontainers_client_example_test.go | 61 - .../backupprotectionintent_client.go | 4 +- ...kupprotectionintent_client_example_test.go | 59 - .../backupresourceencryptionconfigs_client.go | 8 +- ...ceencryptionconfigs_client_example_test.go | 77 - ...ckupresourcestorageconfigsnoncrr_client.go | 12 +- ...torageconfigsnoncrr_client_example_test.go | 106 -- .../backupresourcevaultconfigs_client.go | 12 +- ...esourcevaultconfigs_client_example_test.go | 113 -- .../backups_client.go | 4 +- .../backups_client_example_test.go | 40 - .../backupstatus_client.go | 4 +- .../backupstatus_client_example_test.go | 52 - .../backupusagesummaries_client.go | 4 +- ...ackupusagesummaries_client_example_test.go | 151 -- .../backupworkloaditems_client.go | 4 +- ...backupworkloaditems_client_example_test.go | 75 - ...mspreparedatamoveoperationresult_client.go | 4 +- ...moveoperationresult_client_example_test.go | 43 - .../armrecoveryservicesbackup/client.go | 22 +- .../client_example_test.go | 122 -- .../armrecoveryservicesbackup/constants.go | 4 +- .../deletedprotectioncontainers_client.go | 4 +- ...rotectioncontainers_client_example_test.go | 61 - .../exportjobsoperationresults_client.go | 4 +- ...obsoperationresults_client_example_test.go | 47 - .../featuresupport_client.go | 4 +- .../featuresupport_client_example_test.go | 46 - .../fetchtieringcost_client.go | 6 +- .../fetchtieringcost_client_example_test.go | 172 -- .../gettieringcostoperationresult_client.go | 4 +- ...costoperationresult_client_example_test.go | 47 - .../armrecoveryservicesbackup/go.mod | 12 +- .../armrecoveryservicesbackup/go.sum | 23 - .../itemlevelrecoveryconnections_client.go | 8 +- ...recoveryconnections_client_example_test.go | 61 - .../jobcancellations_client.go | 4 +- .../jobcancellations_client_example_test.go | 35 - .../jobdetails_client.go | 4 +- .../jobdetails_client_example_test.go | 70 - .../joboperationresults_client.go | 4 +- ...joboperationresults_client_example_test.go | 35 - .../armrecoveryservicesbackup/jobs_client.go | 4 +- .../jobs_client_example_test.go | 35 - .../armrecoveryservicesbackup/models.go | 3 + .../armrecoveryservicesbackup/models_serde.go | 4 + .../operation_client.go | 4 +- .../operation_client_example_test.go | 127 -- .../operations_client.go | 4 +- .../operations_client_example_test.go | 496 ------ .../privateendpoint_client.go | 4 +- .../privateendpoint_client_example_test.go | 45 - .../privateendpointconnection_client.go | 16 +- ...eendpointconnection_client_example_test.go | 131 -- .../protectablecontainers_client.go | 4 +- ...otectablecontainers_client_example_test.go | 71 - .../protecteditemoperationresults_client.go | 4 +- ...temoperationresults_client_example_test.go | 59 - .../protecteditemoperationstatuses_client.go | 4 +- ...emoperationstatuses_client_example_test.go | 49 - .../protecteditems_client.go | 12 +- .../protecteditems_client_example_test.go | 214 --- ...tectioncontaineroperationresults_client.go | 4 +- ...neroperationresults_client_example_test.go | 77 - ...containerrefreshoperationresults_client.go | 4 +- ...eshoperationresults_client_example_test.go | 35 - .../protectioncontainers_client.go | 22 +- ...rotectioncontainers_client_example_test.go | 175 --- .../protectionintent_client.go | 16 +- .../protectionintent_client_example_test.go | 137 -- .../protectionpolicies_client.go | 14 +- .../protectionpolicies_client_example_test.go | 1397 ----------------- ...protectionpolicyoperationresults_client.go | 4 +- ...icyoperationresults_client_example_test.go | 66 - ...rotectionpolicyoperationstatuses_client.go | 4 +- ...cyoperationstatuses_client_example_test.go | 52 - .../recoverypoints_client.go | 8 +- .../recoverypoints_client_example_test.go | 208 --- ...recoverypointsrecommendedformove_client.go | 4 +- ...srecommendedformove_client_example_test.go | 123 -- .../resourceguardproxies_client.go | 4 +- ...esourceguardproxies_client_example_test.go | 65 - .../resourceguardproxy_client.go | 16 +- .../resourceguardproxy_client_example_test.go | 145 -- .../restores_client.go | 6 +- .../restores_client_example_test.go | 271 ---- .../securitypins_client.go | 4 +- .../securitypins_client_example_test.go | 45 - .../tieringcostoperationstatus_client.go | 4 +- ...costoperationstatus_client_example_test.go | 45 - .../validateoperation_client.go | 6 +- .../validateoperation_client_example_test.go | 62 - .../validateoperationresults_client.go | 4 +- ...ateoperationresults_client_example_test.go | 49 - .../validateoperationstatuses_client.go | 4 +- ...teoperationstatuses_client_example_test.go | 57 - 113 files changed, 191 insertions(+), 6750 deletions(-) delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/fetchtieringcost_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/gettieringcostoperationresult_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/tieringcostoperationstatus_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md index 71e2a4a569a3..d599e6f34b3e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 4.2.0 (2024-12-26) +### Features Added + +- New value `OperationTypeRehydrate` added to enum type `OperationType` +- New field `OperationType` in struct `AzureStorageContainer` + + ## 4.1.0 (2024-05-24) ### Features Added diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md index f2260431b35e..ac021e0b25fc 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 4.1.0 -tag: package-2024-04 +module-version: 4.2.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go index 9822a0f3daff..147f4368a980 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go @@ -46,7 +46,7 @@ func NewBackupEnginesClient(subscriptionID string, credential azcore.TokenCreden // Get - Returns backup management server registered to Recovery Services Vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - backupEngineName - Name of the backup management server. @@ -103,7 +103,7 @@ func (client *BackupEnginesClient) getCreateRequest(ctx context.Context, vaultNa if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,7 +120,7 @@ func (client *BackupEnginesClient) getHandleResponse(resp *http.Response) (Backu // NewListPager - Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupEnginesClientListOptions contains the optional parameters for the BackupEnginesClient.NewListPager method. @@ -173,7 +173,7 @@ func (client *BackupEnginesClient) listCreateRequest(ctx context.Context, vaultN if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go deleted file mode 100644 index f7320761cd68..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go +++ /dev/null @@ -1,136 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Dpm/BackupEngines_List.json -func ExampleBackupEnginesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupEnginesClient().NewListPager("testVault", "testRG", &armrecoveryservicesbackup.BackupEnginesClientListOptions{Filter: nil, - SkipToken: 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.BackupEngineBaseResourceList = armrecoveryservicesbackup.BackupEngineBaseResourceList{ - // Value: []*armrecoveryservicesbackup.BackupEngineBaseResource{ - // { - // Name: to.Ptr("testServer1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEngines"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupEngines/testServer1"), - // Properties: &armrecoveryservicesbackup.DpmBackupEngine{ - // AzureBackupAgentVersion: to.Ptr("2.0.9532.0"), - // BackupEngineState: to.Ptr("Active"), - // BackupEngineType: to.Ptr(armrecoveryservicesbackup.BackupEngineTypeDpmBackupEngine), - // DpmVersion: to.Ptr("5.1.348.0"), - // ExtendedInfo: &armrecoveryservicesbackup.BackupEngineExtendedInfo{ - // AvailableDiskSpace: to.Ptr[float64](50), - // DiskCount: to.Ptr[int32](5), - // ProtectedItemsCount: to.Ptr[int32](35), - // ProtectedServersCount: to.Ptr[int32](21), - // UsedDiskSpace: to.Ptr[float64](20), - // }, - // FriendlyName: to.Ptr("testServer1"), - // IsAzureBackupAgentUpgradeAvailable: to.Ptr(false), - // IsDpmUpgradeAvailable: to.Ptr(false), - // RegistrationStatus: to.Ptr("Registered"), - // }, - // }, - // { - // Name: to.Ptr("testServer5"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEngines"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupEngines/testServer5"), - // Properties: &armrecoveryservicesbackup.DpmBackupEngine{ - // AzureBackupAgentVersion: to.Ptr("2.0.9530.0"), - // BackupEngineState: to.Ptr("Active"), - // BackupEngineType: to.Ptr(armrecoveryservicesbackup.BackupEngineTypeDpmBackupEngine), - // DpmVersion: to.Ptr("5.1.348.0"), - // ExtendedInfo: &armrecoveryservicesbackup.BackupEngineExtendedInfo{ - // AvailableDiskSpace: to.Ptr[float64](50), - // DiskCount: to.Ptr[int32](5), - // ProtectedItemsCount: to.Ptr[int32](35), - // ProtectedServersCount: to.Ptr[int32](21), - // UsedDiskSpace: to.Ptr[float64](20), - // }, - // FriendlyName: to.Ptr("testServer5"), - // IsAzureBackupAgentUpgradeAvailable: to.Ptr(false), - // IsDpmUpgradeAvailable: to.Ptr(false), - // RegistrationStatus: to.Ptr("Registered"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Dpm/BackupEngines_Get.json -func ExampleBackupEnginesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupEnginesClient().Get(ctx, "testVault", "testRG", "testServer", &armrecoveryservicesbackup.BackupEnginesClientGetOptions{Filter: nil, - SkipToken: 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.BackupEngineBaseResource = armrecoveryservicesbackup.BackupEngineBaseResource{ - // Name: to.Ptr("testServer"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEngines"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupEngines/testServer"), - // Properties: &armrecoveryservicesbackup.DpmBackupEngine{ - // AzureBackupAgentVersion: to.Ptr("2.0.9532.0"), - // BackupEngineState: to.Ptr("Active"), - // BackupEngineType: to.Ptr(armrecoveryservicesbackup.BackupEngineTypeDpmBackupEngine), - // DpmVersion: to.Ptr("5.1.348.0"), - // ExtendedInfo: &armrecoveryservicesbackup.BackupEngineExtendedInfo{ - // AvailableDiskSpace: to.Ptr[float64](50), - // DiskCount: to.Ptr[int32](5), - // ProtectedItemsCount: to.Ptr[int32](35), - // ProtectedServersCount: to.Ptr[int32](21), - // UsedDiskSpace: to.Ptr[float64](20), - // }, - // FriendlyName: to.Ptr("testServer"), - // IsAzureBackupAgentUpgradeAvailable: to.Ptr(false), - // IsDpmUpgradeAvailable: to.Ptr(false), - // RegistrationStatus: to.Ptr("Registered"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go index eaba6e0ce32d..4d264680774a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go @@ -45,7 +45,7 @@ func NewBackupJobsClient(subscriptionID string, credential azcore.TokenCredentia // NewListPager - Provides a pageable list of jobs. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupJobsClientListOptions contains the optional parameters for the BackupJobsClient.NewListPager method. @@ -98,7 +98,7 @@ func (client *BackupJobsClient) listCreateRequest(ctx context.Context, vaultName if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go deleted file mode 100644 index f56ae490da65..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go +++ /dev/null @@ -1,191 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ListJobs.json -func ExampleBackupJobsClient_NewListPager_listAllJobs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupJobsClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: nil, - SkipToken: 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.JobResourceList = armrecoveryservicesbackup.JobResourceList{ - // Value: []*armrecoveryservicesbackup.JobResource{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("Backup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Duration: to.Ptr("PT12.4272909S"), - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // }, - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:03.755Z"); return t}()), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("ConfigureBackup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:30:32.448Z"); return t}()), - // Status: to.Ptr("Completed"), - // Duration: to.Ptr("PT31.3066291S"), - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ListJobsWithAllSupportedFilters.json -func ExampleBackupJobsClient_NewListPager_listJobsWithFilters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupJobsClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: to.Ptr("startTime eq '2016-01-01 00:00:00 AM' and endTime eq '2017-11-29 00:00:00 AM' and operation eq 'Backup' and backupManagementType eq 'AzureIaasVM' and status eq 'InProgress'"), - SkipToken: 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.JobResourceList = armrecoveryservicesbackup.JobResourceList{ - // Value: []*armrecoveryservicesbackup.JobResource{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("Backup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Duration: to.Ptr("PT12.4272909S"), - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ListJobsWithStartTimeAndEndTimeFilters.json -func ExampleBackupJobsClient_NewListPager_listJobsWithTimeFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupJobsClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: to.Ptr("startTime eq '2016-01-01 00:00:00 AM' and endTime eq '2017-11-29 00:00:00 AM'"), - SkipToken: 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.JobResourceList = armrecoveryservicesbackup.JobResourceList{ - // Value: []*armrecoveryservicesbackup.JobResource{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("Backup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Duration: to.Ptr("PT12.4272909S"), - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // }, - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:03.755Z"); return t}()), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("ConfigureBackup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:30:32.448Z"); return t}()), - // Status: to.Ptr("Completed"), - // Duration: to.Ptr("PT31.3066291S"), - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go index adb5ca6b51d9..08051ca95280 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go @@ -49,7 +49,7 @@ func NewBackupOperationResultsClient(subscriptionID string, credential azcore.To // argument. OperationID is part of the Location header of the operation response. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - operationID - OperationID which represents the operation. @@ -100,7 +100,7 @@ func (client *BackupOperationResultsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.go deleted file mode 100644 index 0a8e23c58ac8..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.go +++ /dev/null @@ -1,35 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ProtectedItem_Delete_OperationResult.json -func ExampleBackupOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewBackupOperationResultsClient().Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go index d8da0365a9e3..42da170ec06e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go @@ -48,7 +48,7 @@ func NewBackupOperationStatusesClient(subscriptionID string, credential azcore.T // operation. Some operations create jobs. This method returns the list of jobs when the operation is complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - operationID - OperationID which represents the operation. @@ -100,7 +100,7 @@ func (client *BackupOperationStatusesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_test.go deleted file mode 100644 index a79817f56278..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ProtectedItem_Delete_OperationStatus.json -func ExampleBackupOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupOperationStatusesClient().Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "00000000-0000-0000-0000-000000000000", 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.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "1-01-01T00:00:00.000Z"); return t}()), - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T06:52:53.886Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesInProgress), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go index 7b803954f0b0..85556837763f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go @@ -46,7 +46,7 @@ func NewBackupPoliciesClient(subscriptionID string, credential azcore.TokenCrede // NewListPager - Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to // fetch scoped results. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. @@ -96,7 +96,7 @@ func (client *BackupPoliciesClient) listCreateRequest(ctx context.Context, vault if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go deleted file mode 100644 index 093159a58977..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go +++ /dev/null @@ -1,292 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupPolicies_List.json -func ExampleBackupPoliciesClient_NewListPager_listProtectionPoliciesWithBackupManagementTypeFilterAsAzureIaasVm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupPoliciesClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'")}) - 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.ProtectionPolicyResourceList = armrecoveryservicesbackup.ProtectionPolicyResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionPolicyResource{ - // { - // Name: to.Ptr("DefaultPolicy"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](30), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // }, - // }, - // { - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/v2-List-Policies.json -func ExampleBackupPoliciesClient_NewListPager_listProtectionPoliciesWithBackupManagementTypeFilterAsAzureIaasVmWithBothV1AndV2Policies() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupPoliciesClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'")}) - 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.ProtectionPolicyResourceList = armrecoveryservicesbackup.ProtectionPolicyResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionPolicyResource{ - // { - // Name: to.Ptr("DefaultPolicy"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](30), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // }, - // }, - // { - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("v2-daily-policy"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-policy"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - // DailySchedule: &armrecoveryservicesbackup.DailySchedule{ - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // }, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupPolicies_List.json -func ExampleBackupPoliciesClient_NewListPager_listProtectionPoliciesWithBackupManagementTypeFilterAsAzureWorkload() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupPoliciesClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) - 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.ProtectionPolicyResourceList = armrecoveryservicesbackup.ProtectionPolicyResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionPolicyResource{ - // { - // Name: to.Ptr("HourlyLogBackup"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/HourlyLogBackup"), - // Properties: &armrecoveryservicesbackup.AzureVMWorkloadProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureWorkload"), - // ProtectedItemsCount: to.Ptr[int32](0), - // Settings: &armrecoveryservicesbackup.Settings{ - // Issqlcompression: to.Ptr(false), - // TimeZone: to.Ptr("UTC"), - // }, - // SubProtectionPolicy: []*armrecoveryservicesbackup.SubProtectionPolicy{ - // { - // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeFull), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](30), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // }, - // { - // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeLog), - // RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ - // RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](30), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.LogSchedulePolicy{ - // SchedulePolicyType: to.Ptr("LogSchedulePolicy"), - // ScheduleFrequencyInMins: to.Ptr[int32](60), - // }, - // }}, - // WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeSQLDataBase), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go index cd32018bf022..f034adc72df9 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go @@ -46,7 +46,7 @@ func NewBackupProtectableItemsClient(subscriptionID string, credential azcore.To // NewListPager - Provides a pageable list of protectable objects within your subscription according to the query filter and // the pagination parameters. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupProtectableItemsClientListOptions contains the optional parameters for the BackupProtectableItemsClient.NewListPager @@ -100,7 +100,7 @@ func (client *BackupProtectableItemsClient) listCreateRequest(ctx context.Contex if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go deleted file mode 100644 index 290402b32457..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go +++ /dev/null @@ -1,62 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupProtectableItems_List.json -func ExampleBackupProtectableItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupProtectableItemsClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupProtectableItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'"), - SkipToken: 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.WorkloadProtectableItemResourceList = armrecoveryservicesbackup.WorkloadProtectableItemResourceList{ - // Value: []*armrecoveryservicesbackup.WorkloadProtectableItemResource{ - // { - // Name: to.Ptr("VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/protectionContainers/IaasVMContainer;iaasvmcontainer;iaasvm-rg;iaasvm-1/protectableItems/VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSClassicComputeVMProtectableItem{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // FriendlyName: to.Ptr("iaasvm-1"), - // ProtectableItemType: to.Ptr("Microsoft.ClassicCompute/virtualMachines"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStatusNotProtected), - // WorkloadType: to.Ptr("VM"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go index 92a6b0530dfa..4fbd27565c3d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go @@ -45,7 +45,7 @@ func NewBackupProtectedItemsClient(subscriptionID string, credential azcore.Toke // NewListPager - Provides a pageable list of all items that are backed up within a vault. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupProtectedItemsClientListOptions contains the optional parameters for the BackupProtectedItemsClient.NewListPager @@ -99,7 +99,7 @@ func (client *BackupProtectedItemsClient) listCreateRequest(ctx context.Context, if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go deleted file mode 100644 index 5133fa29b887..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go +++ /dev/null @@ -1,71 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupProtectedItems_List.json -func ExampleBackupProtectedItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupProtectedItemsClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupProtectedItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM' and itemType eq 'VM'"), - SkipToken: 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.ProtectedItemResourceList = armrecoveryservicesbackup.ProtectedItemResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectedItemResource{ - // { - // Name: to.Ptr("VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/protectionContainers/IaasVMContainer;iaasvmcontainer;iaasvm-rg;iaasvm-1/protectedItems/VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSClassicComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // LastRecoveryPoint: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T12:25:32.048Z"); return t}()), - // PolicyID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.ClassicCompute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("iaasvm-1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go index 465c26fb02f3..6b713540833a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go @@ -45,7 +45,7 @@ func NewBackupProtectionContainersClient(subscriptionID string, credential azcor // NewListPager - Lists the containers registered to Recovery Services Vault. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupProtectionContainersClientListOptions contains the optional parameters for the BackupProtectionContainersClient.NewListPager @@ -96,7 +96,7 @@ func (client *BackupProtectionContainersClient) listCreateRequest(ctx context.Co if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go deleted file mode 100644 index 0832628df07b..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go +++ /dev/null @@ -1,61 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_List.json -func ExampleBackupProtectionContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupProtectionContainersClient().NewListPager("testVault", "testRg", &armrecoveryservicesbackup.BackupProtectionContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) - 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.ProtectionContainerResourceList = armrecoveryservicesbackup.ProtectionContainerResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionContainerResource{ - // { - // Name: to.Ptr("StorageContainer;Storage;testrg;suchandrtestsa125"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), - // ID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourcegroups/testrg/providers/microsoft.recoveryservices/vaults/suchandr-test-vault-wcus/backupFabrics/Azure/protectionContainers/StorageContainer;Storage;testrg;suchandrtestsa125"), - // Properties: &armrecoveryservicesbackup.AzureStorageContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - // FriendlyName: to.Ptr("suchandrtestsa125"), - // HealthStatus: to.Ptr("Healthy"), - // RegistrationStatus: to.Ptr("Registered"), - // ProtectedItemCount: to.Ptr[int64](2), - // SourceResourceID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/suchandrtestsa125"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go index 6a6b9eaacf42..ec83b572f9a9 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go @@ -45,7 +45,7 @@ func NewBackupProtectionIntentClient(subscriptionID string, credential azcore.To // NewListPager - Provides a pageable list of all intents that are present within a vault. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupProtectionIntentClientListOptions contains the optional parameters for the BackupProtectionIntentClient.NewListPager @@ -99,7 +99,7 @@ func (client *BackupProtectionIntentClient) listCreateRequest(ctx context.Contex if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go deleted file mode 100644 index 39b84b74d45b..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go +++ /dev/null @@ -1,59 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupProtectionIntent_List.json -func ExampleBackupProtectionIntentClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupProtectionIntentClient().NewListPager("myVault", "myRG", &armrecoveryservicesbackup.BackupProtectionIntentClientListOptions{Filter: nil, - SkipToken: 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.ProtectionIntentResourceList = armrecoveryservicesbackup.ProtectionIntentResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionIntentResource{ - // { - // Name: to.Ptr("249D9B07-D2EF-4202-AA64-65F35418564E"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupProtectionIntent"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupFabrics/Azure/backupProtectionIntent/249D9B07-D2EF-4202-AA64-65F35418564E"), - // Properties: &armrecoveryservicesbackup.AzureWorkloadContainerAutoProtectionIntent{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), - // ItemID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupProtectionContainer/VMAppContainer;Compute;testVmName/backupProtectableItems/SQLInstance;MSSQLSERVER"), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), - // ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go index 133c6aed4e26..b4afb53a7235 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go @@ -46,7 +46,7 @@ func NewBackupResourceEncryptionConfigsClient(subscriptionID string, credential // Get - Fetches Vault Encryption config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupResourceEncryptionConfigsClientGetOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Get @@ -93,7 +93,7 @@ func (client *BackupResourceEncryptionConfigsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *BackupResourceEncryptionConfigsClient) getHandleResponse(resp *htt // Update - Updates Vault encryption config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - Vault encryption input config request @@ -158,7 +158,7 @@ func (client *BackupResourceEncryptionConfigsClient) updateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go deleted file mode 100644 index 83c85754f630..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go +++ /dev/null @@ -1,77 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupResourceEncryptionConfig_Get.json -func ExampleBackupResourceEncryptionConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceEncryptionConfigsClient().Get(ctx, "rishTestVault", "rishgrp", 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.BackupResourceEncryptionConfigExtendedResource = armrecoveryservicesbackup.BackupResourceEncryptionConfigExtendedResource{ - // Name: to.Ptr("backupResourceEncryptionConfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEncryptionConfigs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rishgrp/providers/Microsoft.RecoveryServicesBVTD2/vaults/rishTestVault/backupEncryptionConfigs/backupResourceEncryptionConfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceEncryptionConfigExtended{ - // EncryptionAtRestType: to.Ptr(armrecoveryservicesbackup.EncryptionAtRestTypeCustomerManaged), - // InfrastructureEncryptionState: to.Ptr(armrecoveryservicesbackup.InfrastructureEncryptionStateDisabled), - // KeyURI: to.Ptr("https://gktestkv1.vault.azure.net/keys/Test1/ed2e8cdc7f86477ebf0c6462b504a9ed"), - // LastUpdateStatus: to.Ptr(armrecoveryservicesbackup.LastUpdateStatusSucceeded), - // SubscriptionID: to.Ptr("1a2311d9-66f5-47d3-a9fb-7a37da63934b"), - // UseSystemAssignedIdentity: to.Ptr(false), - // UserAssignedIdentity: to.Ptr("/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupResourceEncryptionConfig_Put.json -func ExampleBackupResourceEncryptionConfigsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewBackupResourceEncryptionConfigsClient().Update(ctx, "source-rsv", "test-rg", armrecoveryservicesbackup.BackupResourceEncryptionConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceEncryptionConfig{ - EncryptionAtRestType: to.Ptr(armrecoveryservicesbackup.EncryptionAtRestTypeCustomerManaged), - InfrastructureEncryptionState: to.Ptr(armrecoveryservicesbackup.InfrastructureEncryptionState("true")), - KeyURI: to.Ptr("https://gktestkv1.vault.azure.net/keys/Test1/ed2e8cdc7f86477ebf0c6462b504a9ed"), - SubscriptionID: to.Ptr("1a2311d9-66f5-47d3-a9fb-7a37da63934b"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go index 949687f8437b..d927a7319b1b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go @@ -46,7 +46,7 @@ func NewBackupResourceStorageConfigsNonCRRClient(subscriptionID string, credenti // Get - Fetches resource storage config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupResourceStorageConfigsNonCRRClientGetOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Get @@ -93,7 +93,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) getHandleResponse(resp * // Patch - Updates vault storage model type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - Vault storage config request @@ -158,7 +158,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) patchCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -170,7 +170,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) patchCreateRequest(ctx c // Update - Updates vault storage model type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - Vault storage config request @@ -218,7 +218,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) updateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go deleted file mode 100644 index d374fbea71c8..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go +++ /dev/null @@ -1,106 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupStorageConfig_Get.json -func ExampleBackupResourceStorageConfigsNonCRRClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceStorageConfigsNonCRRClient().Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", 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.BackupResourceConfigResource = armrecoveryservicesbackup.BackupResourceConfigResource{ - // Name: to.Ptr("vaultstorageconfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupstorageconfig"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupstorageconfig/vaultstorageconfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceConfig{ - // StorageModelType: to.Ptr(armrecoveryservicesbackup.StorageTypeGeoRedundant), - // StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeGeoRedundant), - // StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateLocked), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupStorageConfig_Put.json -func ExampleBackupResourceStorageConfigsNonCRRClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceStorageConfigsNonCRRClient().Update(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", armrecoveryservicesbackup.BackupResourceConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceConfig{ - StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), - StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), - }, - }, 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.BackupResourceConfigResource = armrecoveryservicesbackup.BackupResourceConfigResource{ - // Name: to.Ptr("vaultstorageconfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupstorageconfig"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupstorageconfig/vaultstorageconfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceConfig{ - // StorageModelType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), - // StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), - // StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupStorageConfig_Patch.json -func ExampleBackupResourceStorageConfigsNonCRRClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewBackupResourceStorageConfigsNonCRRClient().Patch(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", armrecoveryservicesbackup.BackupResourceConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceConfig{ - StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), - StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go index 932b10bb7fbe..106f55a63a21 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go @@ -46,7 +46,7 @@ func NewBackupResourceVaultConfigsClient(subscriptionID string, credential azcor // Get - Fetches resource vault config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupResourceVaultConfigsClientGetOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Get @@ -93,7 +93,7 @@ func (client *BackupResourceVaultConfigsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,7 +111,7 @@ func (client *BackupResourceVaultConfigsClient) getHandleResponse(resp *http.Res // Put - Updates vault security config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - resource config request @@ -159,7 +159,7 @@ func (client *BackupResourceVaultConfigsClient) putCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.XMSAuthorizationAuxiliary != nil { @@ -183,7 +183,7 @@ func (client *BackupResourceVaultConfigsClient) putHandleResponse(resp *http.Res // Update - Updates vault security config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - resource config request @@ -231,7 +231,7 @@ func (client *BackupResourceVaultConfigsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.XMSAuthorizationAuxiliary != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go deleted file mode 100644 index b64676bc9555..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupResourceVaultConfigs_Get.json -func ExampleBackupResourceVaultConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceVaultConfigsClient().Get(ctx, "SwaggerTest", "SwaggerTestRg", 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.BackupResourceVaultConfigResource = armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - // Name: to.Ptr("vaultconfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - // EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupResourceVaultConfigs_Patch.json -func ExampleBackupResourceVaultConfigsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceVaultConfigsClient().Update(ctx, "SwaggerTest", "SwaggerTestRg", armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - }, - }, &armrecoveryservicesbackup.BackupResourceVaultConfigsClientUpdateOptions{XMSAuthorizationAuxiliary: 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.BackupResourceVaultConfigResource = armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - // Name: to.Ptr("vaultconfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - // EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupResourceVaultConfigs_Put.json -func ExampleBackupResourceVaultConfigsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceVaultConfigsClient().Put(ctx, "SwaggerTest", "SwaggerTestRg", armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - SoftDeleteFeatureState: to.Ptr(armrecoveryservicesbackup.SoftDeleteFeatureStateEnabled), - }, - }, &armrecoveryservicesbackup.BackupResourceVaultConfigsClientPutOptions{XMSAuthorizationAuxiliary: 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.BackupResourceVaultConfigResource = armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - // Name: to.Ptr("vaultconfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - // EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - // SoftDeleteFeatureState: to.Ptr(armrecoveryservicesbackup.SoftDeleteFeatureStateEnabled), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go index 27f15d816c11..a5bab6cfc4f6 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go @@ -47,7 +47,7 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, // call GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backup item. @@ -108,7 +108,7 @@ func (client *BackupsClient) triggerCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_test.go deleted file mode 100644 index 85ba24c20ab6..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_test.go +++ /dev/null @@ -1,40 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/TriggerBackup_Post.json -func ExampleBackupsClient_Trigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewBackupsClient().Trigger(ctx, "linuxRsVault", "linuxRsVaultRG", "Azure", "IaasVMContainer;iaasvmcontainerv2;testrg;v1win2012r", "VM;iaasvmcontainerv2;testrg;v1win2012r", armrecoveryservicesbackup.BackupRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMBackupRequest{ - ObjectType: to.Ptr("IaasVMBackupRequest"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go index 7e638319f40f..df9448182ef6 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go @@ -46,7 +46,7 @@ func NewBackupStatusClient(subscriptionID string, credential azcore.TokenCredent // Get - Get the container backup status // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - azureRegion - Azure region to hit Api // - parameters - Container Backup Status Request // - options - BackupStatusClientGetOptions contains the optional parameters for the BackupStatusClient.Get method. @@ -88,7 +88,7 @@ func (client *BackupStatusClient) getCreateRequest(ctx context.Context, azureReg return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go deleted file mode 100644 index e4ebfa427ff2..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go +++ /dev/null @@ -1,52 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/GetBackupStatus.json -func ExampleBackupStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupStatusClient().Get(ctx, "southeastasia", armrecoveryservicesbackup.BackupStatusRequest{ - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Compute/VirtualMachines/testVm"), - ResourceType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - }, 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.BackupStatusResponse = armrecoveryservicesbackup.BackupStatusResponse{ - // ContainerName: to.Ptr("iaasvmcontainer;iaasvmcontainerv2;testRg;testVm"), - // ErrorCode: to.Ptr("Success"), - // ErrorMessage: to.Ptr("ErrorMessage"), - // FabricName: to.Ptr(armrecoveryservicesbackup.FabricNameAzure), - // PolicyName: to.Ptr("myPolicy"), - // ProtectedItemName: to.Ptr("vm;iaasvmcontainerv2;testRg;testVm"), - // ProtectionStatus: to.Ptr(armrecoveryservicesbackup.ProtectionStatusProtected), - // VaultID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.RecoveryServices/Vaults/testVault"), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go index fba65f2b1d3f..59af64d417be 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go @@ -45,7 +45,7 @@ func NewBackupUsageSummariesClient(subscriptionID string, credential azcore.Toke // NewListPager - Fetches the backup management usage summaries of the vault. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BackupUsageSummariesClientListOptions contains the optional parameters for the BackupUsageSummariesClient.NewListPager @@ -100,7 +100,7 @@ func (client *BackupUsageSummariesClient) listCreateRequest(ctx context.Context, if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go deleted file mode 100644 index 9a96ca60aa5d..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go +++ /dev/null @@ -1,151 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupProtectionContainers_UsageSummary_Get.json -func ExampleBackupUsageSummariesClient_NewListPager_getProtectedContainersUsagesSummary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupUsageSummariesClient().NewListPager("testVault", "testRG", &armrecoveryservicesbackup.BackupUsageSummariesClientListOptions{Filter: to.Ptr("type eq 'BackupProtectionContainerCountSummary'"), - SkipToken: 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.BackupManagementUsageList = armrecoveryservicesbackup.BackupManagementUsageList{ - // Value: []*armrecoveryservicesbackup.BackupManagementUsage{ - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Backup Server"), - // Value: to.Ptr("AzureBackupServer"), - // }, - // CurrentValue: to.Ptr[int64](2), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Backup Agent"), - // Value: to.Ptr("MAB"), - // }, - // CurrentValue: to.Ptr[int64](3), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("SQL in Azure VM"), - // Value: to.Ptr("AzureWorkload"), - // }, - // CurrentValue: to.Ptr[int64](1), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupProtectedItem_UsageSummary_Get.json -func ExampleBackupUsageSummariesClient_NewListPager_getProtectedItemsUsagesSummary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupUsageSummariesClient().NewListPager("testVault", "testRG", &armrecoveryservicesbackup.BackupUsageSummariesClientListOptions{Filter: to.Ptr("type eq 'BackupProtectedItemCountSummary'"), - SkipToken: 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.BackupManagementUsageList = armrecoveryservicesbackup.BackupManagementUsageList{ - // Value: []*armrecoveryservicesbackup.BackupManagementUsage{ - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Virtual Machine"), - // Value: to.Ptr("AzureIaasVM"), - // }, - // CurrentValue: to.Ptr[int64](7), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Backup Agent"), - // Value: to.Ptr("MAB"), - // }, - // CurrentValue: to.Ptr[int64](3), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Backup Server"), - // Value: to.Ptr("AzureBackupServer"), - // }, - // CurrentValue: to.Ptr[int64](1), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Storage (Azure Files)"), - // Value: to.Ptr("AzureStorage"), - // }, - // CurrentValue: to.Ptr[int64](2), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("SQL in Azure VM"), - // Value: to.Ptr("AzureWorkload"), - // }, - // CurrentValue: to.Ptr[int64](2), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go index 393ccbebf0a0..72cb2a11faab 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go @@ -46,7 +46,7 @@ func NewBackupWorkloadItemsClient(subscriptionID string, credential azcore.Token // NewListPager - Provides a pageable list of workload item of a specific container according to the query filter and the // pagination parameters. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the container. @@ -110,7 +110,7 @@ func (client *BackupWorkloadItemsClient) listCreateRequest(ctx context.Context, if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go deleted file mode 100644 index 3a2b7eb5a942..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go +++ /dev/null @@ -1,75 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupWorkloadItems_List.json -func ExampleBackupWorkloadItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupWorkloadItemsClient().NewListPager("suchandr-seacan-rsv", "testRg", "Azure", "VMAppContainer;Compute;bvtdtestag;sqlserver-1", &armrecoveryservicesbackup.BackupWorkloadItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'"), - SkipToken: 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.WorkloadItemResourceList = armrecoveryservicesbackup.WorkloadItemResourceList{ - // Value: []*armrecoveryservicesbackup.WorkloadItemResource{ - // { - // Name: to.Ptr("SQLInstance;MSSQLSERVER"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/items"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/testRg/providers/Microsoft.RecoveryServices/vaults/suchandr-seacan-rsv/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;bvtdtestag;sqlserver-1/protectableItems/SQLInstance;MSSQLSERVER"), - // Properties: &armrecoveryservicesbackup.AzureVMWorkloadSQLInstanceWorkloadItem{ - // BackupManagementType: to.Ptr("AzureWorkload"), - // FriendlyName: to.Ptr("MSSQLSERVER"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStatusNotProtected), - // WorkloadItemType: to.Ptr("SQLInstance"), - // WorkloadType: to.Ptr("SQL"), - // IsAutoProtectable: to.Ptr(true), - // ParentName: to.Ptr("MSSQLSERVER"), - // ServerName: to.Ptr("sqlserver-1.contoso.com"), - // SubWorkloadItemCount: to.Ptr[int32](3), - // Subinquireditemcount: to.Ptr[int32](0), - // DataDirectoryPaths: []*armrecoveryservicesbackup.SQLDataDirectory{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.SQLDataDirectoryTypeData), - // Path: to.Ptr("F:\\DATA\\"), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.SQLDataDirectoryTypeLog), - // Path: to.Ptr("F:\\LOG\\"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go index 8c2fa04c2c02..3029fc37dc89 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go @@ -46,7 +46,7 @@ func NewBMSPrepareDataMoveOperationResultClient(subscriptionID string, credentia // Get - Fetches Operation Result for Prepare Data Move // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - BMSPrepareDataMoveOperationResultClientGetOptions contains the optional parameters for the BMSPrepareDataMoveOperationResultClient.Get @@ -97,7 +97,7 @@ func (client *BMSPrepareDataMoveOperationResultClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_test.go deleted file mode 100644 index 95d7d4eaa56e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_test.go +++ /dev/null @@ -1,43 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json -func ExampleBMSPrepareDataMoveOperationResultClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBMSPrepareDataMoveOperationResultClient().Get(ctx, "source-rsv", "sourceRG", "00000000-0000-0000-0000-000000000000", 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 = armrecoveryservicesbackup.BMSPrepareDataMoveOperationResultClientGetResponse{ - // VaultStorageConfigOperationResultResponseClassification: &armrecoveryservicesbackup.PrepareDataMoveResponse{ - // ObjectType: to.Ptr("PrepareDataMoveResponse"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go index 91511cf49bbf..de2d10e8e906 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go @@ -46,7 +46,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // BeginBMSPrepareDataMove - Prepares source vault for Data Move operation // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - Prepare data move request @@ -72,7 +72,7 @@ func (client *Client) BeginBMSPrepareDataMove(ctx context.Context, vaultName str // BMSPrepareDataMove - Prepares source vault for Data Move operation // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 func (client *Client) bMSPrepareDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters PrepareDataMoveRequest, options *ClientBeginBMSPrepareDataMoveOptions) (*http.Response, error) { var err error const operationName = "Client.BeginBMSPrepareDataMove" @@ -114,7 +114,7 @@ func (client *Client) bmsPrepareDataMoveCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +126,7 @@ func (client *Client) bmsPrepareDataMoveCreateRequest(ctx context.Context, vault // BeginBMSTriggerDataMove - Triggers Data Move Operation on target vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - Trigger data move request @@ -152,7 +152,7 @@ func (client *Client) BeginBMSTriggerDataMove(ctx context.Context, vaultName str // BMSTriggerDataMove - Triggers Data Move Operation on target vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 func (client *Client) bMSTriggerDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters TriggerDataMoveRequest, options *ClientBeginBMSTriggerDataMoveOptions) (*http.Response, error) { var err error const operationName = "Client.BeginBMSTriggerDataMove" @@ -194,7 +194,7 @@ func (client *Client) bmsTriggerDataMoveCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -206,7 +206,7 @@ func (client *Client) bmsTriggerDataMoveCreateRequest(ctx context.Context, vault // GetOperationStatus - Fetches operation status for data move operation on vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ClientGetOperationStatusOptions contains the optional parameters for the Client.GetOperationStatus method. @@ -256,7 +256,7 @@ func (client *Client) getOperationStatusCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,7 +274,7 @@ func (client *Client) getOperationStatusHandleResponse(resp *http.Response) (Cli // BeginMoveRecoveryPoint - Move recovery point from one datastore to another store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - Move Resource Across Tiers Request @@ -299,7 +299,7 @@ func (client *Client) BeginMoveRecoveryPoint(ctx context.Context, vaultName stri // MoveRecoveryPoint - Move recovery point from one datastore to another store. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 func (client *Client) moveRecoveryPoint(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters MoveRPAcrossTiersRequest, options *ClientBeginMoveRecoveryPointOptions) (*http.Response, error) { var err error const operationName = "Client.BeginMoveRecoveryPoint" @@ -357,7 +357,7 @@ func (client *Client) moveRecoveryPointCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go deleted file mode 100644 index 9dcc11449398..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go +++ /dev/null @@ -1,122 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json -func ExampleClient_GetOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().GetOperationStatus(ctx, "source-rsv", "sourceRG", "00000000-0000-0000-0000-000000000000", 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.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.590Z"); return t}()), - // ID: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.590Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/PrepareDataMove_Post.json -func ExampleClient_BeginBMSPrepareDataMove() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginBMSPrepareDataMove(ctx, "source-rsv", "sourceRG", armrecoveryservicesbackup.PrepareDataMoveRequest{ - DataMoveLevel: to.Ptr(armrecoveryservicesbackup.DataMoveLevelVault), - TargetRegion: to.Ptr("USGov Virginia"), - TargetResourceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/targetRG/providers/Microsoft.RecoveryServices/vaults/target-rsv"), - }, 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/BackupDataMove/TriggerDataMove_Post.json -func ExampleClient_BeginBMSTriggerDataMove() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginBMSTriggerDataMove(ctx, "target-rsv", "targetRG", armrecoveryservicesbackup.TriggerDataMoveRequest{ - CorrelationID: to.Ptr("MTg2OTcyMzM4NzYyMjc1NDY3Nzs1YmUzYmVmNi04YjJiLTRhOTItOTllYi01NTM0MDllYjk2NjE="), - DataMoveLevel: to.Ptr(armrecoveryservicesbackup.DataMoveLevelVault), - SourceRegion: to.Ptr("USGov Iowa"), - SourceResourceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv"), - }, 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TriggerRecoveryPointMove_Post.json -func ExampleClient_BeginMoveRecoveryPoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginMoveRecoveryPoint(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.MoveRPAcrossTiersRequest{ - ObjectType: to.Ptr("MoveRPAcrossTiersRequest"), - SourceTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - TargetTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - }, 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/recoveryservices/armrecoveryservicesbackup/constants.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go index 51e972eb27c0..8cd5ebde298a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go @@ -10,7 +10,7 @@ package armrecoveryservicesbackup const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" - moduleVersion = "v4.1.0" + moduleVersion = "v4.2.0" ) // AcquireStorageAccountLock - Whether storage account lock is to be acquired for this container or not. @@ -868,6 +868,7 @@ type OperationType string const ( OperationTypeInvalid OperationType = "Invalid" OperationTypeRegister OperationType = "Register" + OperationTypeRehydrate OperationType = "Rehydrate" OperationTypeReregister OperationType = "Reregister" ) @@ -876,6 +877,7 @@ func PossibleOperationTypeValues() []OperationType { return []OperationType{ OperationTypeInvalid, OperationTypeRegister, + OperationTypeRehydrate, OperationTypeReregister, } } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go index 8611d4f9dc6f..089f68e1a6fa 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go @@ -45,7 +45,7 @@ func NewDeletedProtectionContainersClient(subscriptionID string, credential azco // NewListPager - Lists the soft deleted containers registered to Recovery Services Vault. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - vaultName - The name of the recovery services vault. // - options - DeletedProtectionContainersClientListOptions contains the optional parameters for the DeletedProtectionContainersClient.NewListPager @@ -96,7 +96,7 @@ func (client *DeletedProtectionContainersClient) listCreateRequest(ctx context.C if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go deleted file mode 100644 index cd79130e82df..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go +++ /dev/null @@ -1,61 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/SoftDeletedContainers_List.json -func ExampleDeletedProtectionContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeletedProtectionContainersClient().NewListPager("testRg", "testVault", &armrecoveryservicesbackup.DeletedProtectionContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) - 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.ProtectionContainerResourceList = armrecoveryservicesbackup.ProtectionContainerResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionContainerResource{ - // { - // Name: to.Ptr("StorageContainer;Storage;testrg;suchandrtestsa125"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), - // ID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourcegroups/testrg/providers/microsoft.recoveryservices/vaults/suchandr-test-vault-wcus/backupFabrics/Azure/protectionContainers/StorageContainer;Storage;testrg;suchandrtestsa125"), - // Properties: &armrecoveryservicesbackup.AzureStorageContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - // FriendlyName: to.Ptr("suchandrtestsa125"), - // HealthStatus: to.Ptr("Healthy"), - // RegistrationStatus: to.Ptr("SoftDeleted"), - // ProtectedItemCount: to.Ptr[int64](2), - // SourceResourceID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/suchandrtestsa125"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go index fd388f9e64bf..de24403d2da5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go @@ -48,7 +48,7 @@ func NewExportJobsOperationResultsClient(subscriptionID string, credential azcor // jobs in JSON serialized format. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - operationID - OperationID which represents the export job. @@ -100,7 +100,7 @@ func (client *ExportJobsOperationResultsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go deleted file mode 100644 index ffd6ce16e3e4..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go +++ /dev/null @@ -1,47 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ExportJobsOperationResult.json -func ExampleExportJobsOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExportJobsOperationResultsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", 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.OperationResultInfoBaseResource = armrecoveryservicesbackup.OperationResultInfoBaseResource{ - // Headers: map[string][]*string{ - // }, - // Operation: &armrecoveryservicesbackup.ExportJobsOperationResultInfo{ - // ObjectType: to.Ptr("ExportJobsOperationResultInfo"), - // BlobSasKey: to.Ptr("?sv=2014-02-14&sr=b&sig=&st=2017-11-29T07%3A53%3A34Z&se=2017-11-29T08%3A03%3A34Z&sp=r"), - // BlobURL: to.Ptr("https://azureblob.blob.core.windows.net/reportcontainer/exportjobsreportc00000000-0000-0000-0000-000000000000"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go index 524c4c854d83..9e923e2783c0 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go @@ -46,7 +46,7 @@ func NewFeatureSupportClient(subscriptionID string, credential azcore.TokenCrede // Validate - It will validate if given feature with resource properties is supported in service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - azureRegion - Azure region to hit Api // - parameters - Feature support request object // - options - FeatureSupportClientValidateOptions contains the optional parameters for the FeatureSupportClient.Validate method. @@ -88,7 +88,7 @@ func (client *FeatureSupportClient) validateCreateRequest(ctx context.Context, a return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_test.go deleted file mode 100644 index a91eb7464c18..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_test.go +++ /dev/null @@ -1,46 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/BackupFeature_Validate.json -func ExampleFeatureSupportClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFeatureSupportClient().Validate(ctx, "southeastasia", &armrecoveryservicesbackup.AzureVMResourceFeatureSupportRequest{ - FeatureType: to.Ptr("AzureVMResourceBackup"), - VMSize: to.Ptr("Basic_A0"), - VMSKU: to.Ptr("Premium"), - }, 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.AzureVMResourceFeatureSupportResponse = armrecoveryservicesbackup.AzureVMResourceFeatureSupportResponse{ - // SupportStatus: to.Ptr(armrecoveryservicesbackup.SupportStatusDefaultOFF), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/fetchtieringcost_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/fetchtieringcost_client.go index de173c3918f1..f5bbf7ee0a0c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/fetchtieringcost_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/fetchtieringcost_client.go @@ -47,7 +47,7 @@ func NewFetchTieringCostClient(subscriptionID string, credential azcore.TokenCre // API and result using GetTieringCostOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - vaultName - The name of the recovery services vault. // - parameters - Fetch Tiering Cost Request @@ -74,7 +74,7 @@ func (client *FetchTieringCostClient) BeginPost(ctx context.Context, resourceGro // API and result using GetTieringCostOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 func (client *FetchTieringCostClient) post(ctx context.Context, resourceGroupName string, vaultName string, parameters FetchTieringCostInfoRequestClassification, options *FetchTieringCostClientBeginPostOptions) (*http.Response, error) { var err error const operationName = "FetchTieringCostClient.BeginPost" @@ -116,7 +116,7 @@ func (client *FetchTieringCostClient) postCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/fetchtieringcost_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/fetchtieringcost_client_example_test.go deleted file mode 100644 index 5508cd1325d4..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/fetchtieringcost_client_example_test.go +++ /dev/null @@ -1,172 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForRehydrate.json -func ExampleFetchTieringCostClient_BeginPost_getTheRehydrationCostForRecoveryPoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFetchTieringCostClient().BeginPost(ctx, "netsdktestrg", "testVault", &armrecoveryservicesbackup.FetchTieringCostInfoForRehydrationRequest{ - ObjectType: to.Ptr("FetchTieringCostInfoForRehydrationRequest"), - SourceTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - TargetTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - ContainerName: to.Ptr("IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - ProtectedItemName: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - RecoveryPointID: to.Ptr("1222343434"), - RehydrationPriority: to.Ptr(armrecoveryservicesbackup.RehydrationPriorityHigh), - }, 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 = armrecoveryservicesbackup.FetchTieringCostClientPostResponse{ - // TieringCostInfoClassification: &armrecoveryservicesbackup.TieringCostRehydrationInfo{ - // ObjectType: to.Ptr("TieringCostRehydrationInfo"), - // RehydrationSizeInBytes: to.Ptr[int64](1204000), - // RetailRehydrationCostPerGBPerMonth: to.Ptr[float64](0.02), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForPolicy.json -func ExampleFetchTieringCostClient_BeginPost_getTheTieringSavingsCostInfoForPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFetchTieringCostClient().BeginPost(ctx, "netsdktestrg", "testVault", &armrecoveryservicesbackup.FetchTieringCostSavingsInfoForPolicyRequest{ - ObjectType: to.Ptr("FetchTieringCostSavingsInfoForPolicyRequest"), - SourceTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - TargetTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - PolicyName: to.Ptr("monthly"), - }, 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 = armrecoveryservicesbackup.FetchTieringCostClientPostResponse{ - // TieringCostInfoClassification: &armrecoveryservicesbackup.TieringCostSavingInfo{ - // ObjectType: to.Ptr("TieringCostSavingInfo"), - // RetailSourceTierCostPerGBPerMonth: to.Ptr[float64](0.02), - // RetailTargetTierCostPerGBPerMonth: to.Ptr[float64](0.003), - // SourceTierSizeReductionInBytes: to.Ptr[int64](1204000), - // TargetTierSizeIncreaseInBytes: to.Ptr[int64](1892), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForProtectedItem.json -func ExampleFetchTieringCostClient_BeginPost_getTheTieringSavingsCostInfoForProtectedItem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFetchTieringCostClient().BeginPost(ctx, "netsdktestrg", "testVault", &armrecoveryservicesbackup.FetchTieringCostSavingsInfoForProtectedItemRequest{ - ObjectType: to.Ptr("FetchTieringCostSavingsInfoForProtectedItemRequest"), - SourceTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - TargetTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - ContainerName: to.Ptr("IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - ProtectedItemName: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - }, 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 = armrecoveryservicesbackup.FetchTieringCostClientPostResponse{ - // TieringCostInfoClassification: &armrecoveryservicesbackup.TieringCostSavingInfo{ - // ObjectType: to.Ptr("TieringCostSavingInfo"), - // RetailSourceTierCostPerGBPerMonth: to.Ptr[float64](0.02), - // RetailTargetTierCostPerGBPerMonth: to.Ptr[float64](0.003), - // SourceTierSizeReductionInBytes: to.Ptr[int64](1204000), - // TargetTierSizeIncreaseInBytes: to.Ptr[int64](1892), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/FetchTieringCostForVault.json -func ExampleFetchTieringCostClient_BeginPost_getTheTieringSavingsCostInfoForVault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewFetchTieringCostClient().BeginPost(ctx, "netsdktestrg", "testVault", &armrecoveryservicesbackup.FetchTieringCostSavingsInfoForVaultRequest{ - ObjectType: to.Ptr("FetchTieringCostSavingsInfoForVaultRequest"), - SourceTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - TargetTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - }, 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 = armrecoveryservicesbackup.FetchTieringCostClientPostResponse{ - // TieringCostInfoClassification: &armrecoveryservicesbackup.TieringCostSavingInfo{ - // ObjectType: to.Ptr("TieringCostSavingInfo"), - // RetailSourceTierCostPerGBPerMonth: to.Ptr[float64](0.02), - // RetailTargetTierCostPerGBPerMonth: to.Ptr[float64](0.003), - // SourceTierSizeReductionInBytes: to.Ptr[int64](1204000), - // TargetTierSizeIncreaseInBytes: to.Ptr[int64](1892), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/gettieringcostoperationresult_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/gettieringcostoperationresult_client.go index 6ab9f54a5a27..714bc74e5efc 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/gettieringcostoperationresult_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/gettieringcostoperationresult_client.go @@ -46,7 +46,7 @@ func NewGetTieringCostOperationResultClient(subscriptionID string, credential az // Get - Gets the result of async operation for tiering cost // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - vaultName - The name of the recovery services vault. // - options - GetTieringCostOperationResultClientGetOptions contains the optional parameters for the GetTieringCostOperationResultClient.Get @@ -97,7 +97,7 @@ func (client *GetTieringCostOperationResultClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/gettieringcostoperationresult_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/gettieringcostoperationresult_client_example_test.go deleted file mode 100644 index 644d09c16676..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/gettieringcostoperationresult_client_example_test.go +++ /dev/null @@ -1,47 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/GetTieringCostOperationResult.json -func ExampleGetTieringCostOperationResultClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGetTieringCostOperationResultClient().Get(ctx, "gaallaRG", "gaallavaultbvtd2msi", "0f48183b-0a44-4dca-aec1-bba5daab888a", 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 = armrecoveryservicesbackup.GetTieringCostOperationResultClientGetResponse{ - // TieringCostInfoClassification: &armrecoveryservicesbackup.TieringCostSavingInfo{ - // ObjectType: to.Ptr("TieringCostSavingInfo"), - // RetailSourceTierCostPerGBPerMonth: to.Ptr[float64](0.02), - // RetailTargetTierCostPerGBPerMonth: to.Ptr[float64](0.003), - // SourceTierSizeReductionInBytes: to.Ptr[int64](1204000), - // TargetTierSizeIncreaseInBytes: to.Ptr[int64](1892), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod index 94689e1342dc..3fb1808ef3f8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/ar go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.31.0 // indirect golang.org/x/net v0.33.0 // indirect - golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect ) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum index 9620a8f197a3..823eafcd76d5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum @@ -1,35 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 h1:JZg6HRh6W6U4OLl6lk7BZ7BLisIzM9dG1R50zUk9C/M= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0/go.mod h1:YL1xnZ6QejvQHWJrX/AvhFl4WW4rqHVoKspWNVwFk0M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 h1:B/dfvscEQtew9dVuoxqxrUKKv8Ih2f55PydknDamU+g= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0/go.mod h1:fiPSssYvltE08HJchL04dOy+RD4hgrjph0cwGGMntdI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvULkDNfdXOgrjtg6UYJPFBJyuEcRCAw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 h1:kYRSnvJju5gYVyhkij+RTJ/VR6QIUaCfWeaFm2ycsjQ= -github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= -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-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/redis/go-redis/v9 v9.6.1 h1:HHDteefn6ZkTtY5fGUE8tj8uy85AHk6zP7CpzIAM0y4= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go index 66b145ab2c6f..6867c550a075 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go @@ -48,7 +48,7 @@ func NewItemLevelRecoveryConnectionsClient(subscriptionID string, credential azc // operation. To know the status of provisioning, call GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backed up items. @@ -116,7 +116,7 @@ func (client *ItemLevelRecoveryConnectionsClient) provisionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -129,7 +129,7 @@ func (client *ItemLevelRecoveryConnectionsClient) provisionCreateRequest(ctx con // displaying all recoverable files and folders. This is an asynchronous operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backed up items. @@ -196,7 +196,7 @@ func (client *ItemLevelRecoveryConnectionsClient) revokeCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.go deleted file mode 100644 index 06a65ef06b5a..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.go +++ /dev/null @@ -1,61 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/Provision_Ilr.json -func ExampleItemLevelRecoveryConnectionsClient_Provision() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewItemLevelRecoveryConnectionsClient().Provision(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", "1", armrecoveryservicesbackup.ILRRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMILRRegistrationRequest{ - ObjectType: to.Ptr("IaasVMILRRegistrationRequest"), - InitiatorName: to.Ptr("Hello World"), - RecoveryPointID: to.Ptr("38823086363464"), - RenewExistingRegistration: to.Ptr(true), - VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/pysdktestrg/providers/Microsoft.Compute/virtualMachines/pysdktestv2vm1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/Revoke_Ilr.json -func ExampleItemLevelRecoveryConnectionsClient_Revoke() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewItemLevelRecoveryConnectionsClient().Revoke(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", "1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go index 9c791ccedd4d..50980e461b2d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go @@ -47,7 +47,7 @@ func NewJobCancellationsClient(subscriptionID string, credential azcore.TokenCre // API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - jobName - Name of the job to cancel. @@ -98,7 +98,7 @@ func (client *JobCancellationsClient) triggerCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.go deleted file mode 100644 index 6468728336ea..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.go +++ /dev/null @@ -1,35 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/TriggerCancelJob.json -func ExampleJobCancellationsClient_Trigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobCancellationsClient().Trigger(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go index b55cc2be3df2..49315bedb844 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go @@ -46,7 +46,7 @@ func NewJobDetailsClient(subscriptionID string, credential azcore.TokenCredentia // Get - Gets extended information associated with the job. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - jobName - Name of the job whose details are to be fetched. @@ -97,7 +97,7 @@ func (client *JobDetailsClient) getCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go deleted file mode 100644 index 32e415218d0c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go +++ /dev/null @@ -1,70 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/GetJobDetails.json -func ExampleJobDetailsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobDetailsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", 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.JobResource = armrecoveryservicesbackup.JobResource{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("Backup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Duration: to.Ptr("PT9.8782791S"), - // ExtendedInfo: &armrecoveryservicesbackup.AzureIaaSVMJobExtendedInfo{ - // PropertyBag: map[string]*string{ - // "VM Name": to.Ptr("testvm"), - // }, - // TasksList: []*armrecoveryservicesbackup.AzureIaaSVMJobTaskDetails{ - // { - // Duration: to.Ptr("PT0S"), - // Status: to.Ptr("InProgress"), - // TaskID: to.Ptr("Take Snapshot"), - // }, - // { - // Duration: to.Ptr("PT0S"), - // Status: to.Ptr("NotStarted"), - // TaskID: to.Ptr("Transfer data to vault"), - // }}, - // }, - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go index 3f02cf8c9178..854bc54a2a59 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go @@ -46,7 +46,7 @@ func NewJobOperationResultsClient(subscriptionID string, credential azcore.Token // Get - Fetches the result of any operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - jobName - Job name whose operation result has to be fetched. @@ -101,7 +101,7 @@ func (client *JobOperationResultsClient) getCreateRequest(ctx context.Context, v return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.go deleted file mode 100644 index 2d0a6c570bc1..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.go +++ /dev/null @@ -1,35 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/CancelJobOperationResult.json -func ExampleJobOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobOperationResultsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go index 1b00640724cf..7b3bc95f9274 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go @@ -46,7 +46,7 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // Export - Triggers export of jobs specified by filters and returns an OperationID to track. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - JobsClientExportOptions contains the optional parameters for the JobsClient.Export method. @@ -94,7 +94,7 @@ func (client *JobsClient) exportCreateRequest(ctx context.Context, vaultName str if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.go deleted file mode 100644 index 2c78395dbbe9..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.go +++ /dev/null @@ -1,35 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/TriggerExportJobs.json -func ExampleJobsClient_Export() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobsClient().Export(ctx, "NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.JobsClientExportOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go index cb4efdaf4a50..fbadddfb5b47 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go @@ -1714,6 +1714,9 @@ type AzureStorageContainer struct { // Status of health of the container. HealthStatus *string + // Re-Do Operation + OperationType *OperationType + // Type of the protectable object associated with this container ProtectableObjectType *string diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go index 905c62732003..7a3633f3a50c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go @@ -2175,6 +2175,7 @@ func (a AzureStorageContainer) MarshalJSON() ([]byte, error) { objectMap["containerType"] = ProtectableContainerTypeStorageContainer populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) + populate(objectMap, "operationType", a.OperationType) populate(objectMap, "protectableObjectType", a.ProtectableObjectType) populate(objectMap, "protectedItemCount", a.ProtectedItemCount) populate(objectMap, "registrationStatus", a.RegistrationStatus) @@ -2208,6 +2209,9 @@ func (a *AzureStorageContainer) UnmarshalJSON(data []byte) error { case "healthStatus": err = unpopulate(val, "HealthStatus", &a.HealthStatus) delete(rawMsg, key) + case "operationType": + err = unpopulate(val, "OperationType", &a.OperationType) + delete(rawMsg, key) case "protectableObjectType": err = unpopulate(val, "ProtectableObjectType", &a.ProtectableObjectType) delete(rawMsg, key) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go index 2c4571e3e56c..32441535dfb5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go @@ -46,7 +46,7 @@ func NewOperationClient(subscriptionID string, credential azcore.TokenCredential // Validate - Validate operation for specified backed up item. This is a synchronous operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - resource validate operation request @@ -93,7 +93,7 @@ func (client *OperationClient) validateCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go deleted file mode 100644 index 9a1f4561c9e5..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk.json -func ExampleOperationClient_Validate_validateOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationClient().Validate(ctx, "testVault", "testRG", armrecoveryservicesbackup.ValidateOperationRequestResource{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVault/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;testRG;testvmName/protectedItems/VM;iaasvmcontainerv2;testRG;testvmName/recoveryPoints/348916168024334"), - Properties: &armrecoveryservicesbackup.ValidateIaasVMRestoreOperationRequest{ - ObjectType: to.Ptr("ValidateIaasVMRestoreOperationRequest"), - RestoreRequest: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - }, - }, 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.ValidateOperationsResponse = armrecoveryservicesbackup.ValidateOperationsResponse{ - // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ - // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ - // { - // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), - // Message: to.Ptr("Core Count subscription quota has been reached."), - // Recommendations: []*string{ - // to.Ptr("Contact Azure support to increase the limits.")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk_IdentityBasedRestoreDetails.json -func ExampleOperationClient_Validate_validateOperationWithIdentityBasedRestoreDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationClient().Validate(ctx, "testVault", "testRG", armrecoveryservicesbackup.ValidateOperationRequestResource{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVault/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;testRG;testvmName/protectedItems/VM;iaasvmcontainerv2;testRG;testvmName/recoveryPoints/348916168024334"), - Properties: &armrecoveryservicesbackup.ValidateIaasVMRestoreOperationRequest{ - ObjectType: to.Ptr("ValidateIaasVMRestoreOperationRequest"), - RestoreRequest: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityBasedRestoreDetails: &armrecoveryservicesbackup.IdentityBasedRestoreDetails{ - TargetStorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - }, - }, - }, 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.ValidateOperationsResponse = armrecoveryservicesbackup.ValidateOperationsResponse{ - // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ - // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ - // { - // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), - // Message: to.Ptr("Core Count subscription quota has been reached."), - // Recommendations: []*string{ - // to.Ptr("Contact Azure support to increase the limits.")}, - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go index b1738721083e..7a00f625b195 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Returns the list of available operations. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go deleted file mode 100644 index f5e2445105d4..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go +++ /dev/null @@ -1,496 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ListOperations.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 := armrecoveryservicesbackup.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.ClientDiscoveryResponse = armrecoveryservicesbackup.ClientDiscoveryResponse{ - // Value: []*armrecoveryservicesbackup.ClientDiscoveryValueForSingleAPI{ - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/usages/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns usage details for a Recovery Services Vault."), - // Operation: to.Ptr("Recovery Services Vault usage details."), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Vault Usage"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupUsageSummaries/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns summaries for Protected Items and Protected Servers for a Recovery Services ."), - // Operation: to.Ptr("Recovery Services Protected Items and Protected Servers usage summaries details."), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Usages Summaries"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/storageConfig/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Storage Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Get Resource Storage Config"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Vault Storage Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/storageConfig/write"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Updates Storage Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Write Resource Storage Config"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Vault Storage Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupconfig/vaultconfig/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Get Resource Config"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Vault Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupconfig/vaultconfig/write"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Updates Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Update Resource Config"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Vault Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/tokenInfo/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns token information for Recovery Services Vault."), - // Operation: to.Ptr("Get Vault Token Info"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Token Info"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupSecurityPIN/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Security PIN Information for Recovery Services Vault."), - // Operation: to.Ptr("Get Security PIN Info"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("SecurityPINInfo"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupManagementMetaData/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Management Metadata for Recovery Services Vault."), - // Operation: to.Ptr("Get Backup Management Metadata"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Management Metadata"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupOperationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Operation Result for Recovery Services Vault."), - // Operation: to.Ptr("Get Backup Operation Result"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupOperations/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Operation Status for Recovery Services Vault."), - // Operation: to.Ptr("Get Backup Operation Status"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobs/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all Job Objects"), - // Operation: to.Ptr("Get Jobs"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobs/cancel/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Cancel the Job"), - // Operation: to.Ptr("Cancel Jobs"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobsExport/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Export Jobs"), - // Operation: to.Ptr("Export Jobs"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Export Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobs/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns the Result of Job Operation."), - // Operation: to.Ptr("Get Job Operation Result"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Jobs Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobsExport/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns the Result of Export Job Operation."), - // Operation: to.Ptr("Get Export Job Operation Result"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Export Backup Jobs Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get Recovery Points for Protected Items."), - // Operation: to.Ptr("Get Recovery Points"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/restore/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Restore Recovery Points for Protected Items."), - // Operation: to.Ptr("Restore Recovery Points"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/provisionInstantItemRecovery/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Provision Instant Item Recovery for Protected Item"), - // Operation: to.Ptr("Provision Instant Item Recovery for Protected Item"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/revokeInstantItemRecovery/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Revoke Instant Item Recovery for Protected Item"), - // Operation: to.Ptr("Revoke Instant Item Recovery for Protected Item"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all Protection Policies"), - // Operation: to.Ptr("Get Protection Policy"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/write"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Creates Protection Policy"), - // Operation: to.Ptr("Create Protection Policy"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/delete"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Delete a Protection Policy"), - // Operation: to.Ptr("Delete Protection Policy"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get Results of Policy Operation."), - // Operation: to.Ptr("Get Policy Operation Results"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Policy Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/operationsStatus/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get Status of Policy Operation."), - // Operation: to.Ptr("Get Policy Operation Status"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Policy Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns object details of the Protected Item"), - // Operation: to.Ptr("Get Protected Item Details"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupProtectedItems/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns the list of all Protected Items."), - // Operation: to.Ptr("Get All Protected Items"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/write"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Create a backup Protected Item"), - // Operation: to.Ptr("Create Backup Protected Item"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/delete"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Deletes Protected Item"), - // Operation: to.Ptr("Delete Protected Items"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets Result of Operation Performed on Protected Items."), - // Operation: to.Ptr("Get Protected Items Operation Results"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Item Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/operationsStatus/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns the status of Operation performed on Protected Items."), - // Operation: to.Ptr("Get Protected Items operation status"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Item Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/backup/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Performs Backup for Protected Item."), - // Operation: to.Ptr("Backup Protected Item"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupProtectableItems/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns list of all Protectable Items."), - // Operation: to.Ptr("Get Protectable Items"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Protectable Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/refreshContainers/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Refreshes the container list"), - // Operation: to.Ptr("Refresh container"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Refresh Containers"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns status of the operation"), - // Operation: to.Ptr("Get Operation Results"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Refresh Containers Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupProtectionContainers/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all containers belonging to the subscription"), - // Operation: to.Ptr("Get Containers In Subscription"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Protection Containers"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all registered containers"), - // Operation: to.Ptr("Get Registered Container"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protection Containers"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets result of Operation performed on Protection Container."), - // Operation: to.Ptr("Get Container Operation Results"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protection Containers Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupEngines"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all the backup management servers registered with vault."), - // Operation: to.Ptr("List of backup management servers."), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Engines"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupStatus"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Check Backup Status for Recovery Services Vaults"), - // Operation: to.Ptr("Check Backup Status for Vault"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPreValidateProtection"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr(""), - // Operation: to.Ptr("Pre Validate Enable Protection"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("PreValidate Protection"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupValidateFeatures"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Validate Features"), - // Operation: to.Ptr("Validate Features"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Validate Features"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/backupProtectionIntent/write"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Create a backup Protection Intent"), - // Operation: to.Ptr("Create backup Protection Intent"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protection Intent"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/{fabricName}/protectionContainers/{containerName}/items/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get all items in a container"), - // Operation: to.Ptr("Get all items in a container"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Workload Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/inquire/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get all items in a container"), - // Operation: to.Ptr("Get all items in a container"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protection Containers Inquire"), - // }, - // Origin: to.Ptr("user"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go index ca347a271906..155ada5aa443 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointClient(subscriptionID string, credential azcore.TokenCred // GetOperationStatus - Gets the operation status for a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -103,7 +103,7 @@ func (client *PrivateEndpointClient) getOperationStatusCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_test.go deleted file mode 100644 index a3c07f559a24..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json -func ExamplePrivateEndpointClient_GetOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointClient().GetOperationStatus(ctx, "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", "0f48183b-0a44-4dca-aec1-bba5daab888a", 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.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.590Z"); return t}()), - // ID: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.590Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go index 0b557db7955a..0ded3c57db74 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go @@ -46,7 +46,7 @@ func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore // BeginDelete - Delete Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -72,7 +72,7 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, // Delete - Delete Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionClient.BeginDelete" @@ -118,7 +118,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -127,7 +127,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C // Get - Get Private Endpoint Connection. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -179,7 +179,7 @@ func (client *PrivateEndpointConnectionClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +197,7 @@ func (client *PrivateEndpointConnectionClient) getHandleResponse(resp *http.Resp // BeginPut - Approve or Reject Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - privateEndpointConnectionName - The name of the private endpoint connection. @@ -224,7 +224,7 @@ func (client *PrivateEndpointConnectionClient) BeginPut(ctx context.Context, vau // Put - Approve or Reject Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 func (client *PrivateEndpointConnectionClient) put(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource, options *PrivateEndpointConnectionClientBeginPutOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionClient.BeginPut" @@ -270,7 +270,7 @@ func (client *PrivateEndpointConnectionClient) putCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go deleted file mode 100644 index c3b30c58852e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go +++ /dev/null @@ -1,131 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionClient().Get(ctx, "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", 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.PrivateEndpointConnectionResource = armrecoveryservicesbackup.PrivateEndpointConnectionResource{ - // Name: to.Ptr("gaallatestpe1.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.RecoveryServicesBVTD2/vaults/gaallavaultbvtd2msi/privateEndpointConnections/gaallatestpe3.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), - // Properties: &armrecoveryservicesbackup.PrivateEndpointConnection{ - // GroupIDs: []*armrecoveryservicesbackup.VaultSubResourceType{ - // to.Ptr(armrecoveryservicesbackup.VaultSubResourceTypeAzureBackupSecondary)}, - // PrivateEndpoint: &armrecoveryservicesbackup.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.Network/privateEndpoints/gaallatestpe3"), - // }, - // PrivateLinkServiceConnectionState: &armrecoveryservicesbackup.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by johndoe@company.com"), - // Status: to.Ptr(armrecoveryservicesbackup.PrivateEndpointConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armrecoveryservicesbackup.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/PutPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_BeginPut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginPut(ctx, "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", armrecoveryservicesbackup.PrivateEndpointConnectionResource{ - Properties: &armrecoveryservicesbackup.PrivateEndpointConnection{ - GroupIDs: []*armrecoveryservicesbackup.VaultSubResourceType{ - to.Ptr(armrecoveryservicesbackup.VaultSubResourceTypeAzureBackupSecondary)}, - PrivateEndpoint: &armrecoveryservicesbackup.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.Network/privateEndpoints/gaallatestpe3"), - }, - PrivateLinkServiceConnectionState: &armrecoveryservicesbackup.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by johndoe@company.com"), - Status: to.Ptr(armrecoveryservicesbackup.PrivateEndpointConnectionStatusApproved), - }, - ProvisioningState: to.Ptr(armrecoveryservicesbackup.ProvisioningStateSucceeded), - }, - }, 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.PrivateEndpointConnectionResource = armrecoveryservicesbackup.PrivateEndpointConnectionResource{ - // Name: to.Ptr("gaallatestpe1.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.RecoveryServicesBVTD2/vaults/gaallavaultbvtd2msi/privateEndpointConnections/gaallatestpe3.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), - // Properties: &armrecoveryservicesbackup.PrivateEndpointConnection{ - // GroupIDs: []*armrecoveryservicesbackup.VaultSubResourceType{ - // to.Ptr(armrecoveryservicesbackup.VaultSubResourceTypeAzureBackupSecondary)}, - // PrivateEndpoint: &armrecoveryservicesbackup.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.Network/privateEndpoints/gaallatestpe3"), - // }, - // PrivateLinkServiceConnectionState: &armrecoveryservicesbackup.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approved by johndoe@company.com"), - // Status: to.Ptr(armrecoveryservicesbackup.PrivateEndpointConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armrecoveryservicesbackup.ProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/PrivateEndpointConnection/DeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionClient().BeginDelete(ctx, "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", 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/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go index c67f7182be1f..dbf3da387cf5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go @@ -45,7 +45,7 @@ func NewProtectableContainersClient(subscriptionID string, credential azcore.Tok // NewListPager - Lists the containers that can be registered to Recovery Services Vault. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ProtectableContainersClientListOptions contains the optional parameters for the ProtectableContainersClient.NewListPager @@ -100,7 +100,7 @@ func (client *ProtectableContainersClient) listCreateRequest(ctx context.Context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go deleted file mode 100644 index 5ea2c01c4177..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go +++ /dev/null @@ -1,71 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectableContainers_List.json -func ExampleProtectableContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProtectableContainersClient().NewListPager("testvault", "testRg", "Azure", &armrecoveryservicesbackup.ProtectableContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureStorage' and workloadType eq 'AzureFileShare'")}) - 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.ProtectableContainerResourceList = armrecoveryservicesbackup.ProtectableContainerResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectableContainerResource{ - // { - // Name: to.Ptr("StorageContainer;storage;test-rg;testst"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectableContainers"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.RecoveryServices/vaults/testvault/backupFabrics/Azure/protectableContainers/StorageContainer;storage;test-rg;teststorage"), - // Properties: &armrecoveryservicesbackup.AzureStorageProtectableContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - // ContainerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorage"), - // FriendlyName: to.Ptr("teststorage"), - // HealthStatus: to.Ptr("Healthy"), - // ProtectableContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - // }, - // }, - // { - // Name: to.Ptr("StorageContainer;ClassicStorage;test-rg;teststorage"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectableContainers"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.RecoveryServices/vaults/testvault/backupFabrics/Azure/protectableContainers/StorageContainer;ClassicStorage;test-rg;teststorage"), - // Properties: &armrecoveryservicesbackup.AzureStorageProtectableContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - // ContainerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.ClassicStorage/storageAccounts/teststorage"), - // FriendlyName: to.Ptr("teststorage"), - // HealthStatus: to.Ptr("Healthy"), - // ProtectableContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go index 07c015b38a42..3bf15dd9f14d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go @@ -46,7 +46,7 @@ func NewProtectedItemOperationResultsClient(subscriptionID string, credential az // Get - Fetches the result of any operation on the backup item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backup item. @@ -113,7 +113,7 @@ func (client *ProtectedItemOperationResultsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go deleted file mode 100644 index 0804c9e2c82f..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go +++ /dev/null @@ -1,59 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectedItemOperationResults.json -func ExampleProtectedItemOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemOperationResultsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "00000000-0000-0000-0000-000000000000", 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.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ - // Name: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("netvmtestv2vm1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go index e3a41cf4253f..f5d95ca79b4e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go @@ -48,7 +48,7 @@ func NewProtectedItemOperationStatusesClient(subscriptionID string, credential a // the operation. Some operations create jobs. This method returns the list of jobs associated with the operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backup item. @@ -115,7 +115,7 @@ func (client *ProtectedItemOperationStatusesClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go deleted file mode 100644 index db1efc9231e1..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go +++ /dev/null @@ -1,49 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectedItemOperationStatus.json -func ExampleProtectedItemOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemOperationStatusesClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "00000000-0000-0000-0000-000000000000", 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.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207Z"); return t}()), - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.OperationStatusJobExtendedInfo{ - // ObjectType: to.Ptr("OperationStatusJobExtendedInfo"), - // JobID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go index bd01d4070294..5511d149ff1c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go @@ -48,7 +48,7 @@ func NewProtectedItemsClient(subscriptionID string, credential azcore.TokenCrede // GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backup item. @@ -111,7 +111,7 @@ func (client *ProtectedItemsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.XMSAuthorizationAuxiliary != nil { @@ -136,7 +136,7 @@ func (client *ProtectedItemsClient) createOrUpdateHandleResponse(resp *http.Resp // the request, call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backed up item. @@ -196,7 +196,7 @@ func (client *ProtectedItemsClient) deleteCreateRequest(ctx context.Context, vau return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -206,7 +206,7 @@ func (client *ProtectedItemsClient) deleteCreateRequest(ctx context.Context, vau // call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backed up item. @@ -270,7 +270,7 @@ func (client *ProtectedItemsClient) getCreateRequest(ctx context.Context, vaultN if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go deleted file mode 100644 index a52d7495ed8f..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go +++ /dev/null @@ -1,214 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json -func ExampleProtectedItemsClient_Get_getProtectedClassicVirtualMachineDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemsClient().Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainer;iaasvm-rg;iaasvm-1", "vm;iaasvmcontainer;iaasvm-rg;iaasvm-1", &armrecoveryservicesbackup.ProtectedItemsClientGetOptions{Filter: 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.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ - // Name: to.Ptr("VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainer;iaasvm-rg;iaasvm-1/protectedItems/VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSClassicComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // LastRecoveryPoint: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T12:25:32.048Z"); return t}()), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.ClassicCompute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("iaasvm-1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/Compute_ProtectedItem_Get.json -func ExampleProtectedItemsClient_Get_getProtectedVirtualMachineDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemsClient().Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainerv2;iaasvm-rg;iaasvm-1", "vm;iaasvmcontainerv2;iaasvm-rg;iaasvm-1", &armrecoveryservicesbackup.ProtectedItemsClientGetOptions{Filter: 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.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ - // Name: to.Ptr("VM;iaasvmcontainerv2;iaasvm-rg;iaasvm-1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;iaasvm-rg;iaasvm-1/protectedItems/VM;iaasvmcontainerv2;iaasvm-rg;iaasvm-1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainerv2;iaasvm-rg;iaasvm-1"), - // LastRecoveryPoint: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T12:25:32.048Z"); return t}()), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.Compute/virtualMachines/iaasvm-1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("iaasvm-1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.Compute/virtualMachines/iaasvm-1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ConfigureProtection.json -func ExampleProtectedItemsClient_CreateOrUpdate_enableProtectionOnAzureIaasVm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemsClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", armrecoveryservicesbackup.ProtectedItemResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - PolicyID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy"), - ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - }, - }, &armrecoveryservicesbackup.ProtectedItemsClientCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ - // Name: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("netvmtestv2vm1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/StopProtection.json -func ExampleProtectedItemsClient_CreateOrUpdate_stopProtectionWithRetainDataOnAzureIaasVm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemsClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", armrecoveryservicesbackup.ProtectedItemResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtectionStopped), - }, - }, &armrecoveryservicesbackup.ProtectedItemsClientCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ - // Name: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("netvmtestv2vm1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtectionStopped), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/ProtectedItem_Delete.json -func ExampleProtectedItemsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectedItemsClient().Delete(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go index 43d40ce9352f..8a41d13d3d7e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go @@ -46,7 +46,7 @@ func NewProtectionContainerOperationResultsClient(subscriptionID string, credent // Get - Fetches the result of any operation on the container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the container. @@ -108,7 +108,7 @@ func (client *ProtectionContainerOperationResultsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go deleted file mode 100644 index 58b7af11ff9b..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go +++ /dev/null @@ -1,77 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_Inquire_Result.json -func ExampleProtectionContainerOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionContainerOperationResultsClient().Get(ctx, "testvault", "test-rg", "Azure", "VMAppContainer;Compute;testRG;testSQL", "00000000-0000-0000-0000-000000000000", 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.ProtectionContainerResource = armrecoveryservicesbackup.ProtectionContainerResource{ - // Name: to.Ptr("VMAppContainer;Compute;testRG;testSQL"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;testRG;testSQL"), - // Properties: &armrecoveryservicesbackup.AzureVMAppContainerProtectionContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), - // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeVMAppContainer), - // FriendlyName: to.Ptr("testSQL"), - // ExtendedInfo: &armrecoveryservicesbackup.AzureWorkloadContainerExtendedInfo{ - // HostServerName: to.Ptr("testsql"), - // InquiryInfo: &armrecoveryservicesbackup.InquiryInfo{ - // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ - // Code: to.Ptr("Success"), - // Message: to.Ptr("Not Available"), - // Recommendations: []*string{ - // to.Ptr("Not Available")}, - // }, - // InquiryDetails: []*armrecoveryservicesbackup.WorkloadInquiryDetails{ - // { - // Type: to.Ptr("sql"), - // InquiryValidation: &armrecoveryservicesbackup.InquiryValidation{ - // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ - // Code: to.Ptr("Success"), - // Message: to.Ptr("Not Available"), - // Recommendations: []*string{ - // to.Ptr("Not Available")}, - // }, - // Status: to.Ptr("Success"), - // }, - // ItemCount: to.Ptr[int64](14), - // }}, - // Status: to.Ptr("Success"), - // }, - // NodesList: []*armrecoveryservicesbackup.DistributedNodesInfo{ - // }, - // }, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testSQL"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go index 872b78940056..b8bdda138464 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go @@ -46,7 +46,7 @@ func NewProtectionContainerRefreshOperationResultsClient(subscriptionID string, // Get - Provides the result of the refresh operation triggered by the BeginRefresh operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the container. @@ -102,7 +102,7 @@ func (client *ProtectionContainerRefreshOperationResultsClient) getCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.go deleted file mode 100644 index 0ff1d70b8523..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.go +++ /dev/null @@ -1,35 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/RefreshContainers_OperationResults.json -func ExampleProtectionContainerRefreshOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectionContainerRefreshOperationResultsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go index 4b6097ddad10..679e157542ab 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go @@ -46,7 +46,7 @@ func NewProtectionContainersClient(subscriptionID string, credential azcore.Toke // Get - Gets details of the specific container registered to your Recovery Services Vault. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Name of the fabric where the container belongs. @@ -103,7 +103,7 @@ func (client *ProtectionContainersClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -121,7 +121,7 @@ func (client *ProtectionContainersClient) getHandleResponse(resp *http.Response) // Inquire - This is an async operation and the results should be tracked using location header or Azure-async-url. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric Name associated with the container. @@ -180,7 +180,7 @@ func (client *ProtectionContainersClient) inquireCreateRequest(ctx context.Conte if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *ProtectionContainersClient) inquireCreateRequest(ctx context.Conte // GetRefreshOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated the container. @@ -245,7 +245,7 @@ func (client *ProtectionContainersClient) refreshCreateRequest(ctx context.Conte if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +255,7 @@ func (client *ProtectionContainersClient) refreshCreateRequest(ctx context.Conte // status, use location header to call get latest status of the operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the container. @@ -284,7 +284,7 @@ func (client *ProtectionContainersClient) BeginRegister(ctx context.Context, vau // status, use location header to call get latest status of the operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 func (client *ProtectionContainersClient) register(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters ProtectionContainerResource, options *ProtectionContainersClientBeginRegisterOptions) (*http.Response, error) { var err error const operationName = "ProtectionContainersClient.BeginRegister" @@ -334,7 +334,7 @@ func (client *ProtectionContainersClient) registerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -348,7 +348,7 @@ func (client *ProtectionContainersClient) registerCreateRequest(ctx context.Cont // Operation Result API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Name of the fabric where the container belongs. @@ -404,7 +404,7 @@ func (client *ProtectionContainersClient) unregisterCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go deleted file mode 100644 index 2dfb1091f302..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go +++ /dev/null @@ -1,175 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/ProtectionContainers_Get.json -func ExampleProtectionContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionContainersClient().Get(ctx, "testVault", "testRg", "Azure", "VMAppContainer;Compute;testRG;testSQL", 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.ProtectionContainerResource = armrecoveryservicesbackup.ProtectionContainerResource{ - // Name: to.Ptr("VMAppContainer;Compute;testRG;testSQL"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;testRG;testSQL"), - // Properties: &armrecoveryservicesbackup.AzureVMAppContainerProtectionContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), - // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeVMAppContainer), - // FriendlyName: to.Ptr("testSQL"), - // ExtendedInfo: &armrecoveryservicesbackup.AzureWorkloadContainerExtendedInfo{ - // HostServerName: to.Ptr("testsql"), - // InquiryInfo: &armrecoveryservicesbackup.InquiryInfo{ - // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ - // Code: to.Ptr("Success"), - // Message: to.Ptr("Not Available"), - // Recommendations: []*string{ - // to.Ptr("Not Available")}, - // }, - // InquiryDetails: []*armrecoveryservicesbackup.WorkloadInquiryDetails{ - // { - // Type: to.Ptr("sql"), - // InquiryValidation: &armrecoveryservicesbackup.InquiryValidation{ - // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ - // Code: to.Ptr("Success"), - // Message: to.Ptr("Not Available"), - // Recommendations: []*string{ - // to.Ptr("Not Available")}, - // }, - // Status: to.Ptr("Success"), - // }, - // ItemCount: to.Ptr[int64](14), - // }}, - // Status: to.Ptr("Success"), - // }, - // NodesList: []*armrecoveryservicesbackup.DistributedNodesInfo{ - // }, - // }, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testSQL"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_Register.json -func ExampleProtectionContainersClient_BeginRegister() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProtectionContainersClient().BeginRegister(ctx, "swaggertestvault", "SwaggerTestRg", "Azure", "StorageContainer;Storage;SwaggerTestRg;swaggertestsa", armrecoveryservicesbackup.ProtectionContainerResource{ - Properties: &armrecoveryservicesbackup.AzureStorageContainer{ - BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - FriendlyName: to.Ptr("swaggertestsa"), - AcquireStorageAccountLock: to.Ptr(armrecoveryservicesbackup.AcquireStorageAccountLockAcquire), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa"), - }, - }, 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.ProtectionContainerResource = armrecoveryservicesbackup.ProtectionContainerResource{ - // Name: to.Ptr("StorageContainer;Storage;SwaggerTestRg;swaggertestsa"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/swaggertestvault/backupFabrics/Azure/protectionContainers/StorageContainer;Storage;SwaggerTestRg;swaggertestsa"), - // Properties: &armrecoveryservicesbackup.AzureStorageContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - // FriendlyName: to.Ptr("swaggertestsa"), - // HealthStatus: to.Ptr("Healthy"), - // RegistrationStatus: to.Ptr("Registered"), - // AcquireStorageAccountLock: to.Ptr(armrecoveryservicesbackup.AcquireStorageAccountLockAcquire), - // ProtectedItemCount: to.Ptr[int64](0), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/ProtectionContainers_Unregister.json -func ExampleProtectionContainersClient_Unregister() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectionContainersClient().Unregister(ctx, "testVault", "testRg", "Azure", "storagecontainer;Storage;test-rg;teststorage", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionContainers_Inquire.json -func ExampleProtectionContainersClient_Inquire() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectionContainersClient().Inquire(ctx, "testvault", "test-rg", "Azure", "storagecontainer;Storage;test-rg;teststorage", &armrecoveryservicesbackup.ProtectionContainersClientInquireOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/RefreshContainers.json -func ExampleProtectionContainersClient_Refresh() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectionContainersClient().Refresh(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", &armrecoveryservicesbackup.ProtectionContainersClientRefreshOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go index 0adb09bd4bb8..65519cac5d57 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go @@ -46,7 +46,7 @@ func NewProtectionIntentClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Create Intent for Enabling backup of an item. This is a synchronous operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backup item. @@ -104,7 +104,7 @@ func (client *ProtectionIntentClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -125,7 +125,7 @@ func (client *ProtectionIntentClient) createOrUpdateHandleResponse(resp *http.Re // Delete - Used to remove intent from an item // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the intent. @@ -180,7 +180,7 @@ func (client *ProtectionIntentClient) deleteCreateRequest(ctx context.Context, v return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -189,7 +189,7 @@ func (client *ProtectionIntentClient) deleteCreateRequest(ctx context.Context, v // operation, call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backed up item. @@ -245,7 +245,7 @@ func (client *ProtectionIntentClient) getCreateRequest(ctx context.Context, vaul return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +266,7 @@ func (client *ProtectionIntentClient) getHandleResponse(resp *http.Response) (Pr // 3. Any VM related configuration passed in properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - azureRegion - Azure region to hit Api // - parameters - Enable backup validation request on Virtual Machine // - options - ProtectionIntentClientValidateOptions contains the optional parameters for the ProtectionIntentClient.Validate @@ -309,7 +309,7 @@ func (client *ProtectionIntentClient) validateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go deleted file mode 100644 index cb56a18abec0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go +++ /dev/null @@ -1,137 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionIntent_Validate.json -func ExampleProtectionIntentClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionIntentClient().Validate(ctx, "southeastasia", armrecoveryservicesbackup.PreValidateEnableBackupRequest{ - Properties: to.Ptr(""), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arunaupgrade/providers/Microsoft.Compute/VirtualMachines/upgrade1"), - ResourceType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - VaultID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/Vaults/myVault"), - }, 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.PreValidateEnableBackupResponse = armrecoveryservicesbackup.PreValidateEnableBackupResponse{ - // ContainerName: to.Ptr("iaasvmcontainer;iaasvmcontainerv2;arunaupgrade;upgrade1"), - // ErrorCode: to.Ptr("VirtualMachineAlreadyProtected"), - // ErrorMessage: to.Ptr("Virtual machine with same name and same resource group is already protected. Please select `Disable' choice above for backup and go to backup item corresponding to this VM in the vault"), - // ProtectedItemName: to.Ptr("vm;iaasvmcontainerv2;arunaupgrade;upgrade1"), - // Recommendation: to.Ptr("Please do not enable protection again."), - // Status: to.Ptr(armrecoveryservicesbackup.ValidationStatusFailed), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupProtectionIntent_Get.json -func ExampleProtectionIntentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionIntentClient().Get(ctx, "myVault", "myRG", "Azure", "249D9B07-D2EF-4202-AA64-65F35418564E", 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.ProtectionIntentResource = armrecoveryservicesbackup.ProtectionIntentResource{ - // Name: to.Ptr("249D9B07-D2EF-4202-AA64-65F35418564E"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupProtectionIntent"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupFabrics/Azure/backupProtectionIntent/249D9B07-D2EF-4202-AA64-65F35418564E"), - // Properties: &armrecoveryservicesbackup.AzureWorkloadContainerAutoProtectionIntent{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), - // ItemID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupProtectionContainer/VMAppContainer;Compute;testVmName/backupProtectableItems/SQLInstance;MSSQLSERVER"), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), - // ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json -func ExampleProtectionIntentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionIntentClient().CreateOrUpdate(ctx, "myVault", "myRG", "Azure", "vm;iaasvmcontainerv2;chamsrgtest;chamscandel", armrecoveryservicesbackup.ProtectionIntentResource{ - Properties: &armrecoveryservicesbackup.AzureResourceProtectionIntent{ - PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), - ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureResourceItem), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/chamsrgtest/providers/Microsoft.Compute/virtualMachines/chamscandel"), - }, - }, 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.ProtectionIntentResource = armrecoveryservicesbackup.ProtectionIntentResource{ - // Name: to.Ptr("vm;iaasvmcontainerv2;chamsrgtest;chamscandel"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupProtectionIntent"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupFabrics/Azure/backupProtectionIntent/vm;iaasvmcontainerv2;chamsrgtest;chamscandel"), - // Properties: &armrecoveryservicesbackup.AzureResourceProtectionIntent{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), - // ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureResourceItem), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStatusProtected), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/BackupProtectionIntent_Delete.json -func ExampleProtectionIntentClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectionIntentClient().Delete(ctx, "myVault", "myRG", "Azure", "249D9B07-D2EF-4202-AA64-65F35418564E", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go index 0e50af5f9e17..630221c76a90 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go @@ -47,7 +47,7 @@ func NewProtectionPoliciesClient(subscriptionID string, credential azcore.TokenC // fetched using GetPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - policyName - Backup policy to be created. @@ -100,7 +100,7 @@ func (client *ProtectionPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.XMSAuthorizationAuxiliary != nil { @@ -125,7 +125,7 @@ func (client *ProtectionPoliciesClient) createOrUpdateHandleResponse(resp *http. // of the operation can be fetched using GetProtectionPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - policyName - Backup policy to be deleted. @@ -152,7 +152,7 @@ func (client *ProtectionPoliciesClient) BeginDelete(ctx context.Context, vaultNa // the operation can be fetched using GetProtectionPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 func (client *ProtectionPoliciesClient) deleteOperation(ctx context.Context, vaultName string, resourceGroupName string, policyName string, options *ProtectionPoliciesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ProtectionPoliciesClient.BeginDelete" @@ -198,7 +198,7 @@ func (client *ProtectionPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -208,7 +208,7 @@ func (client *ProtectionPoliciesClient) deleteCreateRequest(ctx context.Context, // Status of the operation can be fetched using GetPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - policyName - Backup policy information to be fetched. @@ -259,7 +259,7 @@ func (client *ProtectionPoliciesClient) getCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go deleted file mode 100644 index d7bcbd3d6494..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go +++ /dev/null @@ -1,1397 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "time" - - "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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/v2-Get-Policy.json -func ExampleProtectionPoliciesClient_Get_getAzureIaasVmEnhancedProtectionPolicyDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "v2-daily-sample", 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("v2-daily-sample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-sample"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // InstantRpRetentionRangeInDays: to.Ptr[int32](30), - // PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - // DailySchedule: &armrecoveryservicesbackup.DailySchedule{ - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // }, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // }, - // SnapshotConsistencyType: to.Ptr(armrecoveryservicesbackup.IaasVMSnapshotConsistencyTypeOnlyCrashConsistent), - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_Get.json -func ExampleProtectionPoliciesClient_Get_getAzureIaasVmProtectionPolicyDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hardened.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateAzureStorageVaultStandardProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "swaggertestvault", "SwaggerTestRg", "newPolicyV2", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ - BackupManagementType: to.Ptr("AzureStorage"), - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-18T09:30:00.000Z"); return t }())}, - }, - TimeZone: to.Ptr("UTC"), - VaultRetentionPolicy: &armrecoveryservicesbackup.VaultRetentionPolicy{ - SnapshotRetentionInDays: to.Ptr[int32](5), - VaultRetention: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](30), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-18T09:30:00.000Z"); return t }())}, - }, - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](60), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-18T09:30:00.000Z"); return t }())}, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](12), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-18T09:30:00.000Z"); return t }())}, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](10), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-18T09:30:00.000Z"); return t }())}, - }, - }, - }, - WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeAzureFileShare), - }, - }, &armrecoveryservicesbackup.ProtectionPoliciesClientCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("newPolicyV2"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/swaggertestvault/backupPolicies/newPolicyV2"), - // Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureStorage"), - // ProtectedItemsCount: to.Ptr[int32](0), - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-18T09:30:00.000Z"); return t}())}, - // }, - // TimeZone: to.Ptr("UTC"), - // VaultRetentionPolicy: &armrecoveryservicesbackup.VaultRetentionPolicy{ - // SnapshotRetentionInDays: to.Ptr[int32](5), - // VaultRetention: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](30), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-18T09:30:00.000Z"); return t}())}, - // }, - // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](60), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-18T09:30:00.000Z"); return t}())}, - // }, - // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](12), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-18T09:30:00.000Z"); return t}())}, - // }, - // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](10), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-18T09:30:00.000Z"); return t}())}, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateDailyAzureStorageProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "swaggertestvault", "SwaggerTestRg", "dailyPolicy2", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ - BackupManagementType: to.Ptr("AzureStorage"), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](5), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](60), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](12), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](10), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - TimeZone: to.Ptr("UTC"), - WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeAzureFileShare), - }, - }, &armrecoveryservicesbackup.ProtectionPoliciesClientCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("dailyPolicy2"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/swaggertestvault/backupPolicies/dailyPolicy2"), - // Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureStorage"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](5), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t}())}, - // }, - // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](60), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t}())}, - // }, - // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](12), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t}())}, - // }, - // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](10), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("UTC"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/IaaS_v2_hourly.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateEnhancedAzureVmProtectionPolicyWithHourlyBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "v2-daily-sample", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - BackupManagementType: to.Ptr("AzureIaasVM"), - InstantRpRetentionRangeInDays: to.Ptr[int32](30), - PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](180), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t }())}, - }, - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](60), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t }())}, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](12), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t }())}, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](10), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ - Interval: to.Ptr[int32](4), - ScheduleWindowDuration: to.Ptr[int32](16), - ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t }()), - }, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), - }, - SnapshotConsistencyType: to.Ptr(armrecoveryservicesbackup.IaasVMSnapshotConsistencyTypeOnlyCrashConsistent), - TimeZone: to.Ptr("India Standard Time"), - }, - }, &armrecoveryservicesbackup.ProtectionPoliciesClientCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("v2-daily-sample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-sample"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // InstantRpRetentionRangeInDays: to.Ptr[int32](30), - // PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](180), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t}())}, - // }, - // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](60), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t}())}, - // }, - // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](12), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t}())}, - // }, - // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](10), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - // HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ - // Interval: to.Ptr[int32](4), - // ScheduleWindowDuration: to.Ptr[int32](16), - // ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t}()), - // }, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), - // }, - // SnapshotConsistencyType: to.Ptr(armrecoveryservicesbackup.IaasVMSnapshotConsistencyTypeOnlyCrashConsistent), - // TimeZone: to.Ptr("India Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/V2Policy/IaaS_v2_daily.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateEnhancedAzureVmProtectionPolicyWithDailyBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "v2-daily-sample", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - BackupManagementType: to.Ptr("AzureIaasVM"), - InstantRpRetentionRangeInDays: to.Ptr[int32](30), - PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](180), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t }())}, - }, - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](60), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t }())}, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](12), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t }())}, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](10), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - DailySchedule: &armrecoveryservicesbackup.DailySchedule{ - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t }())}, - }, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - }, - SnapshotConsistencyType: to.Ptr(armrecoveryservicesbackup.IaasVMSnapshotConsistencyTypeOnlyCrashConsistent), - TimeZone: to.Ptr("India Standard Time"), - }, - }, &armrecoveryservicesbackup.ProtectionPoliciesClientCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("v2-daily-sample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-sample"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // InstantRpRetentionRangeInDays: to.Ptr[int32](30), - // PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](180), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t}())}, - // }, - // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](60), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t}())}, - // }, - // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](12), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t}())}, - // }, - // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](10), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - // DailySchedule: &armrecoveryservicesbackup.DailySchedule{ - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // }, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // }, - // SnapshotConsistencyType: to.Ptr(armrecoveryservicesbackup.IaasVMSnapshotConsistencyTypeOnlyCrashConsistent), - // TimeZone: to.Ptr("India Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateFullAzureVmProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - BackupManagementType: to.Ptr("AzureIaasVM"), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](2), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst), - to.Ptr(armrecoveryservicesbackup.WeekOfMonthThird)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t }())}, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](1), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t }())}, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearFebruary), - to.Ptr(armrecoveryservicesbackup.MonthOfYearNovember)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](4), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFourth)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t }())}, - }, - TimeZone: to.Ptr("Pacific Standard Time"), - }, - }, &armrecoveryservicesbackup.ProtectionPoliciesClientCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](2), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst), - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthThird)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // }, - // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // }, - // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - // to.Ptr(armrecoveryservicesbackup.MonthOfYearFebruary), - // to.Ptr(armrecoveryservicesbackup.MonthOfYearNovember)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](4), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFourth)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateFullAzureWorkloadProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureVMWorkloadProtectionPolicy{ - BackupManagementType: to.Ptr("AzureWorkload"), - Settings: &armrecoveryservicesbackup.Settings{ - Issqlcompression: to.Ptr(false), - TimeZone: to.Ptr("Pacific Standard Time"), - }, - SubProtectionPolicy: []*armrecoveryservicesbackup.SubProtectionPolicy{ - { - PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeFull), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](1), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthSecond)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t }())}, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](2), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t }())}, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary), - to.Ptr(armrecoveryservicesbackup.MonthOfYearJune), - to.Ptr(armrecoveryservicesbackup.MonthOfYearDecember)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](1), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthLast)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t }())}, - }, - }, - { - PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeDifferential), - RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ - RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](8), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekFriday)}, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t }())}, - }, - }, - { - PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeLog), - RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ - RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](7), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.LogSchedulePolicy{ - SchedulePolicyType: to.Ptr("LogSchedulePolicy"), - ScheduleFrequencyInMins: to.Ptr[int32](60), - }, - }}, - WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeSQLDataBase), - }, - }, &armrecoveryservicesbackup.ProtectionPoliciesClientCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureVMWorkloadProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureWorkload"), - // ProtectedItemsCount: to.Ptr[int32](0), - // Settings: &armrecoveryservicesbackup.Settings{ - // Issqlcompression: to.Ptr(false), - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // SubProtectionPolicy: []*armrecoveryservicesbackup.SubProtectionPolicy{ - // { - // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeFull), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthSecond)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // }, - // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](2), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // }, - // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary), - // to.Ptr(armrecoveryservicesbackup.MonthOfYearJune), - // to.Ptr(armrecoveryservicesbackup.MonthOfYearDecember)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthLast)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // }, - // { - // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeDifferential), - // RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ - // RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](8), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekFriday)}, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // }, - // { - // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeLog), - // RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ - // RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](7), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.LogSchedulePolicy{ - // SchedulePolicyType: to.Ptr("LogSchedulePolicy"), - // ScheduleFrequencyInMins: to.Ptr[int32](60), - // }, - // }}, - // WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeSQLDataBase), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hourly.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateHourlyAzureStorageProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "swaggertestvault", "SwaggerTestRg", "newPolicy2", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ - BackupManagementType: to.Ptr("AzureStorage"), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](5), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - }, - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](60), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](12), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](10), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ - Interval: to.Ptr[int32](4), - ScheduleWindowDuration: to.Ptr[int32](12), - ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }()), - }, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), - }, - TimeZone: to.Ptr("UTC"), - WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeAzureFileShare), - }, - }, &armrecoveryservicesbackup.ProtectionPoliciesClientCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("newPolicy2"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/swaggertestvault/backupPolicies/newPolicy2"), - // Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureStorage"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](5), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T20:00:00.000Z"); return t}())}, - // }, - // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](60), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T20:00:00.000Z"); return t}())}, - // }, - // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](12), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T20:00:00.000Z"); return t}())}, - // }, - // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](10), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T20:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ - // Interval: to.Ptr[int32](4), - // ScheduleWindowDuration: to.Ptr[int32](12), - // ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t}()), - // }, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("UTC"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateSimpleAzureVmProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - BackupManagementType: to.Ptr("AzureIaasVM"), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](1), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t }())}, - }, - TimeZone: to.Ptr("Pacific Standard Time"), - }, - }, &armrecoveryservicesbackup.ProtectionPoliciesClientCreateOrUpdateOptions{XMSAuthorizationAuxiliary: 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicies_Delete.json -func ExampleProtectionPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProtectionPoliciesClient().BeginDelete(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", 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/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go index 4b9acc4a4c50..dc14723c021d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go @@ -46,7 +46,7 @@ func NewProtectionPolicyOperationResultsClient(subscriptionID string, credential // Get - Provides the result of an operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - policyName - Backup policy name whose operation's result needs to be fetched. @@ -103,7 +103,7 @@ func (client *ProtectionPolicyOperationResultsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go deleted file mode 100644 index 4e60b9581103..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go +++ /dev/null @@ -1,66 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicyOperationResults_Get.json -func ExampleProtectionPolicyOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPolicyOperationResultsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", "00000000-0000-0000-0000-000000000000", 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.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](1), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00.000Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go index 402338acc9c0..b0aa77193276 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go @@ -48,7 +48,7 @@ func NewProtectionPolicyOperationStatusesClient(subscriptionID string, credentia // an operation. Some operations create jobs. This method returns the list of jobs associated with operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - policyName - Backup policy name whose operation's status needs to be fetched. @@ -105,7 +105,7 @@ func (client *ProtectionPolicyOperationStatusesClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go deleted file mode 100644 index 5cfdddb262cf..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go +++ /dev/null @@ -1,52 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json -func ExampleProtectionPolicyOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPolicyOperationStatusesClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", "00000000-0000-0000-0000-000000000000", 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.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("GetProtectionPolicyOperationStatus"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T12:57:32.114Z"); return t}()), - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.OperationStatusJobsExtendedInfo{ - // ObjectType: to.Ptr("OperationStatusJobsExtendedInfo"), - // FailedJobsError: map[string]*string{ - // }, - // JobIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // }, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T12:57:32.114Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go index 8631b85ee6fb..78631c447394 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go @@ -47,7 +47,7 @@ func NewRecoveryPointsClient(subscriptionID string, credential azcore.TokenCrede // To know the status of the operation, call the GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with backed up item. @@ -113,7 +113,7 @@ func (client *RecoveryPointsClient) getCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -130,7 +130,7 @@ func (client *RecoveryPointsClient) getHandleResponse(resp *http.Response) (Reco // NewListPager - Lists the backup copies for the backed up item. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backed up item. @@ -195,7 +195,7 @@ func (client *RecoveryPointsClient) listCreateRequest(ctx context.Context, vault if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go deleted file mode 100644 index 1f1065349cf6..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go +++ /dev/null @@ -1,208 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/RecoveryPoints_List.json -func ExampleRecoveryPointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRecoveryPointsClient().NewListPager("rshvault", "rshhtestmdvmrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", &armrecoveryservicesbackup.RecoveryPointsClientListOptions{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.RecoveryPointResourceList = armrecoveryservicesbackup.RecoveryPointResourceList{ - // Value: []*armrecoveryservicesbackup.RecoveryPointResource{ - // { - // Name: to.Ptr("22244821112382"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/22244821112382"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsSourceVMEncrypted: to.Ptr(false), - // OriginalStorageAccountOption: to.Ptr(false), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "Archive": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // IsReadyForMove: to.Ptr(true), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-21T22:48:25.435Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SourceVMStorageType: to.Ptr("NormalStorage"), - // VirtualMachineSize: to.Ptr("Standard_D1"), - // }, - // }, - // { - // Name: to.Ptr("24977149827250"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/24977149827250"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsPrivateAccessEnabledOnAnyDisk: to.Ptr(true), - // IsSourceVMEncrypted: to.Ptr(false), - // OriginalStorageAccountOption: to.Ptr(false), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // AdditionalInfo: to.Ptr("Recovery point cannot be moved to archive tier since it has already been moved."), - // IsReadyForMove: to.Ptr(false), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - // ExtendedInfo: map[string]*string{ - // "RehydratedRPExpiryTime": to.Ptr("2020-12-21T22:48:25.4353958Z"), - // }, - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusRehydrated), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-20T22:49:44.331Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SourceVMStorageType: to.Ptr("NormalStorage"), - // VirtualMachineSize: to.Ptr("Standard_D1"), - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // }, - // { - // Name: to.Ptr("70477518625276"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/FijiValidation-asr-microsoftrrdclab3-408/providers/Microsoft.RecoveryServices/vaults/testVault408/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;fijivalidation-asr-microsoftrrdclab3-408;vm408/protectedItems/VM;iaasvmcontainerv2;fijivalidation-asr-microsoftrrdclab3-408;vm408/recoveryPoints/70477518625276"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // ExtendedLocation: &armrecoveryservicesbackup.ExtendedLocation{ - // Name: to.Ptr("microsoftrrdclab3"), - // Type: to.Ptr("EdgeZone"), - // }, - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsPrivateAccessEnabledOnAnyDisk: to.Ptr(false), - // IsSourceVMEncrypted: to.Ptr(true), - // OriginalStorageAccountOption: to.Ptr(false), - // OSType: to.Ptr("Windows"), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // AdditionalInfo: to.Ptr("We're still determining if this Recovery Point can be moved.. Please check again after some time."), - // IsReadyForMove: to.Ptr(false), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-22T20:02:00.122Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SecurityType: to.Ptr("None"), - // SourceVMStorageType: to.Ptr("PremiumVMOnPartialPremiumStorage"), - // VirtualMachineSize: to.Ptr("Standard_D2s_v3"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/RecoveryPoints_Get.json -func ExampleRecoveryPointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecoveryPointsClient().Get(ctx, "rshvault", "rshhtestmdvmrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "26083826328862", 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.RecoveryPointResource = armrecoveryservicesbackup.RecoveryPointResource{ - // Name: to.Ptr("26083826328862"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/26083826328862"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsPrivateAccessEnabledOnAnyDisk: to.Ptr(true), - // IsSourceVMEncrypted: to.Ptr(false), - // OriginalStorageAccountOption: to.Ptr(false), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // IsReadyForMove: to.Ptr(true), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T22:32:46.608Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SourceVMStorageType: to.Ptr("NormalStorage"), - // VirtualMachineSize: to.Ptr("Standard_D1"), - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go index 0040a45908d9..a67f101ae673 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go @@ -45,7 +45,7 @@ func NewRecoveryPointsRecommendedForMoveClient(subscriptionID string, credential // NewListPager - Lists the recovery points recommended for move to another tier // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - List Recovery points Recommended for Move Request @@ -106,7 +106,7 @@ func (client *RecoveryPointsRecommendedForMoveClient) listCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go deleted file mode 100644 index d87ccca7dbb3..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go +++ /dev/null @@ -1,123 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json -func ExampleRecoveryPointsRecommendedForMoveClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRecoveryPointsRecommendedForMoveClient().NewListPager("rshvault", "rshhtestmdvmrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", armrecoveryservicesbackup.ListRecoveryPointsRecommendedForMoveRequest{ - ExcludedRPList: []*string{ - to.Ptr("348916168024334"), - to.Ptr("348916168024335")}, - ObjectType: to.Ptr("ListRecoveryPointsRecommendedForMoveRequest"), - }, 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.RecoveryPointResourceList = armrecoveryservicesbackup.RecoveryPointResourceList{ - // Value: []*armrecoveryservicesbackup.RecoveryPointResource{ - // { - // Name: to.Ptr("22244821112382"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/22244821112382"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsSourceVMEncrypted: to.Ptr(false), - // OriginalStorageAccountOption: to.Ptr(false), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // IsReadyForMove: to.Ptr(true), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-21T22:48:25.435Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SourceVMStorageType: to.Ptr("NormalStorage"), - // VirtualMachineSize: to.Ptr("Standard_D1"), - // }, - // }, - // { - // Name: to.Ptr("24977149827250"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/24977149827250"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsSourceVMEncrypted: to.Ptr(false), - // OriginalStorageAccountOption: to.Ptr(false), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // IsReadyForMove: to.Ptr(true), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - // ExtendedInfo: map[string]*string{ - // "RehydratedRPExpiryTime": to.Ptr("2020-12-21T22:48:25.4353958Z"), - // }, - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusRehydrated), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-20T22:49:44.331Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SourceVMStorageType: to.Ptr("NormalStorage"), - // VirtualMachineSize: to.Ptr("Standard_D1"), - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go index d57d4d827410..0b7d799fffbf 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go @@ -45,7 +45,7 @@ func NewResourceGuardProxiesClient(subscriptionID string, credential azcore.Toke // NewGetPager - List the ResourceGuardProxies under vault // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ResourceGuardProxiesClientGetOptions contains the optional parameters for the ResourceGuardProxiesClient.NewGetPager @@ -93,7 +93,7 @@ func (client *ResourceGuardProxiesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go deleted file mode 100644 index 79b58107cd02..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go +++ /dev/null @@ -1,65 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json -func ExampleResourceGuardProxiesClient_NewGetPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceGuardProxiesClient().NewGetPager("sampleVault", "SampleResourceGroup", 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.ResourceGuardProxyBaseResourceList = armrecoveryservicesbackup.ResourceGuardProxyBaseResourceList{ - // Value: []*armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ - // { - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies"), - // ID: to.Ptr("/backupmanagement/resources/sampleVault/backupResourceGuardProxies/swaggerExample"), - // Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // LastUpdatedTime: to.Ptr("2021-02-11T12:20:47.8210031Z"), - // ResourceGuardOperationDetails: []*armrecoveryservicesbackup.ResourceGuardOperationDetail{ - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteResourceGuardProxyRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // }, - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/disableSoftDeleteRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // }}, - // ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go index 354513784a3c..1cd89cfbbbf2 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go @@ -46,7 +46,7 @@ func NewResourceGuardProxyClient(subscriptionID string, credential azcore.TokenC // Delete - Delete ResourceGuardProxy under vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ResourceGuardProxyClientDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.Delete @@ -96,7 +96,7 @@ func (client *ResourceGuardProxyClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,7 +105,7 @@ func (client *ResourceGuardProxyClient) deleteCreateRequest(ctx context.Context, // Get - Returns ResourceGuardProxy under vault and with the name referenced in request // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - ResourceGuardProxyClientGetOptions contains the optional parameters for the ResourceGuardProxyClient.Get method. @@ -155,7 +155,7 @@ func (client *ResourceGuardProxyClient) getCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +173,7 @@ func (client *ResourceGuardProxyClient) getHandleResponse(resp *http.Response) ( // Put - Add or Update ResourceGuardProxy under vault Secures vault critical operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - Request body for operation @@ -224,7 +224,7 @@ func (client *ResourceGuardProxyClient) putCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -245,7 +245,7 @@ func (client *ResourceGuardProxyClient) putHandleResponse(resp *http.Response) ( // UnlockDelete - Secures delete ResourceGuardProxy operations. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - Request body for operation @@ -297,7 +297,7 @@ func (client *ResourceGuardProxyClient) unlockDeleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go deleted file mode 100644 index a8f6ed522185..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go +++ /dev/null @@ -1,145 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json -func ExampleResourceGuardProxyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceGuardProxyClient().Get(ctx, "sampleVault", "SampleResourceGroup", "swaggerExample", 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.ResourceGuardProxyBaseResource = armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies"), - // ID: to.Ptr("/backupmanagement/resources/sampleVault/backupResourceGuardProxies/swaggerExample"), - // Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // LastUpdatedTime: to.Ptr("2021-02-11T12:20:47.8210031Z"), - // ResourceGuardOperationDetails: []*armrecoveryservicesbackup.ResourceGuardOperationDetail{ - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteResourceGuardProxyRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // }, - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/resourceguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/disableSoftDeleteRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // }}, - // ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json -func ExampleResourceGuardProxyClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceGuardProxyClient().Put(ctx, "sampleVault", "SampleResourceGroup", "swaggerExample", armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ - Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ - ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - }, - }, 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.ResourceGuardProxyBaseResource = armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies"), - // ID: to.Ptr("/backupmanagement/resources/sampleVault/backupResourceGuardProxies/swaggerExample"), - // Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // LastUpdatedTime: to.Ptr("2021-02-11T12:20:47.8210031Z"), - // ResourceGuardOperationDetails: []*armrecoveryservicesbackup.ResourceGuardOperationDetail{ - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteResourceGuardProxyRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // }, - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/disableSoftDeleteRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // }}, - // ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json -func ExampleResourceGuardProxyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewResourceGuardProxyClient().Delete(ctx, "sampleVault", "SampleResourceGroup", "swaggerExample", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json -func ExampleResourceGuardProxyClient_UnlockDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceGuardProxyClient().UnlockDelete(ctx, "sampleVault", "SampleResourceGroup", "swaggerExample", armrecoveryservicesbackup.UnlockDeleteRequest{ - ResourceGuardOperationRequests: []*string{ - to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteProtectedItemRequests/default")}, - ResourceToBeDeleted: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/gaallarg/providers/Microsoft.RecoveryServices/vaults/MercuryCrrVault/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;crrtestrg;crrtestvm/protectedItems/SQLDataBase;mssqlserver;testdb"), - }, 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.UnlockDeleteResponse = armrecoveryservicesbackup.UnlockDeleteResponse{ - // UnlockDeleteExpiryTime: to.Ptr("2021-02-11T13:12:27.7870742Z"), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go index 19f2f58c644a..80c72ffe280f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go @@ -47,7 +47,7 @@ func NewRestoresClient(subscriptionID string, credential azcore.TokenCredential, // call, use GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - fabricName - Fabric name associated with the backed up items. @@ -77,7 +77,7 @@ func (client *RestoresClient) BeginTrigger(ctx context.Context, vaultName string // use GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 func (client *RestoresClient) trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters RestoreRequestResource, options *RestoresClientBeginTriggerOptions) (*http.Response, error) { var err error const operationName = "RestoresClient.BeginTrigger" @@ -135,7 +135,7 @@ func (client *RestoresClient) triggerCreateRequest(ctx context.Context, vaultNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.XMSAuthorizationAuxiliary != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go deleted file mode 100644 index 5806020f31ca..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go +++ /dev/null @@ -1,271 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json -func ExampleRestoresClient_BeginTrigger_restoreDisksWithIaasVmRestoreRequest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - TargetDiskNetworkAccessSettings: &armrecoveryservicesbackup.TargetDiskNetworkAccessSettings{ - TargetDiskAccessID: to.Ptr("/subscriptions/e7a191f5-713c-4bdb-b5e4-cf3dd90230ef/resourceGroups/arpja/providers/Microsoft.Compute/diskAccesses/arpja-diskaccess-ccy"), - TargetDiskNetworkAccessOption: to.Ptr(armrecoveryservicesbackup.TargetDiskNetworkAccessOptionEnablePrivateAccessForAllDisks), - }, - }, - }, &armrecoveryservicesbackup.RestoresClientBeginTriggerOptions{XMSAuthorizationAuxiliary: 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json -func ExampleRestoresClient_BeginTrigger_restoreDisksWithIaasVmRestoreRequestWithIdentityBasedRestoreDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityBasedRestoreDetails: &armrecoveryservicesbackup.IdentityBasedRestoreDetails{ - TargetStorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - }, - }, &armrecoveryservicesbackup.RestoresClientBeginTriggerOptions{XMSAuthorizationAuxiliary: 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json -func ExampleRestoresClient_BeginTrigger_restoreDisksWithIaasVmRestoreWithRehydrationRequest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMRestoreWithRehydrationRequest{ - ObjectType: to.Ptr("IaasVMRestoreWithRehydrationRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - RecoveryPointRehydrationInfo: &armrecoveryservicesbackup.RecoveryPointRehydrationInfo{ - RehydrationPriority: to.Ptr(armrecoveryservicesbackup.RehydrationPriorityStandard), - RehydrationRetentionDuration: to.Ptr("P7D"), - }, - }, - }, &armrecoveryservicesbackup.RestoresClientBeginTriggerOptions{XMSAuthorizationAuxiliary: 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json -func ExampleRestoresClient_BeginTrigger_restoreToNewAzureIaasVmWithIaasVmRestoreRequest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(false), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(true), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeAlternateLocation), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount"), - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default"), - TargetResourceGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2"), - TargetVirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435"), - VirtualNetworkID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet"), - }, - }, &armrecoveryservicesbackup.RestoresClientBeginTriggerOptions{XMSAuthorizationAuxiliary: 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json -func ExampleRestoresClient_BeginTrigger_restoreToNewAzureIaasVmWithIaasVmRestoreRequestWithIdentityBasedRestoreDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(false), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityBasedRestoreDetails: &armrecoveryservicesbackup.IdentityBasedRestoreDetails{ - TargetStorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount"), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(true), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeAlternateLocation), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default"), - TargetResourceGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2"), - TargetVirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435"), - VirtualNetworkID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet"), - }, - }, &armrecoveryservicesbackup.RestoresClientBeginTriggerOptions{XMSAuthorizationAuxiliary: 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/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json -func ExampleRestoresClient_BeginTrigger_restoreToNewAzureIaasVmWithIaasVmRestoreWithRehydrationRequest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMRestoreWithRehydrationRequest{ - ObjectType: to.Ptr("IaasVMRestoreWithRehydrationRequest"), - CreateNewCloudService: to.Ptr(false), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeAlternateLocation), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount"), - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default"), - TargetResourceGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2"), - TargetVirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435"), - VirtualNetworkID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet"), - RecoveryPointRehydrationInfo: &armrecoveryservicesbackup.RecoveryPointRehydrationInfo{ - RehydrationPriority: to.Ptr(armrecoveryservicesbackup.RehydrationPriorityHigh), - RehydrationRetentionDuration: to.Ptr("P7D"), - }, - }, - }, &armrecoveryservicesbackup.RestoresClientBeginTriggerOptions{XMSAuthorizationAuxiliary: 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/recoveryservices/armrecoveryservicesbackup/securitypins_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client.go index 4ff0d3b5b06e..da24bd71a6e7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client.go @@ -46,7 +46,7 @@ func NewSecurityPINsClient(subscriptionID string, credential azcore.TokenCredent // Get - Get the security PIN. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - options - SecurityPINsClientGetOptions contains the optional parameters for the SecurityPINsClient.Get method. @@ -92,7 +92,7 @@ func (client *SecurityPINsClient) getCreateRequest(ctx context.Context, vaultNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.XMSAuthorizationAuxiliary != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client_example_test.go deleted file mode 100644 index 53b96addf7ac..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/Common/BackupSecurityPin_Get.json -func ExampleSecurityPINsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityPINsClient().Get(ctx, "SwaggerTest", "SwaggerTestRg", &armrecoveryservicesbackup.SecurityPINsClientGetOptions{XMSAuthorizationAuxiliary: nil, - Parameters: 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.TokenInformation = armrecoveryservicesbackup.TokenInformation{ - // ExpiryTimeInUTCTicks: to.Ptr[int64](636495150137443100), - // SecurityPIN: to.Ptr("200432"), - // Token: to.Ptr("200432"), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/tieringcostoperationstatus_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/tieringcostoperationstatus_client.go index de107e329293..6b9d03f56cbd 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/tieringcostoperationstatus_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/tieringcostoperationstatus_client.go @@ -46,7 +46,7 @@ func NewTieringCostOperationStatusClient(subscriptionID string, credential azcor // Get - Gets the status of async operations of tiering cost // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - vaultName - The name of the recovery services vault. // - options - TieringCostOperationStatusClientGetOptions contains the optional parameters for the TieringCostOperationStatusClient.Get @@ -97,7 +97,7 @@ func (client *TieringCostOperationStatusClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/tieringcostoperationstatus_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/tieringcostoperationstatus_client_example_test.go deleted file mode 100644 index 078f1c1fa0f6..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/tieringcostoperationstatus_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/TieringCost/GetTieringCostOperationStatus.json -func ExampleTieringCostOperationStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTieringCostOperationStatusClient().Get(ctx, "gaallaRG", "gaallavaultbvtd2msi", "0f48183b-0a44-4dca-aec1-bba5daab888a", 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.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.590Z"); return t}()), - // ID: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.590Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go index 2fe0dc5ae8c8..aa7e533eb39c 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go @@ -47,7 +47,7 @@ func NewValidateOperationClient(subscriptionID string, credential azcore.TokenCr // headers which can be tracked using GetValidateOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - parameters - resource validate operation request @@ -74,7 +74,7 @@ func (client *ValidateOperationClient) BeginTrigger(ctx context.Context, vaultNa // which can be tracked using GetValidateOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 func (client *ValidateOperationClient) trigger(ctx context.Context, vaultName string, resourceGroupName string, parameters ValidateOperationRequestResource, options *ValidateOperationClientBeginTriggerOptions) (*http.Response, error) { var err error const operationName = "ValidateOperationClient.BeginTrigger" @@ -116,7 +116,7 @@ func (client *ValidateOperationClient) triggerCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go deleted file mode 100644 index ad991ed2f7ba..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go +++ /dev/null @@ -1,62 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/TriggerValidateOperation_RestoreDisk.json -func ExampleValidateOperationClient_BeginTrigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewValidateOperationClient().BeginTrigger(ctx, "testVault", "testRG", armrecoveryservicesbackup.ValidateOperationRequestResource{ - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testVault/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;testRG;testvmName/protectedItems/VM;iaasvmcontainerv2;testRG;testvmName/recoveryPoints/348916168024334"), - Properties: &armrecoveryservicesbackup.ValidateIaasVMRestoreOperationRequest{ - ObjectType: to.Ptr("ValidateIaasVMRestoreOperationRequest"), - RestoreRequest: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - }, - }, 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/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go index b17c59edecc8..f8d2fe6ea48f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go @@ -46,7 +46,7 @@ func NewValidateOperationResultsClient(subscriptionID string, credential azcore. // Get - Fetches the result of a triggered validate operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - operationID - OperationID which represents the operation whose result needs to be fetched. @@ -98,7 +98,7 @@ func (client *ValidateOperationResultsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go deleted file mode 100644 index 285ca3fa9c47..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go +++ /dev/null @@ -1,49 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperationResults.json -func ExampleValidateOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewValidateOperationResultsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", 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.ValidateOperationsResponse = armrecoveryservicesbackup.ValidateOperationsResponse{ - // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ - // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ - // { - // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), - // Message: to.Ptr("Core Count subscription quota has been reached."), - // Recommendations: []*string{ - // to.Ptr("Contact Azure support to increase the limits.")}, - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go index 437acbcdca26..ed509a1e70f3 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go @@ -48,7 +48,7 @@ func NewValidateOperationStatusesClient(subscriptionID string, credential azcore // operation has completed, this method returns the list of errors obtained while validating the operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-04-01 +// Generated from API version 2024-10-01 // - vaultName - The name of the recovery services vault. // - resourceGroupName - The name of the resource group where the recovery services vault is present. // - operationID - OperationID represents the operation whose status needs to be fetched. @@ -100,7 +100,7 @@ func (client *ValidateOperationStatusesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-04-01") + reqQP.Set("api-version", "2024-10-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go deleted file mode 100644 index 4a63cb5fb546..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go +++ /dev/null @@ -1,57 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v4" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/33c4457b1d13f83965f4fe3367dca4a6df898100/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2024-04-01/examples/AzureIaasVm/ValidateOperationStatus.json -func ExampleValidateOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewValidateOperationStatusesClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", 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.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207Z"); return t}()), - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.OperationStatusValidateOperationExtendedInfo{ - // ObjectType: to.Ptr("OperationStatusValidateOperationExtendedInfo"), - // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ - // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ - // { - // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), - // Message: to.Ptr("Core Count subscription quota has been reached."), - // Recommendations: []*string{ - // to.Ptr("Contact Azure support to increase the limits.")}, - // }}, - // }, - // }, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -}