diff --git a/sdk/resourcemanager/compute/armcompute/CHANGELOG.md b/sdk/resourcemanager/compute/armcompute/CHANGELOG.md index 051813c3bc44..25237104852c 100644 --- a/sdk/resourcemanager/compute/armcompute/CHANGELOG.md +++ b/sdk/resourcemanager/compute/armcompute/CHANGELOG.md @@ -1,5 +1,81 @@ # Release History +## 2.0.0 (2022-05-17) +### Breaking Changes + +- Type of `GalleryApplicationVersionProperties.ProvisioningState` has been changed from `*GalleryApplicationVersionPropertiesProvisioningState` to `*GalleryProvisioningState` +- Type of `GalleryImageProperties.ProvisioningState` has been changed from `*GalleryImagePropertiesProvisioningState` to `*GalleryProvisioningState` +- Type of `GalleryImageVersionProperties.ProvisioningState` has been changed from `*GalleryImageVersionPropertiesProvisioningState` to `*GalleryProvisioningState` +- Type of `GalleryProperties.ProvisioningState` has been changed from `*GalleryPropertiesProvisioningState` to `*GalleryProvisioningState` +- Const `GalleryImagePropertiesProvisioningStateFailed` has been removed +- Const `GalleryPropertiesProvisioningStateSucceeded` has been removed +- Const `GalleryPropertiesProvisioningStateDeleting` has been removed +- Const `GalleryPropertiesProvisioningStateCreating` has been removed +- Const `GalleryImagePropertiesProvisioningStateMigrating` has been removed +- Const `GalleryImagePropertiesProvisioningStateDeleting` has been removed +- Const `GalleryImageVersionPropertiesProvisioningStateCreating` has been removed +- Const `GalleryApplicationVersionPropertiesProvisioningStateUpdating` has been removed +- Const `GalleryImagePropertiesProvisioningStateSucceeded` has been removed +- Const `GalleryPropertiesProvisioningStateFailed` has been removed +- Const `GalleryImageVersionPropertiesProvisioningStateSucceeded` has been removed +- Const `GalleryImageVersionPropertiesProvisioningStateDeleting` has been removed +- Const `GalleryApplicationVersionPropertiesProvisioningStateFailed` has been removed +- Const `GalleryImageVersionPropertiesProvisioningStateFailed` has been removed +- Const `SharingProfileGroupTypesCommunity` has been removed +- Const `GalleryImagePropertiesProvisioningStateUpdating` has been removed +- Const `GalleryPropertiesProvisioningStateUpdating` has been removed +- Const `GalleryPropertiesProvisioningStateMigrating` has been removed +- Const `GalleryApplicationVersionPropertiesProvisioningStateSucceeded` has been removed +- Const `GalleryImageVersionPropertiesProvisioningStateUpdating` has been removed +- Const `GalleryImageVersionPropertiesProvisioningStateMigrating` has been removed +- Const `GalleryApplicationVersionPropertiesProvisioningStateMigrating` has been removed +- Const `GalleryApplicationVersionPropertiesProvisioningStateCreating` has been removed +- Const `GalleryImagePropertiesProvisioningStateCreating` has been removed +- Const `GalleryApplicationVersionPropertiesProvisioningStateDeleting` has been removed +- Function `PossibleGalleryApplicationVersionPropertiesProvisioningStateValues` has been removed +- Function `PossibleGalleryImagePropertiesProvisioningStateValues` has been removed +- Function `PossibleGalleryPropertiesProvisioningStateValues` has been removed +- Function `PossibleGalleryImageVersionPropertiesProvisioningStateValues` has been removed + +### Features Added + +- New const `GalleryProvisioningStateSucceeded` +- New const `GallerySharingPermissionTypesCommunity` +- New const `GalleryProvisioningStateMigrating` +- New const `GalleryProvisioningStateUpdating` +- New const `GalleryProvisioningStateCreating` +- New const `SharedGalleryHostCachingNone` +- New const `GalleryProvisioningStateFailed` +- New const `SharedGalleryHostCachingReadWrite` +- New const `GalleryProvisioningStateDeleting` +- New const `SharedGalleryHostCachingReadOnly` +- New function `*CommunityGalleryImagesClient.NewListPager(string, string, *CommunityGalleryImagesClientListOptions) *runtime.Pager[CommunityGalleryImagesClientListResponse]` +- New function `PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching` +- New function `PossibleGalleryProvisioningStateValues() []GalleryProvisioningState` +- New function `*CommunityGalleryImageVersionsClient.NewListPager(string, string, string, *CommunityGalleryImageVersionsClientListOptions) *runtime.Pager[CommunityGalleryImageVersionsClientListResponse]` +- New struct `CommunityGalleryImageList` +- New struct `CommunityGalleryImageVersionList` +- New struct `CommunityGalleryImageVersionsClientListOptions` +- New struct `CommunityGalleryImageVersionsClientListResponse` +- New struct `CommunityGalleryImagesClientListOptions` +- New struct `CommunityGalleryImagesClientListResponse` +- New struct `SharedGalleryDataDiskImage` +- New struct `SharedGalleryDiskImage` +- New struct `SharedGalleryImageVersionStorageProfile` +- New struct `SharedGalleryOSDiskImage` +- New struct `UserArtifactSettings` +- New field `Architecture` in struct `CommunityGalleryImageProperties` +- New field `PrivacyStatementURI` in struct `CommunityGalleryImageProperties` +- New field `Eula` in struct `CommunityGalleryImageProperties` +- New field `Settings` in struct `GalleryApplicationVersionPublishingProfile` +- New field `AdvancedSettings` in struct `GalleryApplicationVersionPublishingProfile` +- New field `Architecture` in struct `SharedGalleryImageProperties` +- New field `ExcludeFromLatest` in struct `CommunityGalleryImageVersionProperties` +- New field `StorageProfile` in struct `CommunityGalleryImageVersionProperties` +- New field `StorageProfile` in struct `SharedGalleryImageVersionProperties` +- New field `ExcludeFromLatest` in struct `SharedGalleryImageVersionProperties` + + ## 1.0.0 (2022-05-16) ### Breaking Changes diff --git a/sdk/resourcemanager/compute/armcompute/autorest.md b/sdk/resourcemanager/compute/armcompute/autorest.md index 6586bd0dd3d3..60104f0737af 100644 --- a/sdk/resourcemanager/compute/armcompute/autorest.md +++ b/sdk/resourcemanager/compute/armcompute/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/compute/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/compute/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/compute/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/compute/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/compute/armcompute/go.mod b/sdk/resourcemanager/compute/armcompute/go.mod index e33ef4f1438e..a7a43ae1483d 100644 --- a/sdk/resourcemanager/compute/armcompute/go.mod +++ b/sdk/resourcemanager/compute/armcompute/go.mod @@ -4,13 +4,13 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.0.0 github.com/stretchr/testify v1.7.0 ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_availabilitysets_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_availabilitysets_client_test.go deleted file mode 100644 index 1f30e35b5834..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_availabilitysets_client_test.go +++ /dev/null @@ -1,207 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySet_Create.json -func ExampleAvailabilitySetsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myResourceGroup", - "myAvailabilitySet", - armcompute.AvailabilitySet{ - Location: to.Ptr("westus"), - Properties: &armcompute.AvailabilitySetProperties{ - PlatformFaultDomainCount: to.Ptr[int32](2), - PlatformUpdateDomainCount: to.Ptr[int32](20), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySets_Update_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaa", - armcompute.AvailabilitySetUpdate{ - Tags: map[string]*string{ - "key2574": to.Ptr("aaaaaaaa"), - }, - Properties: &armcompute.AvailabilitySetProperties{ - PlatformFaultDomainCount: to.Ptr[int32](2), - PlatformUpdateDomainCount: to.Ptr[int32](20), - ProximityPlacementGroup: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - VirtualMachines: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }}, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("DSv3-Type1"), - Capacity: to.Ptr[int64](7), - Tier: to.Ptr("aaa"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySets_Delete_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySets_Get_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgcompute", - "aaaaaaaaaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySet_ListBySubscription.json -func ExampleAvailabilitySetsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewAvailabilitySetsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armcompute.AvailabilitySetsClientListBySubscriptionOptions{Expand: to.Ptr("virtualMachines\\$ref")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySets_List_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rgcompute", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/availabilitySetExamples/AvailabilitySets_ListAvailableSizes_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListAvailableSizesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewAvailabilitySetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAvailableSizesPager("rgcompute", - "aaaaaaaaaaaaaaaaaaaa", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_capacityreservationgroups_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_capacityreservationgroups_client_test.go deleted file mode 100644 index 720be48e6254..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_capacityreservationgroups_client_test.go +++ /dev/null @@ -1,170 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservationGroup_CreateOrUpdate.json -func ExampleCapacityReservationGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myResourceGroup", - "myCapacityReservationGroup", - armcompute.CapacityReservationGroup{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "department": to.Ptr("finance"), - }, - Zones: []*string{ - to.Ptr("1"), - to.Ptr("2")}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json -func ExampleCapacityReservationGroupsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaa", - armcompute.CapacityReservationGroupUpdate{ - Tags: map[string]*string{ - "key5355": to.Ptr("aaa"), - }, - Properties: &armcompute.CapacityReservationGroupProperties{ - InstanceView: &armcompute.CapacityReservationGroupInstanceView{}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json -func ExampleCapacityReservationGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rgcompute", - "a", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservationGroup_Get.json -func ExampleCapacityReservationGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationGroupsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myCapacityReservationGroup", - &armcompute.CapacityReservationGroupsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservationGroup_ListByResourceGroup.json -func ExampleCapacityReservationGroupsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - &armcompute.CapacityReservationGroupsClientListByResourceGroupOptions{Expand: to.Ptr(armcompute.ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef)}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json -func ExampleCapacityReservationGroupsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armcompute.CapacityReservationGroupsClientListBySubscriptionOptions{Expand: to.Ptr(armcompute.ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef)}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_capacityreservations_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_capacityreservations_client_test.go deleted file mode 100644 index 8b4fbe6749f0..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_capacityreservations_client_test.go +++ /dev/null @@ -1,183 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservation_CreateOrUpdate.json -func ExampleCapacityReservationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myCapacityReservationGroup", - "myCapacityReservation", - armcompute.CapacityReservation{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "department": to.Ptr("HR"), - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_DS1_v2"), - Capacity: to.Ptr[int64](4), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json -func ExampleCapacityReservationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rgcompute", - "aaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaa", - armcompute.CapacityReservationUpdate{ - Tags: map[string]*string{ - "key4974": to.Ptr("aaaaaaaaaaaaaaaa"), - }, - Properties: &armcompute.CapacityReservationProperties{ - InstanceView: &armcompute.CapacityReservationInstanceView{ - Statuses: []*armcompute.InstanceViewStatus{ - { - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }}, - UtilizationInfo: &armcompute.CapacityReservationUtilization{}, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("DSv3-Type1"), - Capacity: to.Ptr[int64](7), - Tier: to.Ptr("aaa"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json -func ExampleCapacityReservationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rgcompute", - "aaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservation_Get.json -func ExampleCapacityReservationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myCapacityReservationGroup", - "myCapacityReservation", - &armcompute.CapacityReservationsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/capacityReservationExamples/CapacityReservation_ListByReservationGroup.json -func ExampleCapacityReservationsClient_NewListByCapacityReservationGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCapacityReservationsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByCapacityReservationGroupPager("myResourceGroup", - "myCapacityReservationGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudserviceoperatingsystems_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudserviceoperatingsystems_client_test.go deleted file mode 100644 index 2daea125ced5..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudserviceoperatingsystems_client_test.go +++ /dev/null @@ -1,111 +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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSVersion.json -func ExampleCloudServiceOperatingSystemsClient_GetOSVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceOperatingSystemsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetOSVersion(ctx, - "westus2", - "WA-GUEST-OS-3.90_202010-02", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSVersions.json -func ExampleCloudServiceOperatingSystemsClient_NewListOSVersionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceOperatingSystemsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListOSVersionsPager("westus2", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceOSFamily.json -func ExampleCloudServiceOperatingSystemsClient_GetOSFamily() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceOperatingSystemsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetOSFamily(ctx, - "westus2", - "3", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceOSFamilies.json -func ExampleCloudServiceOperatingSystemsClient_NewListOSFamiliesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceOperatingSystemsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListOSFamiliesPager("westus2", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudserviceroleinstances_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudserviceroleinstances_client_test.go deleted file mode 100644 index 45235d159d6a..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudserviceroleinstances_client_test.go +++ /dev/null @@ -1,189 +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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstance.json -func ExampleCloudServiceRoleInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "{roleInstance-name}", - "ConstosoRG", - "{cs-name}", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRoleInstance.json -func ExampleCloudServiceRoleInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "{roleInstance-name}", - "ConstosoRG", - "{cs-name}", - &armcompute.CloudServiceRoleInstancesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetInstanceViewOfCloudServiceRoleInstance.json -func ExampleCloudServiceRoleInstancesClient_GetInstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetInstanceView(ctx, - "{roleInstance-name}", - "ConstosoRG", - "{cs-name}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRolesInstances.json -func ExampleCloudServiceRoleInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("ConstosoRG", - "{cs-name}", - &armcompute.CloudServiceRoleInstancesClientListOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstance.json -func ExampleCloudServiceRoleInstancesClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestart(ctx, - "{roleInstance-name}", - "ConstosoRG", - "{cs-name}", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstance.json -func ExampleCloudServiceRoleInstancesClient_BeginReimage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginReimage(ctx, - "{roleInstance-name}", - "ConstosoRG", - "{cs-name}", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstance.json -func ExampleCloudServiceRoleInstancesClient_BeginRebuild() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceRoleInstancesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRebuild(ctx, - "{roleInstance-name}", - "ConstosoRG", - "{cs-name}", - 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/compute/armcompute/ze_generated_example_cloudserviceroles_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudserviceroles_client_test.go deleted file mode 100644 index 64a3a537593f..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudserviceroles_client_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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceRole.json -func ExampleCloudServiceRolesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceRolesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "{role-name}", - "ConstosoRG", - "{cs-name}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceRoles.json -func ExampleCloudServiceRolesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServiceRolesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("ConstosoRG", - "{cs-name}", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudservices_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudservices_client_test.go deleted file mode 100644 index c72ed1a942b0..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudservices_client_test.go +++ /dev/null @@ -1,400 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/CreateCloudServiceWithMultiRole.json -func ExampleCloudServicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "ConstosoRG", - "{cs-name}", - &armcompute.CloudServicesClientBeginCreateOrUpdateOptions{Parameters: &armcompute.CloudService{ - Location: to.Ptr("westus"), - Properties: &armcompute.CloudServiceProperties{ - Configuration: to.Ptr("{ServiceConfiguration}"), - NetworkProfile: &armcompute.CloudServiceNetworkProfile{ - LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ - { - Name: to.Ptr("contosolb"), - Properties: &armcompute.LoadBalancerConfigurationProperties{ - FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ - { - Name: to.Ptr("contosofe"), - Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ - PublicIPAddress: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip"), - }, - }, - }}, - }, - }}, - }, - PackageURL: to.Ptr("{PackageUrl}"), - RoleProfile: &armcompute.CloudServiceRoleProfile{ - Roles: []*armcompute.CloudServiceRoleProfileProperties{ - { - Name: to.Ptr("ContosoFrontend"), - SKU: &armcompute.CloudServiceRoleSKU{ - Name: to.Ptr("Standard_D1_v2"), - Capacity: to.Ptr[int64](1), - Tier: to.Ptr("Standard"), - }, - }, - { - Name: to.Ptr("ContosoBackend"), - SKU: &armcompute.CloudServiceRoleSKU{ - Name: to.Ptr("Standard_D1_v2"), - Capacity: to.Ptr[int64](1), - Tier: to.Ptr("Standard"), - }, - }}, - }, - UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - }, - }, - }) - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceToIncludeTags.json -func ExampleCloudServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "ConstosoRG", - "{cs-name}", - &armcompute.CloudServicesClientBeginUpdateOptions{Parameters: &armcompute.CloudServiceUpdate{ - Tags: map[string]*string{ - "Documentation": to.Ptr("RestAPI"), - }, - }, - }) - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudService.json -func ExampleCloudServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "ConstosoRG", - "{cs-name}", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceWithMultiRoleAndRDP.json -func ExampleCloudServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ConstosoRG", - "{cs-name}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceInstanceViewWithMultiRole.json -func ExampleCloudServicesClient_GetInstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetInstanceView(ctx, - "ConstosoRG", - "{cs-name}", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInSubscription.json -func ExampleCloudServicesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAllPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServicesInResourceGroup.json -func ExampleCloudServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("ConstosoRG", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/StartCloudService.json -func ExampleCloudServicesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "ConstosoRG", - "{cs-name}", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/PowerOffCloudService.json -func ExampleCloudServicesClient_BeginPowerOff() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPowerOff(ctx, - "ConstosoRG", - "{cs-name}", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RestartCloudServiceRoleInstances.json -func ExampleCloudServicesClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestart(ctx, - "ConstosoRG", - "{cs-name}", - &armcompute.CloudServicesClientBeginRestartOptions{Parameters: &armcompute.RoleInstances{ - RoleInstances: []*string{ - to.Ptr("ContosoFrontend_IN_0"), - to.Ptr("ContosoBackend_IN_1")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ReimageCloudServiceRoleInstances.json -func ExampleCloudServicesClient_BeginReimage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginReimage(ctx, - "ConstosoRG", - "{cs-name}", - &armcompute.CloudServicesClientBeginReimageOptions{Parameters: &armcompute.RoleInstances{ - RoleInstances: []*string{ - to.Ptr("ContosoFrontend_IN_0"), - to.Ptr("ContosoBackend_IN_1")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/RebuildCloudServiceRoleInstances.json -func ExampleCloudServicesClient_BeginRebuild() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRebuild(ctx, - "ConstosoRG", - "{cs-name}", - &armcompute.CloudServicesClientBeginRebuildOptions{Parameters: &armcompute.RoleInstances{ - RoleInstances: []*string{ - to.Ptr("ContosoFrontend_IN_0"), - to.Ptr("ContosoBackend_IN_1")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/DeleteCloudServiceRoleInstances.json -func ExampleCloudServicesClient_BeginDeleteInstances() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteInstances(ctx, - "ConstosoRG", - "{cs-name}", - &armcompute.CloudServicesClientBeginDeleteInstancesOptions{Parameters: &armcompute.RoleInstances{ - RoleInstances: []*string{ - to.Ptr("ContosoFrontend_IN_0"), - to.Ptr("ContosoBackend_IN_1")}, - }, - }) - 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/compute/armcompute/ze_generated_example_cloudservicesupdatedomain_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudservicesupdatedomain_client_test.go deleted file mode 100644 index fb5ace112aaa..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_cloudservicesupdatedomain_client_test.go +++ /dev/null @@ -1,91 +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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/UpdateCloudServiceUpdateDomain.json -func ExampleCloudServicesUpdateDomainClient_BeginWalkUpdateDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesUpdateDomainClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginWalkUpdateDomain(ctx, - "ConstosoRG", - "{cs-name}", - 1, - &armcompute.CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions{Parameters: 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/GetCloudServiceUpdateDomain.json -func ExampleCloudServicesUpdateDomainClient_GetUpdateDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesUpdateDomainClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetUpdateDomain(ctx, - "ConstosoRG", - "{cs-name}", - 1, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-03-01/examples/ListCloudServiceUpdateDomains.json -func ExampleCloudServicesUpdateDomainClient_NewListUpdateDomainsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCloudServicesUpdateDomainClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListUpdateDomainsPager("ConstosoRG", - "{cs-name}", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_communitygalleries_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_communitygalleries_client_test.go deleted file mode 100644 index 6f9277edad57..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_communitygalleries_client_test.go +++ /dev/null @@ -1,39 +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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGallery.json -func ExampleCommunityGalleriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCommunityGalleriesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myLocation", - "publicGalleryName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_communitygalleryimages_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_communitygalleryimages_client_test.go deleted file mode 100644 index c187f7eb0936..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_communitygalleryimages_client_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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImage.json -func ExampleCommunityGalleryImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCommunityGalleryImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myLocation", - "publicGalleryName", - "myGalleryImageName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_communitygalleryimageversions_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_communitygalleryimageversions_client_test.go deleted file mode 100644 index 2618d1cef09e..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_communitygalleryimageversions_client_test.go +++ /dev/null @@ -1,41 +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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/communityGallery/GetACommunityGalleryImageVersion.json -func ExampleCommunityGalleryImageVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewCommunityGalleryImageVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myLocation", - "publicGalleryName", - "myGalleryImageName", - "myGalleryImageVersionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_dedicatedhostgroups_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_dedicatedhostgroups_client_test.go deleted file mode 100644 index 4c9da70bd85f..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_dedicatedhostgroups_client_test.go +++ /dev/null @@ -1,201 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json -func ExampleDedicatedHostGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myResourceGroup", - "myDedicatedHostGroup", - armcompute.DedicatedHostGroup{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "department": to.Ptr("finance"), - }, - Properties: &armcompute.DedicatedHostGroupProperties{ - AdditionalCapabilities: &armcompute.DedicatedHostGroupPropertiesAdditionalCapabilities{ - UltraSSDEnabled: to.Ptr(true), - }, - PlatformFaultDomainCount: to.Ptr[int32](3), - SupportAutomaticPlacement: to.Ptr(true), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHostGroups_Update_MaximumSet_Gen.json -func ExampleDedicatedHostGroupsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rgcompute", - "aaaa", - armcompute.DedicatedHostGroupUpdate{ - Tags: map[string]*string{ - "key9921": to.Ptr("aaaaaaaaaa"), - }, - Properties: &armcompute.DedicatedHostGroupProperties{ - InstanceView: &armcompute.DedicatedHostGroupInstanceView{ - Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ - { - AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ - AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ - { - Count: to.Ptr[float64](26), - VMSize: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - }}, - }, - Statuses: []*armcompute.InstanceViewStatus{ - { - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }}, - }}, - }, - PlatformFaultDomainCount: to.Ptr[int32](3), - SupportAutomaticPlacement: to.Ptr(true), - }, - Zones: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHostGroups_Delete_MaximumSet_Gen.json -func ExampleDedicatedHostGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rgcompute", - "a", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json -func ExampleDedicatedHostGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostGroupsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myDedicatedHostGroup", - &armcompute.DedicatedHostGroupsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHostGroups_ListByResourceGroup_MaximumSet_Gen.json -func ExampleDedicatedHostGroupsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("rgcompute", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHostGroups_ListBySubscription_MaximumSet_Gen.json -func ExampleDedicatedHostGroupsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_dedicatedhosts_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_dedicatedhosts_client_test.go deleted file mode 100644 index 8a9290eb6a1f..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_dedicatedhosts_client_test.go +++ /dev/null @@ -1,212 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHost_CreateOrUpdate.json -func ExampleDedicatedHostsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myDedicatedHostGroup", - "myDedicatedHost", - armcompute.DedicatedHost{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "department": to.Ptr("HR"), - }, - Properties: &armcompute.DedicatedHostProperties{ - PlatformFaultDomain: to.Ptr[int32](1), - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("DSv3-Type1"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHosts_Update_MaximumSet_Gen.json -func ExampleDedicatedHostsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rgcompute", - "aaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaa", - armcompute.DedicatedHostUpdate{ - Tags: map[string]*string{ - "key8813": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - }, - Properties: &armcompute.DedicatedHostProperties{ - AutoReplaceOnFailure: to.Ptr(true), - InstanceView: &armcompute.DedicatedHostInstanceView{ - AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ - AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ - { - Count: to.Ptr[float64](26), - VMSize: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - }}, - }, - Statuses: []*armcompute.InstanceViewStatus{ - { - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }}, - }, - LicenseType: to.Ptr(armcompute.DedicatedHostLicenseTypesWindowsServerHybrid), - PlatformFaultDomain: to.Ptr[int32](1), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHosts_Delete_MaximumSet_Gen.json -func ExampleDedicatedHostsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rgcompute", - "aaaaaa", - "aaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHost_Get.json -func ExampleDedicatedHostsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostsClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myDedicatedHostGroup", - "myHost", - &armcompute.DedicatedHostsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHosts_ListByHostGroup_MaximumSet_Gen.json -func ExampleDedicatedHostsClient_NewListByHostGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHostGroupPager("rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/dedicatedHostExamples/DedicatedHost_Restart.json -func ExampleDedicatedHostsClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDedicatedHostsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestart(ctx, - "myResourceGroup", - "myDedicatedHostGroup", - "myHost", - 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/compute/armcompute/ze_generated_example_diskaccesses_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_diskaccesses_client_test.go deleted file mode 100644 index 01810edb84bd..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_diskaccesses_client_test.go +++ /dev/null @@ -1,305 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskAccess.json -func ExampleDiskAccessesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myDiskAccess", - armcompute.DiskAccess{ - Location: to.Ptr("West US"), - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskAccess.json -func ExampleDiskAccessesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myDiskAccess", - armcompute.DiskAccessUpdate{ - Tags: map[string]*string{ - "department": to.Ptr("Development"), - "project": to.Ptr("PrivateEndpoints"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskAccessWithPrivateEndpoints.json -func ExampleDiskAccessesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myDiskAccess", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskAccess.json -func ExampleDiskAccessesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myDiskAccess", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInAResourceGroup.json -func ExampleDiskAccessesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskAccessesInASubscription.json -func ExampleDiskAccessesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskAccessPrivateLinkResources.json -func ExampleDiskAccessesClient_GetPrivateLinkResources() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetPrivateLinkResources(ctx, - "myResourceGroup", - "myDiskAccess", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ApprovePrivateEndpointConnection.json -func ExampleDiskAccessesClient_BeginUpdateAPrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateAPrivateEndpointConnection(ctx, - "myResourceGroup", - "myDiskAccess", - "myPrivateEndpointConnection", - armcompute.PrivateEndpointConnection{ - Properties: &armcompute.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approving myPrivateEndpointConnection"), - Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAPrivateEndpointConnection.json -func ExampleDiskAccessesClient_GetAPrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAPrivateEndpointConnection(ctx, - "myResourceGroup", - "myDiskAccess", - "myPrivateEndpointConnection", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAPrivateEndpointConnection.json -func ExampleDiskAccessesClient_BeginDeleteAPrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteAPrivateEndpointConnection(ctx, - "myResourceGroup", - "myDiskAccess", - "myPrivateEndpointConnection", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListPrivateEndpointConnectionsInADiskAccess.json -func ExampleDiskAccessesClient_NewListPrivateEndpointConnectionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskAccessesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPrivateEndpointConnectionsPager("myResourceGroup", - "myDiskAccess", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_diskencryptionsets_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_diskencryptionsets_client_test.go deleted file mode 100644 index bc8914abb777..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_diskencryptionsets_client_test.go +++ /dev/null @@ -1,215 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateADiskEncryptionSetWithKeyVaultFromADifferentSubscription.json -func ExampleDiskEncryptionSetsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myDiskEncryptionSet", - armcompute.DiskEncryptionSet{ - Location: to.Ptr("West US"), - Identity: &armcompute.EncryptionSetIdentity{ - Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), - }, - Properties: &armcompute.EncryptionSetProperties{ - ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - KeyURL: to.Ptr("https://myvaultdifferentsub.vault-int.azure-int.net/keys/{key}"), - }, - EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateADiskEncryptionSetWithRotationToLatestKeyVersionEnabled.json -func ExampleDiskEncryptionSetsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myDiskEncryptionSet", - armcompute.DiskEncryptionSetUpdate{ - Identity: &armcompute.EncryptionSetIdentity{ - Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), - }, - Properties: &armcompute.DiskEncryptionSetUpdateProperties{ - ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - KeyURL: to.Ptr("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1"), - }, - EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - RotationToLatestKeyVersionEnabled: to.Ptr(true), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutADiskEncryptionSetWithAutoKeyRotationError.json -func ExampleDiskEncryptionSetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myDiskEncryptionSet", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteADiskEncryptionSet.json -func ExampleDiskEncryptionSetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myDiskEncryptionSet", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInAResourceGroup.json -func ExampleDiskEncryptionSetsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetsInASubscription.json -func ExampleDiskEncryptionSetsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskEncryptionSetAssociatedResources.json -func ExampleDiskEncryptionSetsClient_NewListAssociatedResourcesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskEncryptionSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAssociatedResourcesPager("myResourceGroup", - "myDiskEncryptionSet", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_diskrestorepoint_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_diskrestorepoint_client_test.go deleted file mode 100644 index b19916f704c1..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_diskrestorepoint_client_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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetDiskRestorePointResources.json -func ExampleDiskRestorePointClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskRestorePointClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "rpc", - "vmrp", - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListDiskRestorePointsInVmRestorePoint.json -func ExampleDiskRestorePointClient_NewListByRestorePointPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskRestorePointClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByRestorePointPager("myResourceGroup", - "rpc", - "vmrp", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessDiskRestorePoint.json -func ExampleDiskRestorePointClient_BeginGrantAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskRestorePointClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginGrantAccess(ctx, - "myResourceGroup", - "rpc", - "vmrp", - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", - armcompute.GrantAccessData{ - Access: to.Ptr(armcompute.AccessLevelRead), - DurationInSeconds: to.Ptr[int32](300), - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessDiskRestorePoint.json -func ExampleDiskRestorePointClient_BeginRevokeAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDiskRestorePointClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRevokeAccess(ctx, - "myResourceGroup", - "rpc", - "vmrp", - "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", - 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/compute/armcompute/ze_generated_example_disks_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_disks_client_test.go deleted file mode 100644 index cd39845b9432..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_disks_client_test.go +++ /dev/null @@ -1,241 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateAConfidentialVMDiskEncryptedWithCMK.json -func ExampleDisksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myDisk", - armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - ImageReference: &armcompute.ImageDiskReference{ - ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/westus/Publishers/{publisher}/ArtifactTypes/VMImage/Offers/{offer}/Skus/{sku}/Versions/1.0.0"), - }, - }, - OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - SecurityProfile: &armcompute.DiskSecurityProfile{ - SecureVMDiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - SecurityType: to.Ptr(armcompute.DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey), - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateOrUpdateABurstingEnabledManagedDisk.json -func ExampleDisksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myDisk", - armcompute.DiskUpdate{ - Properties: &armcompute.DiskUpdateProperties{ - BurstingEnabled: to.Ptr(true), - DiskSizeGB: to.Ptr[int32](1024), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutAManagedDisk.json -func ExampleDisksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myManagedDisk", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteAManagedDisk.json -func ExampleDisksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myDisk", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInAResourceGroup.json -func ExampleDisksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListManagedDisksInASubscription.json -func ExampleDisksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessManagedDisk.json -func ExampleDisksClient_BeginGrantAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginGrantAccess(ctx, - "myResourceGroup", - "myDisk", - armcompute.GrantAccessData{ - Access: to.Ptr(armcompute.AccessLevelRead), - DurationInSeconds: to.Ptr[int32](300), - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessManagedDisk.json -func ExampleDisksClient_BeginRevokeAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewDisksClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRevokeAccess(ctx, - "myResourceGroup", - "myDisk", - 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/compute/armcompute/ze_generated_example_galleries_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleries_client_test.go deleted file mode 100644 index 4576643a794c..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleries_client_test.go +++ /dev/null @@ -1,187 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateACommunityGallery.json -func ExampleGalleriesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myGalleryName", - armcompute.Gallery{ - Location: to.Ptr("West US"), - Properties: &armcompute.GalleryProperties{ - Description: to.Ptr("This is the gallery description."), - SharingProfile: &armcompute.SharingProfile{ - CommunityGalleryInfo: map[string]interface{}{ - "eula": "eula", - "publicNamePrefix": "PirPublic", - "publisherContact": "pir@microsoft.com", - "publisherUri": "uri", - }, - Permissions: to.Ptr(armcompute.GallerySharingPermissionTypes("Community")), - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGallery.json -func ExampleGalleriesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myGalleryName", - armcompute.GalleryUpdate{ - Properties: &armcompute.GalleryProperties{ - Description: to.Ptr("This is the gallery description."), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetACommunityGallery.json -func ExampleGalleriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myGalleryName", - &armcompute.GalleriesClientGetOptions{Select: nil, - Expand: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGallery.json -func ExampleGalleriesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myGalleryName", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInAResourceGroup.json -func ExampleGalleriesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleriesInASubscription.json -func ExampleGalleriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleriesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryapplications_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryapplications_client_test.go deleted file mode 100644 index d4b25d9899f1..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryapplications_client_test.go +++ /dev/null @@ -1,165 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplication.json -func ExampleGalleryApplicationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryApplicationsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryApplicationName", - armcompute.GalleryApplication{ - Location: to.Ptr("West US"), - Properties: &armcompute.GalleryApplicationProperties{ - Description: to.Ptr("This is the gallery application description."), - Eula: to.Ptr("This is the gallery application EULA."), - PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), - ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), - SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplication.json -func ExampleGalleryApplicationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryApplicationsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryApplicationName", - armcompute.GalleryApplicationUpdate{ - Properties: &armcompute.GalleryApplicationProperties{ - Description: to.Ptr("This is the gallery application description."), - Eula: to.Ptr("This is the gallery application EULA."), - PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), - ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), - SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplication.json -func ExampleGalleryApplicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryApplicationsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryApplicationName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplication.json -func ExampleGalleryApplicationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryApplicationsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryApplicationName", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationsInAGallery.json -func ExampleGalleryApplicationsClient_NewListByGalleryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryApplicationsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByGalleryPager("myResourceGroup", - "myGalleryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryapplicationversions_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryapplicationversions_client_test.go deleted file mode 100644 index eea0a03ee5b5..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryapplicationversions_client_test.go +++ /dev/null @@ -1,198 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryApplicationVersion.json -func ExampleGalleryApplicationVersionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryApplicationName", - "1.0.0", - armcompute.GalleryApplicationVersion{ - Location: to.Ptr("West US"), - Properties: &armcompute.GalleryApplicationVersionProperties{ - PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ - EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00Z"); return t }()), - ReplicaCount: to.Ptr[int32](1), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - TargetRegions: []*armcompute.TargetRegion{ - { - Name: to.Ptr("West US"), - RegionalReplicaCount: to.Ptr[int32](1), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - }}, - ManageActions: &armcompute.UserArtifactManage{ - Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), - Remove: to.Ptr("del C:\\package "), - }, - Source: &armcompute.UserArtifactSource{ - MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), - }, - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryApplicationVersion.json -func ExampleGalleryApplicationVersionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryApplicationName", - "1.0.0", - armcompute.GalleryApplicationVersionUpdate{ - Properties: &armcompute.GalleryApplicationVersionProperties{ - PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ - EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00Z"); return t }()), - ReplicaCount: to.Ptr[int32](1), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - TargetRegions: []*armcompute.TargetRegion{ - { - Name: to.Ptr("West US"), - RegionalReplicaCount: to.Ptr[int32](1), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - }}, - ManageActions: &armcompute.UserArtifactManage{ - Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), - Remove: to.Ptr("del C:\\package "), - }, - Source: &armcompute.UserArtifactSource{ - MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), - }, - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryApplicationVersionWithReplicationStatus.json -func ExampleGalleryApplicationVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryApplicationName", - "1.0.0", - &armcompute.GalleryApplicationVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypesReplicationStatus)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryApplicationVersion.json -func ExampleGalleryApplicationVersionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryApplicationName", - "1.0.0", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryApplicationVersionsInAGalleryApplication.json -func ExampleGalleryApplicationVersionsClient_NewListByGalleryApplicationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryApplicationVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByGalleryApplicationPager("myResourceGroup", - "myGalleryName", - "myGalleryApplicationName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryimages_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryimages_client_test.go deleted file mode 100644 index ac44c267e5c4..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryimages_client_test.go +++ /dev/null @@ -1,171 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImage.json -func ExampleGalleryImagesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryImageName", - armcompute.GalleryImage{ - Location: to.Ptr("West US"), - Properties: &armcompute.GalleryImageProperties{ - HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - Identifier: &armcompute.GalleryImageIdentifier{ - Offer: to.Ptr("myOfferName"), - Publisher: to.Ptr("myPublisherName"), - SKU: to.Ptr("mySkuName"), - }, - OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImage.json -func ExampleGalleryImagesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryImageName", - armcompute.GalleryImageUpdate{ - Properties: &armcompute.GalleryImageProperties{ - HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - Identifier: &armcompute.GalleryImageIdentifier{ - Offer: to.Ptr("myOfferName"), - Publisher: to.Ptr("myPublisherName"), - SKU: to.Ptr("mySkuName"), - }, - OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImage.json -func ExampleGalleryImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryImageName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImage.json -func ExampleGalleryImagesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryImageName", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImagesInAGallery.json -func ExampleGalleryImagesClient_NewListByGalleryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByGalleryPager("myResourceGroup", - "myGalleryName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryimageversions_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryimageversions_client_test.go deleted file mode 100644 index 55ba2f1b9cd3..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_galleryimageversions_client_test.go +++ /dev/null @@ -1,222 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/CreateOrUpdateASimpleGalleryImageVersionWithVMAsSource.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryImageName", - "1.0.0", - armcompute.GalleryImageVersion{ - Location: to.Ptr("West US"), - Properties: &armcompute.GalleryImageVersionProperties{ - PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - TargetRegions: []*armcompute.TargetRegion{ - { - Name: to.Ptr("West US"), - Encryption: &armcompute.EncryptionImages{ - DataDiskImages: []*armcompute.DataDiskImageEncryption{ - { - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherWestUSDiskEncryptionSet"), - Lun: to.Ptr[int32](0), - }, - { - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), - Lun: to.Ptr[int32](1), - }}, - OSDiskImage: &armcompute.OSDiskImageEncryption{ - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), - }, - }, - RegionalReplicaCount: to.Ptr[int32](1), - }, - { - Name: to.Ptr("East US"), - Encryption: &armcompute.EncryptionImages{ - DataDiskImages: []*armcompute.DataDiskImageEncryption{ - { - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myOtherEastUSDiskEncryptionSet"), - Lun: to.Ptr[int32](0), - }, - { - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), - Lun: to.Ptr[int32](1), - }}, - OSDiskImage: &armcompute.OSDiskImageEncryption{ - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), - }, - }, - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - Source: &armcompute.GalleryArtifactVersionSource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}"), - }, - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/UpdateASimpleGalleryImageVersion.json -func ExampleGalleryImageVersionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryImageName", - "1.0.0", - armcompute.GalleryImageVersionUpdate{ - Properties: &armcompute.GalleryImageVersionProperties{ - PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - TargetRegions: []*armcompute.TargetRegion{ - { - Name: to.Ptr("West US"), - RegionalReplicaCount: to.Ptr[int32](1), - }, - { - Name: to.Ptr("East US"), - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - Source: &armcompute.GalleryArtifactVersionSource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - }, - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/GetAGalleryImageVersionWithReplicationStatus.json -func ExampleGalleryImageVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryImageName", - "1.0.0", - &armcompute.GalleryImageVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypesReplicationStatus)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/DeleteAGalleryImageVersion.json -func ExampleGalleryImageVersionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myGalleryName", - "myGalleryImageName", - "1.0.0", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/ListGalleryImageVersionsInAGalleryImage.json -func ExampleGalleryImageVersionsClient_NewListByGalleryImagePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGalleryImageVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByGalleryImagePager("myResourceGroup", - "myGalleryName", - "myGalleryImageName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_gallerysharingprofile_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_gallerysharingprofile_client_test.go deleted file mode 100644 index dd4ea0f255dc..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_gallerysharingprofile_client_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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-10-01/examples/gallery/AddToSharingProfileInAGallery.json -func ExampleGallerySharingProfileClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewGallerySharingProfileClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myGalleryName", - armcompute.SharingUpdate{ - Groups: []*armcompute.SharingProfileGroup{ - { - Type: to.Ptr(armcompute.SharingProfileGroupTypesSubscriptions), - IDs: []*string{ - to.Ptr("34a4ab42-0d72-47d9-bd1a-aed207386dac"), - to.Ptr("380fd389-260b-41aa-bad9-0a83108c370b")}, - }, - { - Type: to.Ptr(armcompute.SharingProfileGroupTypesAADTenants), - IDs: []*string{ - to.Ptr("c24c76aa-8897-4027-9b03-8f7928b54ff6")}, - }}, - OperationType: to.Ptr(armcompute.SharingUpdateOperationTypesAdd), - }, - 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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_images_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_images_client_test.go deleted file mode 100644 index 4ffb43c932b0..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_images_client_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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json -func ExampleImagesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myImage", - armcompute.Image{ - Location: to.Ptr("West US"), - Properties: &armcompute.ImageProperties{ - StorageProfile: &armcompute.ImageStorageProfile{ - OSDisk: &armcompute.ImageOSDisk{ - BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - }, - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/imageExamples/Image_Update.json -func ExampleImagesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myImage", - armcompute.ImageUpdate{ - Tags: map[string]*string{ - "department": to.Ptr("HR"), - }, - Properties: &armcompute.ImageProperties{ - HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypesV1), - SourceVirtualMachine: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/imageExamples/Images_Delete_MaximumSet_Gen.json -func ExampleImagesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/imageExamples/Image_Get.json -func ExampleImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myImage", - &armcompute.ImagesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/imageExamples/Image_ListByResourceGroup.json -func ExampleImagesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/imageExamples/Image_ListBySubscription.json -func ExampleImagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_loganalytics_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_loganalytics_client_test.go deleted file mode 100644 index 82dfabd41fa5..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_loganalytics_client_test.go +++ /dev/null @@ -1,86 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/logAnalyticExamples/LogAnalytics_RequestRateByInterval.json -func ExampleLogAnalyticsClient_BeginExportRequestRateByInterval() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewLogAnalyticsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExportRequestRateByInterval(ctx, - "westus", - armcompute.RequestRateByIntervalInput{ - BlobContainerSasURI: to.Ptr("https://somesasuri"), - FromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-21T01:54:06.862601Z"); return t }()), - GroupByResourceName: to.Ptr(true), - ToTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-23T01:54:06.862601Z"); return t }()), - IntervalLength: to.Ptr(armcompute.IntervalInMinsFiveMins), - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/logAnalyticExamples/LogAnalytics_ThrottledRequests.json -func ExampleLogAnalyticsClient_BeginExportThrottledRequests() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewLogAnalyticsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExportThrottledRequests(ctx, - "westus", - armcompute.ThrottledRequestsInput{ - BlobContainerSasURI: to.Ptr("https://somesasuri"), - FromTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-21T01:54:06.862601Z"); return t }()), - GroupByClientApplicationID: to.Ptr(false), - GroupByOperationName: to.Ptr(true), - GroupByResourceName: to.Ptr(false), - GroupByUserAgent: to.Ptr(false), - ToTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-23T01:54:06.862601Z"); return t }()), - }, - 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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_operations_client_test.go deleted file mode 100644 index 275bbafb98ba..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_proximityplacementgroups_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_proximityplacementgroups_client_test.go deleted file mode 100644 index b1ac274032ee..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_proximityplacementgroups_client_test.go +++ /dev/null @@ -1,171 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_CreateOrUpdate.json -func ExampleProximityPlacementGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myResourceGroup", - "myProximityPlacementGroup", - armcompute.ProximityPlacementGroup{ - Location: to.Ptr("westus"), - Properties: &armcompute.ProximityPlacementGroupProperties{ - Intent: &armcompute.ProximityPlacementGroupPropertiesIntent{ - VMSizes: []*string{ - to.Ptr("Basic_A0"), - to.Ptr("Basic_A2")}, - }, - ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), - }, - Zones: []*string{ - to.Ptr("1")}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Patch.json -func ExampleProximityPlacementGroupsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "myResourceGroup", - "myProximityPlacementGroup", - armcompute.ProximityPlacementGroupUpdate{ - Tags: map[string]*string{ - "additionalProp1": to.Ptr("string"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Delete.json -func ExampleProximityPlacementGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "myResourceGroup", - "myProximityPlacementGroup", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_Get.json -func ExampleProximityPlacementGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myProximityPlacementGroup", - &armcompute.ProximityPlacementGroupsClientGetOptions{IncludeColocationStatus: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListBySubscription.json -func ExampleProximityPlacementGroupsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/proximityPlacementGroupExamples/ProximityPlacementGroup_ListByResourceGroup.json -func ExampleProximityPlacementGroupsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewProximityPlacementGroupsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_resourceskus_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_resourceskus_client_test.go deleted file mode 100644 index 3d0372f0d304..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_resourceskus_client_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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json -func ExampleResourceSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewResourceSKUsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: nil, - IncludeExtendedLocations: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_restorepointcollections_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_restorepointcollections_client_test.go deleted file mode 100644 index f761561e57ac..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_restorepointcollections_client_test.go +++ /dev/null @@ -1,178 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json -func ExampleRestorePointCollectionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myResourceGroup", - "myRpc", - armcompute.RestorePointCollection{ - Location: to.Ptr("norwayeast"), - Tags: map[string]*string{ - "myTag1": to.Ptr("tagValue1"), - }, - Properties: &armcompute.RestorePointCollectionProperties{ - Source: &armcompute.RestorePointCollectionSourceProperties{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/restorePointExamples/RestorePointCollections_Update_MaximumSet_Gen.json -func ExampleRestorePointCollectionsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaa", - armcompute.RestorePointCollectionUpdate{ - Tags: map[string]*string{ - "key8536": to.Ptr("aaaaaaaaaaaaaaaaaaa"), - }, - Properties: &armcompute.RestorePointCollectionProperties{ - Source: &armcompute.RestorePointCollectionSourceProperties{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/restorePointExamples/RestorePointCollections_Delete_MaximumSet_Gen.json -func ExampleRestorePointCollectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/restorePointExamples/RestorePointCollection_Get.json -func ExampleRestorePointCollectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myRpc", - &armcompute.RestorePointCollectionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/restorePointExamples/RestorePointCollection_ListByResourceGroup.json -func ExampleRestorePointCollectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/restorePointExamples/RestorePointCollection_ListBySubscription.json -func ExampleRestorePointCollectionsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewRestorePointCollectionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAllPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_restorepoints_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_restorepoints_client_test.go deleted file mode 100644 index 49245b1c314a..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_restorepoints_client_test.go +++ /dev/null @@ -1,98 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json -func ExampleRestorePointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewRestorePointsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "myResourceGroup", - "rpcName", - "rpName", - armcompute.RestorePoint{ - Properties: &armcompute.RestorePointProperties{ - SourceRestorePoint: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/sourceRpcName/restorePoints/sourceRpName"), - }, - }, - }, - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/restorePointExamples/RestorePoints_Delete_MaximumSet_Gen.json -func ExampleRestorePointsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewRestorePointsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaa", - "a", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/restorePointExamples/RestorePoint_Get.json -func ExampleRestorePointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewRestorePointsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "rpcName", - "rpName", - &armcompute.RestorePointsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_sharedgalleries_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_sharedgalleries_client_test.go deleted file mode 100644 index e3f9d7122db3..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_sharedgalleries_client_test.go +++ /dev/null @@ -1,64 +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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleries.json -func ExampleSharedGalleriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSharedGalleriesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myLocation", - &armcompute.SharedGalleriesClientListOptions{SharedTo: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGallery.json -func ExampleSharedGalleriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSharedGalleriesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myLocation", - "galleryUniqueName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_sharedgalleryimages_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_sharedgalleryimages_client_test.go deleted file mode 100644 index fcaa8bbb1e1a..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_sharedgalleryimages_client_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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImages.json -func ExampleSharedGalleryImagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSharedGalleryImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myLocation", - "galleryUniqueName", - &armcompute.SharedGalleryImagesClientListOptions{SharedTo: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImage.json -func ExampleSharedGalleryImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSharedGalleryImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myLocation", - "galleryUniqueName", - "myGalleryImageName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_sharedgalleryimageversions_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_sharedgalleryimageversions_client_test.go deleted file mode 100644 index 75c20c92db34..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_sharedgalleryimageversions_client_test.go +++ /dev/null @@ -1,68 +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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/ListSharedGalleryImageVersions.json -func ExampleSharedGalleryImageVersionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSharedGalleryImageVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myLocation", - "galleryUniqueName", - "myGalleryImageName", - &armcompute.SharedGalleryImageVersionsClientListOptions{SharedTo: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-07-01/examples/sharedGallery/GetASharedGalleryImageVersion.json -func ExampleSharedGalleryImageVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSharedGalleryImageVersionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myLocation", - "galleryUniqueName", - "myGalleryImageName", - "myGalleryImageVersionName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_snapshots_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_snapshots_client_test.go deleted file mode 100644 index b9154600b034..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_snapshots_client_test.go +++ /dev/null @@ -1,241 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/CreateASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription.json -func ExampleSnapshotsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "mySnapshot1", - armcompute.Snapshot{ - Location: to.Ptr("West US"), - Properties: &armcompute.SnapshotProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), - SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - StorageAccountID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/UpdateASnapshotWithAcceleratedNetwork.json -func ExampleSnapshotsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "mySnapshot", - armcompute.SnapshotUpdate{ - Properties: &armcompute.SnapshotUpdateProperties{ - DiskSizeGB: to.Ptr[int32](20), - SupportedCapabilities: &armcompute.SupportedCapabilities{ - AcceleratedNetwork: to.Ptr(false), - }, - }, - Tags: map[string]*string{ - "department": to.Ptr("Development"), - "project": to.Ptr("UpdateSnapshots"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/GetInformationAboutASnapshot.json -func ExampleSnapshotsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "mySnapshot", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/DeleteASnapshot.json -func ExampleSnapshotsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "mySnapshot", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInAResourceGroup.json -func ExampleSnapshotsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/ListSnapshotsInASubscription.json -func ExampleSnapshotsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/BeginGetAccessSnapshot.json -func ExampleSnapshotsClient_BeginGrantAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginGrantAccess(ctx, - "myResourceGroup", - "mySnapshot", - armcompute.GrantAccessData{ - Access: to.Ptr(armcompute.AccessLevelRead), - DurationInSeconds: to.Ptr[int32](300), - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2021-12-01/examples/EndGetAccessSnapshot.json -func ExampleSnapshotsClient_BeginRevokeAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSnapshotsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRevokeAccess(ctx, - "myResourceGroup", - "mySnapshot", - 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/compute/armcompute/ze_generated_example_sshpublickeys_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_sshpublickeys_client_test.go deleted file mode 100644 index f4b28c17e192..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_sshpublickeys_client_test.go +++ /dev/null @@ -1,189 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/sshPublicKeyExamples/SshPublicKeys_ListBySubscription_MaximumSet_Gen.json -func ExampleSSHPublicKeysClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSSHPublicKeysClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/sshPublicKeyExamples/SshPublicKeys_ListByResourceGroup_MaximumSet_Gen.json -func ExampleSSHPublicKeysClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSSHPublicKeysClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("rgcompute", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/sshPublicKeyExamples/SshPublicKey_Create.json -func ExampleSSHPublicKeysClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSSHPublicKeysClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "myResourceGroup", - "mySshPublicKeyName", - armcompute.SSHPublicKeyResource{ - Location: to.Ptr("westus"), - Properties: &armcompute.SSHPublicKeyResourceProperties{ - PublicKey: to.Ptr("{ssh-rsa public key}"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/sshPublicKeyExamples/SshPublicKeys_Update_MaximumSet_Gen.json -func ExampleSSHPublicKeysClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSSHPublicKeysClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rgcompute", - "aaaaaaaaaaaa", - armcompute.SSHPublicKeyUpdateResource{ - Tags: map[string]*string{ - "key2854": to.Ptr("a"), - }, - Properties: &armcompute.SSHPublicKeyResourceProperties{ - PublicKey: to.Ptr("{ssh-rsa public key}"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/sshPublicKeyExamples/SshPublicKeys_Delete_MaximumSet_Gen.json -func ExampleSSHPublicKeysClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSSHPublicKeysClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rgcompute", - "aaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/sshPublicKeyExamples/SshPublicKey_Get.json -func ExampleSSHPublicKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSSHPublicKeysClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "mySshPublicKeyName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/sshPublicKeyExamples/SshPublicKeys_GenerateKeyPair.json -func ExampleSSHPublicKeysClient_GenerateKeyPair() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewSSHPublicKeysClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GenerateKeyPair(ctx, - "myResourceGroup", - "mySshPublicKeyName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_usage_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_usage_client_test.go deleted file mode 100644 index 9f25b743ef43..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_usage_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json -func ExampleUsageClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewUsageClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("4_.", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineextensionimages_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineextensionimages_client_test.go deleted file mode 100644 index dc3721d1692b..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineextensionimages_client_test.go +++ /dev/null @@ -1,90 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImages_Get_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineExtensionImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "aaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImages_ListTypes_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionImagesClient_ListTypes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineExtensionImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListTypes(ctx, - "aaaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImages_ListVersions_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionImagesClient_ListVersions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineExtensionImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListVersions(ctx, - "aaaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineExtensionImagesClientListVersionsOptions{Filter: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - Top: to.Ptr[int32](22), - Orderby: to.Ptr("a"), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineextensions_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineextensions_client_test.go deleted file mode 100644 index c8bc66da7778..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineextensions_client_test.go +++ /dev/null @@ -1,200 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachineExtensions_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaa", - armcompute.VirtualMachineExtension{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key9183": to.Ptr("aa"), - }, - Properties: &armcompute.VirtualMachineExtensionProperties{ - Type: to.Ptr("extType"), - AutoUpgradeMinorVersion: to.Ptr(true), - EnableAutomaticUpgrade: to.Ptr(true), - ForceUpdateTag: to.Ptr("a"), - InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ - Name: to.Ptr("aaaaaaaaaaaaaaaaa"), - Type: to.Ptr("aaaaaaaaa"), - Statuses: []*armcompute.InstanceViewStatus{ - { - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }}, - Substatuses: []*armcompute.InstanceViewStatus{ - { - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }}, - TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - }, - ProtectedSettings: map[string]interface{}{}, - Publisher: to.Ptr("extPublisher"), - Settings: map[string]interface{}{}, - SuppressFailures: to.Ptr(true), - TypeHandlerVersion: to.Ptr("1.2"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachineExtensions_Update.json -func ExampleVirtualMachineExtensionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myVM", - "myVMExtension", - armcompute.VirtualMachineExtensionUpdate{ - Properties: &armcompute.VirtualMachineExtensionUpdateProperties{ - Type: to.Ptr("extType"), - AutoUpgradeMinorVersion: to.Ptr(true), - ProtectedSettingsFromKeyVault: map[string]interface{}{ - "secretUrl": "https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e", - "sourceVault": map[string]interface{}{ - "id": "/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName", - }, - }, - Publisher: to.Ptr("extPublisher"), - Settings: map[string]interface{}{ - "UserName": "xyz@microsoft.com", - }, - SuppressFailures: to.Ptr(true), - TypeHandlerVersion: to.Ptr("1.2"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachineExtensions_Delete_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rgcompute", - "aaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachineExtensions_Get_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaa", - &armcompute.VirtualMachineExtensionsClientGetOptions{Expand: to.Ptr("aaaaaa")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachineExtensions_List_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "rgcompute", - "aaaaaaaaaaaaa", - &armcompute.VirtualMachineExtensionsClientListOptions{Expand: to.Ptr("aaaaaaaaaaaaaaaaa")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineimages_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineimages_client_test.go deleted file mode 100644 index d57485e9df38..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineimages_client_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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineImageExamples/VirtualMachineImages_Get_MaximumSet_Gen.json -func ExampleVirtualMachineImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "aaaaaa", - "aaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineImageExamples/VirtualMachineImages_List_MaximumSet_Gen.json -func ExampleVirtualMachineImagesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "aaaaaaaaaaaaaaa", - "aaaaaa", - "aaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineImagesClientListOptions{Expand: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - Top: to.Ptr[int32](18), - Orderby: to.Ptr("aa"), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineImageExamples/VirtualMachineImages_ListOffers_MaximumSet_Gen.json -func ExampleVirtualMachineImagesClient_ListOffers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListOffers(ctx, - "aaaaaaa", - "aaaaaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineImageExamples/VirtualMachineImages_ListPublishers_MaximumSet_Gen.json -func ExampleVirtualMachineImagesClient_ListPublishers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineImagesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListPublishers(ctx, - "aaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineimagesedgezone_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineimagesedgezone_client_test.go deleted file mode 100644 index 88c2a70b5489..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineimagesedgezone_client_test.go +++ /dev/null @@ -1,117 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineImagesEdgeZoneClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "aaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineImagesEdgeZoneClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "aaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineImagesEdgeZoneClientListOptions{Expand: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - Top: to.Ptr[int32](12), - Orderby: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_ListOffers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineImagesEdgeZoneClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListOffers(ctx, - "aaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_ListPublishers() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineImagesEdgeZoneClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListPublishers(ctx, - "aaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineruncommands_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineruncommands_client_test.go deleted file mode 100644 index 354c0372e637..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachineruncommands_client_test.go +++ /dev/null @@ -1,221 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/RunCommand_List.json -func ExampleVirtualMachineRunCommandsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("SoutheastAsia", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/RunCommand_Get.json -func ExampleVirtualMachineRunCommandsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("24fb23e3-6ba3-41f0-9b6e-e41131d5d61e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SoutheastAsia", - "RunPowerShellScript", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineRunCommand_CreateOrUpdate.json -func ExampleVirtualMachineRunCommandsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myVM", - "myRunCommand", - armcompute.VirtualMachineRunCommand{ - Location: to.Ptr("West US"), - Properties: &armcompute.VirtualMachineRunCommandProperties{ - AsyncExecution: to.Ptr(false), - Parameters: []*armcompute.RunCommandInputParameter{ - { - Name: to.Ptr("param1"), - Value: to.Ptr("value1"), - }, - { - Name: to.Ptr("param2"), - Value: to.Ptr("value2"), - }}, - RunAsPassword: to.Ptr(""), - RunAsUser: to.Ptr("user1"), - Source: &armcompute.VirtualMachineRunCommandScriptSource{ - Script: to.Ptr("Write-Host Hello World!"), - }, - TimeoutInSeconds: to.Ptr[int32](3600), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineRunCommand_Update.json -func ExampleVirtualMachineRunCommandsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myVM", - "myRunCommand", - armcompute.VirtualMachineRunCommandUpdate{ - Properties: &armcompute.VirtualMachineRunCommandProperties{ - Source: &armcompute.VirtualMachineRunCommandScriptSource{ - Script: to.Ptr("Write-Host Script Source Updated!"), - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineRunCommand_Delete.json -func ExampleVirtualMachineRunCommandsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myVM", - "myRunCommand", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineRunCommand_Get.json -func ExampleVirtualMachineRunCommandsClient_GetByVirtualMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByVirtualMachine(ctx, - "myResourceGroup", - "myVM", - "myRunCommand", - &armcompute.VirtualMachineRunCommandsClientGetByVirtualMachineOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineRunCommand_List.json -func ExampleVirtualMachineRunCommandsClient_NewListByVirtualMachinePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineRunCommandsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByVirtualMachinePager("myResourceGroup", - "myVM", - &armcompute.VirtualMachineRunCommandsClientListByVirtualMachineOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachines_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachines_client_test.go deleted file mode 100644 index a01472c72609..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachines_client_test.go +++ /dev/null @@ -1,739 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_ListBySubscription_ByLocation.json -func ExampleVirtualMachinesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscriptionId}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("eastus", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_Capture_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginCapture() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCapture(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaa", - armcompute.VirtualMachineCaptureParameters{ - DestinationContainerName: to.Ptr("aaaaaaa"), - OverwriteVhds: to.Ptr(true), - VhdPrefix: to.Ptr("aaaaaaaaa"), - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myVM", - armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), - }, - NetworkProfile: &armcompute.NetworkProfile{ - NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - { - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), - Properties: &armcompute.NetworkInterfaceReferenceProperties{ - Primary: to.Ptr(true), - }, - }}, - }, - OSProfile: &armcompute.OSProfile{ - AdminPassword: to.Ptr("{your-password}"), - AdminUsername: to.Ptr("{your-username}"), - ComputerName: to.Ptr("myVM"), - LinuxConfiguration: &armcompute.LinuxConfiguration{ - PatchSettings: &armcompute.LinuxPatchSettings{ - AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), - }, - ProvisionVMAgent: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("UbuntuServer"), - Publisher: to.Ptr("Canonical"), - SKU: to.Ptr("16.04-LTS"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - }, - }, - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json -func ExampleVirtualMachinesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myVM", - armcompute.VirtualMachineUpdate{ - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2V2), - }, - NetworkProfile: &armcompute.NetworkProfile{ - NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - { - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"), - Properties: &armcompute.NetworkInterfaceReferenceProperties{ - Primary: to.Ptr(true), - }, - }}, - }, - OSProfile: &armcompute.OSProfile{ - AdminPassword: to.Ptr("{your-password}"), - AdminUsername: to.Ptr("{your-username}"), - ComputerName: to.Ptr("myVM"), - }, - StorageProfile: &armcompute.StorageProfile{ - DataDisks: []*armcompute.DataDisk{ - { - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](0), - ToBeDetached: to.Ptr(true), - }, - { - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](1), - ToBeDetached: to.Ptr(false), - }}, - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("2016-Datacenter"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_Delete_Force.json -func ExampleVirtualMachinesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myVM", - &armcompute.VirtualMachinesClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_Get.json -func ExampleVirtualMachinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myVM", - &armcompute.VirtualMachinesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json -func ExampleVirtualMachinesClient_InstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.InstanceView(ctx, - "myResourceGroup", - "myVM", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_ConvertToManagedDisks_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginConvertToManagedDisks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginConvertToManagedDisks(ctx, - "rgcompute", - "aaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_Deallocate_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginDeallocate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeallocate(ctx, - "rgcompute", - "aaaaaaaaaa", - &armcompute.VirtualMachinesClientBeginDeallocateOptions{Hibernate: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_Generalize.json -func ExampleVirtualMachinesClient_Generalize() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Generalize(ctx, - "myResourceGroup", - "myVMName", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_List_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rgcompute", - &armcompute.VirtualMachinesClientListOptions{Filter: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_ListAll_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAllPager(&armcompute.VirtualMachinesClientListAllOptions{StatusOnly: to.Ptr("aaaaaa"), - Filter: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_ListAvailableVmSizes.json -func ExampleVirtualMachinesClient_NewListAvailableSizesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAvailableSizesPager("myResourceGroup", - "myVmName", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_PowerOff_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginPowerOff() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPowerOff(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachinesClientBeginPowerOffOptions{SkipShutdown: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_Reapply.json -func ExampleVirtualMachinesClient_BeginReapply() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginReapply(ctx, - "ResourceGroup", - "VMName", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_Restart_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestart(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_Start_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_Redeploy_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginRedeploy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRedeploy(ctx, - "rgcompute", - "a", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_Reimage.json -func ExampleVirtualMachinesClient_BeginReimage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginReimage(ctx, - "myResourceGroup", - "myVMName", - &armcompute.VirtualMachinesClientBeginReimageOptions{Parameters: &armcompute.VirtualMachineReimageParameters{ - TempDisk: to.Ptr(true), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_RetrieveBootDiagnosticsData.json -func ExampleVirtualMachinesClient_RetrieveBootDiagnosticsData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RetrieveBootDiagnosticsData(ctx, - "ResourceGroup", - "VMName", - &armcompute.VirtualMachinesClientRetrieveBootDiagnosticsDataOptions{SasURIExpirationTimeInMinutes: to.Ptr[int32](60)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachines_PerformMaintenance_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginPerformMaintenance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPerformMaintenance(ctx, - "rgcompute", - "aaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_SimulateEviction.json -func ExampleVirtualMachinesClient_SimulateEviction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.SimulateEviction(ctx, - "ResourceGroup", - "VMName", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_AssessPatches.json -func ExampleVirtualMachinesClient_BeginAssessPatches() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAssessPatches(ctx, - "myResourceGroupName", - "myVMName", - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineExamples/VirtualMachine_InstallPatches.json -func ExampleVirtualMachinesClient_BeginInstallPatches() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginInstallPatches(ctx, - "myResourceGroupName", - "myVMName", - armcompute.VirtualMachineInstallPatchesParameters{ - MaximumDuration: to.Ptr("PT4H"), - RebootSetting: to.Ptr(armcompute.VMGuestPatchRebootSettingIfRequired), - WindowsParameters: &armcompute.WindowsParameters{ - ClassificationsToInclude: []*armcompute.VMGuestPatchClassificationWindows{ - to.Ptr(armcompute.VMGuestPatchClassificationWindowsCritical), - to.Ptr(armcompute.VMGuestPatchClassificationWindowsSecurity)}, - MaxPatchPublishDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-19T02:36:43.0539904+00:00"); return t }()), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineRunCommand.json -func ExampleVirtualMachinesClient_BeginRunCommand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachinesClient("24fb23e3-6ba3-41f0-9b6e-e41131d5d61e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRunCommand(ctx, - "crptestar98131", - "vm3036", - armcompute.RunCommandInput{ - CommandID: to.Ptr("RunPowerShellScript"), - }, - 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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetextensions_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetextensions_client_test.go deleted file mode 100644 index 75a1a1b0c538..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetextensions_client_test.go +++ /dev/null @@ -1,177 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtensions_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rgcompute", - "aaaaaaa", - "aaaaaaaaaaaaaaaaaaaaa", - armcompute.VirtualMachineScaleSetExtension{ - Name: to.Ptr("{extension-name}"), - Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - Type: to.Ptr("{extension-Type}"), - AutoUpgradeMinorVersion: to.Ptr(true), - EnableAutomaticUpgrade: to.Ptr(true), - ForceUpdateTag: to.Ptr("aaaaaaaaa"), - ProtectedSettings: map[string]interface{}{}, - ProvisionAfterExtensions: []*string{ - to.Ptr("aa")}, - Publisher: to.Ptr("{extension-Publisher}"), - Settings: map[string]interface{}{}, - SuppressFailures: to.Ptr(true), - TypeHandlerVersion: to.Ptr("{handler-version}"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtensions_Update_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaa", - armcompute.VirtualMachineScaleSetExtensionUpdate{ - Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - Type: to.Ptr("{extension-Type}"), - AutoUpgradeMinorVersion: to.Ptr(true), - EnableAutomaticUpgrade: to.Ptr(true), - ForceUpdateTag: to.Ptr("aaaaaaaaa"), - ProtectedSettings: map[string]interface{}{}, - ProvisionAfterExtensions: []*string{ - to.Ptr("aa")}, - Publisher: to.Ptr("{extension-Publisher}"), - Settings: map[string]interface{}{}, - SuppressFailures: to.Ptr(true), - TypeHandlerVersion: to.Ptr("{handler-version}"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtensions_Delete_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtensions_Get_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetExtensionsClientGetOptions{Expand: to.Ptr("aaaaaaa")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtensions_List_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rgcompute", - "aaaaaaaaaaaaaaaaaaaa", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetrollingupgrades_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetrollingupgrades_client_test.go deleted file mode 100644 index d3e73474a4ad..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetrollingupgrades_client_test.go +++ /dev/null @@ -1,111 +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. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrades_Cancel_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetRollingUpgradesClient_BeginCancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetRollingUpgradesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCancel(ctx, - "rgcompute", - "aaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrades_StartOSUpgrade_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetRollingUpgradesClient_BeginStartOSUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetRollingUpgradesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStartOSUpgrade(ctx, - "rgcompute", - "aaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_RollingUpgrade.json -func ExampleVirtualMachineScaleSetRollingUpgradesClient_BeginStartExtensionUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetRollingUpgradesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStartExtensionUpgrade(ctx, - "myResourceGroup", - "{vmss-name}", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrades_GetLatest_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetRollingUpgradesClient_GetLatest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetRollingUpgradesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetLatest(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesets_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesets_client_test.go deleted file mode 100644 index 333d5d65a753..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesets_client_test.go +++ /dev/null @@ -1,937 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_ListBySubscription_ByLocation.json -func ExampleVirtualMachineScaleSetsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("eastus", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "{vmss-name}", - armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), - }, - }, - ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ - Extensions: []*armcompute.VirtualMachineScaleSetExtension{ - { - Name: to.Ptr("{extension-name}"), - Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - Type: to.Ptr("{extension-Type}"), - AutoUpgradeMinorVersion: to.Ptr(false), - Publisher: to.Ptr("{extension-Publisher}"), - Settings: map[string]interface{}{}, - SuppressFailures: to.Ptr(true), - TypeHandlerVersion: to.Ptr("{handler-version}"), - }, - }}, - }, - NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - { - Name: to.Ptr("{vmss-name}"), - Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - EnableIPForwarding: to.Ptr(true), - IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - { - Name: to.Ptr("{vmss-name}"), - Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - Subnet: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), - }, - }, - }}, - Primary: to.Ptr(true), - }, - }}, - }, - OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - AdminPassword: to.Ptr("{your-password}"), - AdminUsername: to.Ptr("{your-username}"), - ComputerNamePrefix: to.Ptr("{vmss-name}"), - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("2016-Datacenter"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_Update_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rgcompute", - "aaaaaaaaaaaaa", - armcompute.VirtualMachineScaleSetUpdate{ - Tags: map[string]*string{ - "key246": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - }, - Identity: &armcompute.VirtualMachineScaleSetIdentity{ - Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), - UserAssignedIdentities: map[string]*armcompute.VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue{ - "key3951": {}, - }, - }, - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - PromotionCode: to.Ptr("aaaaaaaaaa"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineScaleSetUpdateProperties{ - AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - HibernationEnabled: to.Ptr(true), - UltraSSDEnabled: to.Ptr(true), - }, - AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ - Enabled: to.Ptr(true), - GracePeriod: to.Ptr("PT30M"), - }, - DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(true), - Overprovision: to.Ptr(true), - ProximityPlacementGroup: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - }, - ScaleInPolicy: &armcompute.ScaleInPolicy{ - ForceDeletion: to.Ptr(true), - Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ - to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesOldestVM)}, - }, - SinglePlacementGroup: to.Ptr(true), - UpgradePolicy: &armcompute.UpgradePolicy{ - AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - DisableAutomaticRollback: to.Ptr(true), - EnableAutomaticOSUpgrade: to.Ptr(true), - }, - Mode: to.Ptr(armcompute.UpgradeModeManual), - RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ - EnableCrossZoneUpgrade: to.Ptr(true), - MaxBatchInstancePercent: to.Ptr[int32](49), - MaxUnhealthyInstancePercent: to.Ptr[int32](81), - MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), - PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), - PrioritizeUnhealthyInstances: to.Ptr(true), - }, - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetUpdateVMProfile{ - BillingProfile: &armcompute.BillingProfile{ - MaxPrice: to.Ptr[float64](-1), - }, - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), - }, - }, - ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ - ExtensionsTimeBudget: to.Ptr("PT1H20M"), - Extensions: []*armcompute.VirtualMachineScaleSetExtension{ - { - Name: to.Ptr("{extension-name}"), - Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - Type: to.Ptr("{extension-Type}"), - AutoUpgradeMinorVersion: to.Ptr(true), - EnableAutomaticUpgrade: to.Ptr(true), - ForceUpdateTag: to.Ptr("aaaaaaaaa"), - ProtectedSettings: map[string]interface{}{}, - ProvisionAfterExtensions: []*string{ - to.Ptr("aa")}, - Publisher: to.Ptr("{extension-Publisher}"), - Settings: map[string]interface{}{}, - SuppressFailures: to.Ptr(true), - TypeHandlerVersion: to.Ptr("{handler-version}"), - }, - }}, - }, - LicenseType: to.Ptr("aaaaaaaaaaaa"), - NetworkProfile: &armcompute.VirtualMachineScaleSetUpdateNetworkProfile{ - HealthProbe: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"), - }, - NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), - NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetUpdateNetworkConfiguration{ - { - ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - Name: to.Ptr("aaaaaaaa"), - Properties: &armcompute.VirtualMachineScaleSetUpdateNetworkConfigurationProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - DNSServers: []*string{}, - }, - EnableAcceleratedNetworking: to.Ptr(true), - EnableFpga: to.Ptr(true), - EnableIPForwarding: to.Ptr(true), - IPConfigurations: []*armcompute.VirtualMachineScaleSetUpdateIPConfiguration{ - { - ID: to.Ptr("aaaaaaaaaaaaaaaa"), - Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - Properties: &armcompute.VirtualMachineScaleSetUpdateIPConfigurationProperties{ - ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ - { - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - }}, - ApplicationSecurityGroups: []*armcompute.SubResource{ - { - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - }}, - LoadBalancerBackendAddressPools: []*armcompute.SubResource{ - { - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - }}, - LoadBalancerInboundNatPools: []*armcompute.SubResource{ - { - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - }}, - Primary: to.Ptr(true), - PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration{ - Name: to.Ptr("a"), - Properties: &armcompute.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), - }, - IdleTimeoutInMinutes: to.Ptr[int32](3), - }, - }, - Subnet: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"), - }, - }, - }}, - NetworkSecurityGroup: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - }, - Primary: to.Ptr(true), - }, - }}, - }, - OSProfile: &armcompute.VirtualMachineScaleSetUpdateOSProfile{ - CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - LinuxConfiguration: &armcompute.LinuxConfiguration{ - DisablePasswordAuthentication: to.Ptr(true), - PatchSettings: &armcompute.LinuxPatchSettings{ - AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), - PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), - }, - ProvisionVMAgent: to.Ptr(true), - SSH: &armcompute.SSHConfiguration{ - PublicKeys: []*armcompute.SSHPublicKey{ - { - Path: to.Ptr("/home/{your-username}/.ssh/authorized_keys"), - KeyData: to.Ptr("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"), - }}, - }, - }, - Secrets: []*armcompute.VaultSecretGroup{ - { - SourceVault: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - VaultCertificates: []*armcompute.VaultCertificate{ - { - CertificateStore: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - CertificateURL: to.Ptr("aaaaaaa"), - }}, - }}, - WindowsConfiguration: &armcompute.WindowsConfiguration{ - AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ - { - ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - PassName: to.Ptr("OobeSystem"), - SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), - }}, - EnableAutomaticUpdates: to.Ptr(true), - PatchSettings: &armcompute.PatchSettings{ - AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), - AutomaticByPlatformSettings: &armcompute.WindowsVMGuestPatchAutomaticByPlatformSettings{ - RebootSetting: to.Ptr(armcompute.WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever), - }, - EnableHotpatching: to.Ptr(true), - PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), - }, - ProvisionVMAgent: to.Ptr(true), - TimeZone: to.Ptr("aaaaaaaaaaaaaaaa"), - WinRM: &armcompute.WinRMConfiguration{ - Listeners: []*armcompute.WinRMListener{ - { - CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), - }}, - }, - }, - }, - ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ - Enable: to.Ptr(true), - NotBeforeTimeout: to.Ptr("PT10M"), - }, - }, - SecurityProfile: &armcompute.SecurityProfile{ - EncryptionAtHost: to.Ptr(true), - SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), - UefiSettings: &armcompute.UefiSettings{ - SecureBootEnabled: to.Ptr(true), - VTpmEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.VirtualMachineScaleSetUpdateStorageProfile{ - DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - { - Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - Caching: to.Ptr(armcompute.CachingTypesNone), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskIOPSReadWrite: to.Ptr[int64](28), - DiskMBpsReadWrite: to.Ptr[int64](15), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](26), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("aaaaaaaaaaaa"), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - WriteAcceleratorEnabled: to.Ptr(true), - }}, - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SharedGalleryImageID: to.Ptr("aaaaaa"), - SKU: to.Ptr("2016-Datacenter"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetUpdateOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - DiskSizeGB: to.Ptr[int32](6), - Image: &armcompute.VirtualHardDisk{ - URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"), - }, - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("aaaaaaaaaaaa"), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - VhdContainers: []*string{ - to.Ptr("aa")}, - WriteAcceleratorEnabled: to.Ptr(true), - }, - }, - UserData: to.Ptr("aaaaaaaaaaaaa"), - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("DSv3-Type1"), - Capacity: to.Ptr[int64](7), - Tier: to.Ptr("aaa"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Delete_Force.json -func ExampleVirtualMachineScaleSetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myvmScaleSet", - &armcompute.VirtualMachineScaleSetsClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json -func ExampleVirtualMachineScaleSetsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myVirtualMachineScaleSet", - &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_Deallocate_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginDeallocate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeallocate(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetsClientBeginDeallocateOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaa")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_DeleteInstances_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginDeleteInstances() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteInstances(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaa", - armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs{ - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - }, - &armcompute.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions{ForceDeletion: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_GetInstanceView_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_GetInstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetInstanceView(ctx, - "rgcompute", - "aaaaaaaaaaaaaaa", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_List_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rgcompute", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_ListAll_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAllPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_GetOSUpgradeHistory_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewGetOSUpgradeHistoryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetOSUpgradeHistoryPager("rgcompute", - "aaaaaa", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_PowerOff_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginPowerOff() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPowerOff(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetsClientBeginPowerOffOptions{SkipShutdown: to.Ptr(true), - VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaa")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_Restart_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestart(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetsClientBeginRestartOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaa")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_Start_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetsClientBeginStartOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaa")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_Redeploy_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginRedeploy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRedeploy(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetsClientBeginRedeployOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaa")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_PerformMaintenance_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginPerformMaintenance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPerformMaintenance(ctx, - "rgcompute", - "aaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaa")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_UpdateInstances_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginUpdateInstances() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateInstances(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaa", - armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs{ - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - }, - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_Reimage_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginReimage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginReimage(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetsClientBeginReimageOptions{VMScaleSetReimageInput: &armcompute.VirtualMachineScaleSetReimageParameters{ - TempDisk: to.Ptr(true), - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaa")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_ReimageAll_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginReimageAll() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginReimageAll(ctx, - "rgcompute", - "aaaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetsClientBeginReimageAllOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaa")}, - }, - }) - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_ForceRecoveryServiceFabricPlatformUpdateDomainWalk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaa", - 30, - &armcompute.VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions{Zone: nil, - PlacementGroupID: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_ConvertToSinglePlacementGroup_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_ConvertToSinglePlacementGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.ConvertToSinglePlacementGroup(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - armcompute.VMScaleSetConvertToSinglePlacementGroupInput{ - ActivePlacementGroupID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - }, - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSets_SetOrchestrationServiceState_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginSetOrchestrationServiceState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginSetOrchestrationServiceState(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaa", - armcompute.OrchestrationServiceStateInput{ - Action: to.Ptr(armcompute.OrchestrationServiceStateActionResume), - ServiceName: to.Ptr(armcompute.OrchestrationServiceNamesAutomaticRepairs), - }, - 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/compute/armcompute/ze_generated_example_virtualmachinescalesetvmextensions_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetvmextensions_client_test.go deleted file mode 100644 index a14fd71587c8..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetvmextensions_client_test.go +++ /dev/null @@ -1,169 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtensions_Create.json -func ExampleVirtualMachineScaleSetVMExtensionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myvmScaleSet", - "0", - "myVMExtension", - armcompute.VirtualMachineScaleSetVMExtension{ - Properties: &armcompute.VirtualMachineExtensionProperties{ - Type: to.Ptr("extType"), - AutoUpgradeMinorVersion: to.Ptr(true), - Publisher: to.Ptr("extPublisher"), - Settings: map[string]interface{}{ - "UserName": "xyz@microsoft.com", - }, - TypeHandlerVersion: to.Ptr("1.2"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtensions_Update.json -func ExampleVirtualMachineScaleSetVMExtensionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myvmScaleSet", - "0", - "myVMExtension", - armcompute.VirtualMachineScaleSetVMExtensionUpdate{ - Properties: &armcompute.VirtualMachineExtensionUpdateProperties{ - Type: to.Ptr("extType"), - AutoUpgradeMinorVersion: to.Ptr(true), - Publisher: to.Ptr("extPublisher"), - Settings: map[string]interface{}{ - "UserName": "xyz@microsoft.com", - }, - TypeHandlerVersion: to.Ptr("1.2"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtensions_Delete.json -func ExampleVirtualMachineScaleSetVMExtensionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myvmScaleSet", - "0", - "myVMExtension", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtensions_Get.json -func ExampleVirtualMachineScaleSetVMExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myvmScaleSet", - "0", - "myVMExtension", - &armcompute.VirtualMachineScaleSetVMExtensionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtensions_List.json -func ExampleVirtualMachineScaleSetVMExtensionsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMExtensionsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, - "myResourceGroup", - "myvmScaleSet", - "0", - &armcompute.VirtualMachineScaleSetVMExtensionsClientListOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetvmruncommands_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetvmruncommands_client_test.go deleted file mode 100644 index a0d1cedc4720..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetvmruncommands_client_test.go +++ /dev/null @@ -1,179 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_CreateOrUpdate.json -func ExampleVirtualMachineScaleSetVMRunCommandsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMRunCommandsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myvmScaleSet", - "0", - "myRunCommand", - armcompute.VirtualMachineRunCommand{ - Location: to.Ptr("West US"), - Properties: &armcompute.VirtualMachineRunCommandProperties{ - AsyncExecution: to.Ptr(false), - Parameters: []*armcompute.RunCommandInputParameter{ - { - Name: to.Ptr("param1"), - Value: to.Ptr("value1"), - }, - { - Name: to.Ptr("param2"), - Value: to.Ptr("value2"), - }}, - RunAsPassword: to.Ptr(""), - RunAsUser: to.Ptr("user1"), - Source: &armcompute.VirtualMachineRunCommandScriptSource{ - Script: to.Ptr("Write-Host Hello World!"), - }, - TimeoutInSeconds: to.Ptr[int32](3600), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Update.json -func ExampleVirtualMachineScaleSetVMRunCommandsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMRunCommandsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myvmScaleSet", - "0", - "myRunCommand", - armcompute.VirtualMachineRunCommandUpdate{ - Properties: &armcompute.VirtualMachineRunCommandProperties{ - Source: &armcompute.VirtualMachineRunCommandScriptSource{ - Script: to.Ptr("Write-Host Script Source Updated!"), - }, - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Delete.json -func ExampleVirtualMachineScaleSetVMRunCommandsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMRunCommandsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myvmScaleSet", - "0", - "myRunCommand", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_Get.json -func ExampleVirtualMachineScaleSetVMRunCommandsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMRunCommandsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myvmScaleSet", - "0", - "myRunCommand", - &armcompute.VirtualMachineScaleSetVMRunCommandsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand_List.json -func ExampleVirtualMachineScaleSetVMRunCommandsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMRunCommandsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - "myvmScaleSet", - "0", - &armcompute.VirtualMachineScaleSetVMRunCommandsClientListOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetvms_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetvms_client_test.go deleted file mode 100644 index 1bd50548b95b..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinescalesetvms_client_test.go +++ /dev/null @@ -1,865 +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. - -package armcompute_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/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_Reimage_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginReimage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginReimage(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetVMsClientBeginReimageOptions{VMScaleSetVMReimageInput: &armcompute.VirtualMachineScaleSetVMReimageParameters{ - TempDisk: to.Ptr(true), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_ReimageAll_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginReimageAll() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginReimageAll(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_Deallocate_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginDeallocate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeallocate(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_Update_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rgcompute", - "aaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - armcompute.VirtualMachineScaleSetVM{ - Location: to.Ptr("westus"), - Tags: map[string]*string{}, - Plan: &armcompute.Plan{ - Name: to.Ptr("aaaaaaaaaa"), - Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - }, - Properties: &armcompute.VirtualMachineScaleSetVMProperties{ - AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - HibernationEnabled: to.Ptr(true), - UltraSSDEnabled: to.Ptr(true), - }, - AvailabilitySet: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("aaaaaaaaaaaaa"), - }, - }, - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesBasicA0), - VMSizeProperties: &armcompute.VMSizeProperties{ - VCPUsAvailable: to.Ptr[int32](9), - VCPUsPerCore: to.Ptr[int32](12), - }, - }, - InstanceView: &armcompute.VirtualMachineScaleSetVMInstanceView{ - BootDiagnostics: &armcompute.BootDiagnosticsInstanceView{ - Status: &armcompute.InstanceViewStatus{ - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }, - }, - Disks: []*armcompute.DiskInstanceView{ - { - Name: to.Ptr("aaaaaaaaaaa"), - EncryptionSettings: []*armcompute.DiskEncryptionSettings{ - { - DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ - SecretURL: to.Ptr("aaaaaaaa"), - SourceVault: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - }, - Enabled: to.Ptr(true), - KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ - KeyURL: to.Ptr("aaaaaaaaaaaaaa"), - SourceVault: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - }, - }}, - Statuses: []*armcompute.InstanceViewStatus{ - { - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }}, - }}, - MaintenanceRedeployStatus: &armcompute.MaintenanceRedeployStatus{ - IsCustomerInitiatedMaintenanceAllowed: to.Ptr(true), - LastOperationMessage: to.Ptr("aaaaaa"), - LastOperationResultCode: to.Ptr(armcompute.MaintenanceOperationResultCodeTypesNone), - MaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t }()), - MaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t }()), - PreMaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t }()), - PreMaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.531Z"); return t }()), - }, - PlacementGroupID: to.Ptr("aaa"), - PlatformFaultDomain: to.Ptr[int32](14), - PlatformUpdateDomain: to.Ptr[int32](23), - RdpThumbPrint: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - Statuses: []*armcompute.InstanceViewStatus{ - { - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }}, - VMAgent: &armcompute.VirtualMachineAgentInstanceView{ - ExtensionHandlers: []*armcompute.VirtualMachineExtensionHandlerInstanceView{ - { - Type: to.Ptr("aaaaaaaaaaaaa"), - Status: &armcompute.InstanceViewStatus{ - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }, - TypeHandlerVersion: to.Ptr("aaaaa"), - }}, - Statuses: []*armcompute.InstanceViewStatus{ - { - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }}, - VMAgentVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - }, - VMHealth: &armcompute.VirtualMachineHealthStatus{ - Status: &armcompute.InstanceViewStatus{ - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }, - }, - Extensions: []*armcompute.VirtualMachineExtensionInstanceView{ - { - Name: to.Ptr("aaaaaaaaaaaaaaaaa"), - Type: to.Ptr("aaaaaaaaa"), - Statuses: []*armcompute.InstanceViewStatus{ - { - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }}, - Substatuses: []*armcompute.InstanceViewStatus{ - { - Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - DisplayStatus: to.Ptr("aaaaaa"), - Level: to.Ptr(armcompute.StatusLevelTypesInfo), - Message: to.Ptr("a"), - Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.522Z"); return t }()), - }}, - TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - }}, - }, - LicenseType: to.Ptr("aaaaaaaaaa"), - NetworkProfile: &armcompute.NetworkProfile{ - NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), - NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ - { - Name: to.Ptr("aaaaaaaaaaa"), - Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ - DNSServers: []*string{ - to.Ptr("aaaaaa")}, - }, - DscpConfiguration: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - EnableAcceleratedNetworking: to.Ptr(true), - EnableFpga: to.Ptr(true), - EnableIPForwarding: to.Ptr(true), - IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ - { - Name: to.Ptr("aa"), - Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ - ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }}, - ApplicationSecurityGroups: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }}, - LoadBalancerBackendAddressPools: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }}, - Primary: to.Ptr(true), - PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), - PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ - Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ - DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - }, - IdleTimeoutInMinutes: to.Ptr[int32](2), - IPTags: []*armcompute.VirtualMachineIPTag{ - { - IPTagType: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - }}, - PublicIPAddressVersion: to.Ptr(armcompute.IPVersionsIPv4), - PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodDynamic), - PublicIPPrefix: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - }, - SKU: &armcompute.PublicIPAddressSKU{ - Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), - Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), - }, - }, - Subnet: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - }, - }}, - NetworkSecurityGroup: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - Primary: to.Ptr(true), - }, - }}, - NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - { - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415"), - Properties: &armcompute.NetworkInterfaceReferenceProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - Primary: to.Ptr(true), - }, - }}, - }, - NetworkProfileConfiguration: &armcompute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ - NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - { - ID: to.Ptr("aaaaaaaa"), - Name: to.Ptr("vmsstestnetconfig5415"), - Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - DNSServers: []*string{}, - }, - EnableAcceleratedNetworking: to.Ptr(true), - EnableFpga: to.Ptr(true), - EnableIPForwarding: to.Ptr(true), - IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - { - ID: to.Ptr("aaaaaaaaa"), - Name: to.Ptr("vmsstestnetconfig9693"), - Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }}, - ApplicationSecurityGroups: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }}, - LoadBalancerBackendAddressPools: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }}, - LoadBalancerInboundNatPools: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }}, - Primary: to.Ptr(true), - PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ - Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), - Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), - }, - IdleTimeoutInMinutes: to.Ptr[int32](18), - IPTags: []*armcompute.VirtualMachineScaleSetIPTag{ - { - IPTagType: to.Ptr("aaaaaaa"), - Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - }}, - PublicIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - PublicIPPrefix: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - }, - SKU: &armcompute.PublicIPAddressSKU{ - Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), - Tier: to.Ptr(armcompute.PublicIPAddressSKUTierRegional), - }, - }, - Subnet: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503"), - }, - }, - }}, - NetworkSecurityGroup: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - Primary: to.Ptr(true), - }, - }}, - }, - OSProfile: &armcompute.OSProfile{ - AdminPassword: to.Ptr("aaaaaaaaaaaaaaaa"), - AdminUsername: to.Ptr("Foo12"), - AllowExtensionOperations: to.Ptr(true), - ComputerName: to.Ptr("test000000"), - CustomData: to.Ptr("aaaa"), - LinuxConfiguration: &armcompute.LinuxConfiguration{ - DisablePasswordAuthentication: to.Ptr(true), - PatchSettings: &armcompute.LinuxPatchSettings{ - AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), - PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), - }, - ProvisionVMAgent: to.Ptr(true), - SSH: &armcompute.SSHConfiguration{ - PublicKeys: []*armcompute.SSHPublicKey{ - { - Path: to.Ptr("aaa"), - KeyData: to.Ptr("aaaaaa"), - }}, - }, - }, - RequireGuestProvisionSignal: to.Ptr(true), - Secrets: []*armcompute.VaultSecretGroup{}, - WindowsConfiguration: &armcompute.WindowsConfiguration{ - AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ - { - ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - Content: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - PassName: to.Ptr("OobeSystem"), - SettingName: to.Ptr(armcompute.SettingNamesAutoLogon), - }}, - EnableAutomaticUpdates: to.Ptr(true), - PatchSettings: &armcompute.PatchSettings{ - AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), - EnableHotpatching: to.Ptr(true), - PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), - }, - ProvisionVMAgent: to.Ptr(true), - TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - WinRM: &armcompute.WinRMConfiguration{ - Listeners: []*armcompute.WinRMListener{ - { - CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), - }}, - }, - }, - }, - ProtectionPolicy: &armcompute.VirtualMachineScaleSetVMProtectionPolicy{ - ProtectFromScaleIn: to.Ptr(true), - ProtectFromScaleSetActions: to.Ptr(true), - }, - SecurityProfile: &armcompute.SecurityProfile{ - EncryptionAtHost: to.Ptr(true), - SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), - UefiSettings: &armcompute.UefiSettings{ - SecureBootEnabled: to.Ptr(true), - VTpmEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - DataDisks: []*armcompute.DataDisk{ - { - Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - Caching: to.Ptr(armcompute.CachingTypesNone), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), - DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), - DiskSizeGB: to.Ptr[int32](128), - Image: &armcompute.VirtualHardDisk{ - URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), - }, - Lun: to.Ptr[int32](1), - ManagedDisk: &armcompute.ManagedDiskParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("aaaaaaaaaaaa"), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - ToBeDetached: to.Ptr(true), - Vhd: &armcompute.VirtualHardDisk{ - URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), - }, - WriteAcceleratorEnabled: to.Ptr(true), - }}, - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("a"), - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - SKU: to.Ptr("2012-R2-Datacenter"), - Version: to.Ptr("4.127.20180315"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), - Caching: to.Ptr(armcompute.CachingTypesNone), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), - DiffDiskSettings: &armcompute.DiffDiskSettings{ - Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), - }, - DiskSizeGB: to.Ptr[int32](127), - EncryptionSettings: &armcompute.DiskEncryptionSettings{ - DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ - SecretURL: to.Ptr("aaaaaaaa"), - SourceVault: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - }, - Enabled: to.Ptr(true), - KeyEncryptionKey: &armcompute.KeyVaultKeyReference{ - KeyURL: to.Ptr("aaaaaaaaaaaaaa"), - SourceVault: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - }, - }, - }, - Image: &armcompute.VirtualHardDisk{ - URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), - }, - ManagedDisk: &armcompute.ManagedDiskParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("aaaaaaaaaaaa"), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - Vhd: &armcompute.VirtualHardDisk{ - URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), - }, - WriteAcceleratorEnabled: to.Ptr(true), - }, - }, - UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Classic"), - Capacity: to.Ptr[int64](29), - Tier: to.Ptr("aaaaaaaaaaaaaa"), - }, - }, - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Delete_Force.json -func ExampleVirtualMachineScaleSetVMsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myvmScaleSet", - "0", - &armcompute.VirtualMachineScaleSetVMsClientBeginDeleteOptions{ForceDeletion: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json -func ExampleVirtualMachineScaleSetVMsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "{vmss-name}", - "0", - &armcompute.VirtualMachineScaleSetVMsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json -func ExampleVirtualMachineScaleSetVMsClient_GetInstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetInstanceView(ctx, - "myResourceGroup", - "myVirtualMachineScaleSet", - "0", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_List_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rgcompute", - "aaaaaaaaaaaaaaaaaaaaaa", - &armcompute.VirtualMachineScaleSetVMsClientListOptions{Filter: to.Ptr("aaaaaaaaaaaaaa"), - Select: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - Expand: to.Ptr("aaaaaaaaaaaaa"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_PowerOff_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginPowerOff() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPowerOff(ctx, - "rgcompute", - "aaaaaa", - "aaaaaaaaa", - &armcompute.VirtualMachineScaleSetVMsClientBeginPowerOffOptions{SkipShutdown: to.Ptr(true)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_Restart_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestart(ctx, - "rgcompute", - "aa", - "aaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_Start_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "rgcompute", - "aaaaaaaaaaaaaa", - "aaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_Redeploy_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginRedeploy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRedeploy(ctx, - "rgcompute", - "aaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_RetrieveBootDiagnosticsData.json -func ExampleVirtualMachineScaleSetVMsClient_RetrieveBootDiagnosticsData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RetrieveBootDiagnosticsData(ctx, - "ResourceGroup", - "myvmScaleSet", - "0", - &armcompute.VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions{SasURIExpirationTimeInMinutes: to.Ptr[int32](60)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMs_PerformMaintenance_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginPerformMaintenance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPerformMaintenance(ctx, - "rgcompute", - "aaaaaaaaaaaaaa", - "aaaaaaaaaaaa", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_SimulateEviction.json -func ExampleVirtualMachineScaleSetVMsClient_SimulateEviction() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.SimulateEviction(ctx, - "ResourceGroup", - "VmScaleSetName", - "InstanceId", - 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/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/runCommandExamples/VirtualMachineScaleSetVMRunCommand.json -func ExampleVirtualMachineScaleSetVMsClient_BeginRunCommand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineScaleSetVMsClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRunCommand(ctx, - "myResourceGroup", - "myVirtualMachineScaleSet", - "0", - armcompute.RunCommandInput{ - CommandID: to.Ptr("RunPowerShellScript"), - Script: []*string{ - to.Ptr("Write-Host Hello World!")}, - }, - 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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinesizes_client_test.go b/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinesizes_client_test.go deleted file mode 100644 index 0b617936f615..000000000000 --- a/sdk/resourcemanager/compute/armcompute/ze_generated_example_virtualmachinesizes_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/compute/resource-manager/Microsoft.Compute/stable/2022-03-01/ComputeRP/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json -func ExampleVirtualMachineSizesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armcompute.NewVirtualMachineSizesClient("{subscription-id}", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("-e", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleries_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleries_client.go index 0c45e908bcb1..15d30c4d3a50 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleries_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleries_client.go @@ -57,7 +57,7 @@ func NewCommunityGalleriesClient(subscriptionID string, credential azcore.TokenC // Get - Get a community gallery by gallery public name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 +// Generated from API version 2022-01-03 // location - Resource location. // publicGalleryName - The public name of the community gallery. // options - CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method. @@ -96,7 +96,7 @@ func (client *CommunityGalleriesClient) getCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimages_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimages_client.go index cffc731a3a00..dce59f49cc45 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimages_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimages_client.go @@ -57,7 +57,7 @@ func NewCommunityGalleryImagesClient(subscriptionID string, credential azcore.To // Get - Get a community gallery image. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 +// Generated from API version 2022-01-03 // location - Resource location. // publicGalleryName - The public name of the community gallery. // galleryImageName - The name of the community gallery image definition. @@ -102,7 +102,7 @@ func (client *CommunityGalleryImagesClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,3 +116,73 @@ func (client *CommunityGalleryImagesClient) getHandleResponse(resp *http.Respons } return result, nil } + +// NewListPager - List community gallery images inside a gallery. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-03 +// location - Resource location. +// publicGalleryName - The public name of the community gallery. +// options - CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.List +// method. +func (client *CommunityGalleryImagesClient) NewListPager(location string, publicGalleryName string, options *CommunityGalleryImagesClientListOptions) *runtime.Pager[CommunityGalleryImagesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CommunityGalleryImagesClientListResponse]{ + More: func(page CommunityGalleryImagesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CommunityGalleryImagesClientListResponse) (CommunityGalleryImagesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, publicGalleryName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return CommunityGalleryImagesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CommunityGalleryImagesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CommunityGalleryImagesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *CommunityGalleryImagesClient) listCreateRequest(ctx context.Context, location string, publicGalleryName string, options *CommunityGalleryImagesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if publicGalleryName == "" { + return nil, errors.New("parameter publicGalleryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-03") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CommunityGalleryImagesClient) listHandleResponse(resp *http.Response) (CommunityGalleryImagesClientListResponse, error) { + result := CommunityGalleryImagesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageList); err != nil { + return CommunityGalleryImagesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimageversions_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimageversions_client.go index d4287c90e346..298a88bb74f4 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimageversions_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_communitygalleryimageversions_client.go @@ -57,7 +57,7 @@ func NewCommunityGalleryImageVersionsClient(subscriptionID string, credential az // Get - Get a community gallery image version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 +// Generated from API version 2022-01-03 // location - Resource location. // publicGalleryName - The public name of the community gallery. // galleryImageName - The name of the community gallery image definition. @@ -109,7 +109,7 @@ func (client *CommunityGalleryImageVersionsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,3 +123,78 @@ func (client *CommunityGalleryImageVersionsClient) getHandleResponse(resp *http. } return result, nil } + +// NewListPager - List community gallery image versions inside an image. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-03 +// location - Resource location. +// publicGalleryName - The public name of the community gallery. +// galleryImageName - The name of the community gallery image definition. +// options - CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.List +// method. +func (client *CommunityGalleryImageVersionsClient) NewListPager(location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImageVersionsClientListOptions) *runtime.Pager[CommunityGalleryImageVersionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CommunityGalleryImageVersionsClientListResponse]{ + More: func(page CommunityGalleryImageVersionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CommunityGalleryImageVersionsClientListResponse) (CommunityGalleryImageVersionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, location, publicGalleryName, galleryImageName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return CommunityGalleryImageVersionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CommunityGalleryImageVersionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CommunityGalleryImageVersionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *CommunityGalleryImageVersionsClient) listCreateRequest(ctx context.Context, location string, publicGalleryName string, galleryImageName string, options *CommunityGalleryImageVersionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/communityGalleries/{publicGalleryName}/images/{galleryImageName}/versions" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if publicGalleryName == "" { + return nil, errors.New("parameter publicGalleryName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{publicGalleryName}", url.PathEscape(publicGalleryName)) + if galleryImageName == "" { + return nil, errors.New("parameter galleryImageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{galleryImageName}", url.PathEscape(galleryImageName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-03") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CommunityGalleryImageVersionsClient) listHandleResponse(resp *http.Response) (CommunityGalleryImageVersionsClientListResponse, error) { + result := CommunityGalleryImageVersionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CommunityGalleryImageVersionList); err != nil { + return CommunityGalleryImageVersionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_constants.go b/sdk/resourcemanager/compute/armcompute/zz_generated_constants.go index 024379ab7510..fb9bd041bfd2 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_constants.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_constants.go @@ -10,7 +10,7 @@ package armcompute const ( moduleName = "armcompute" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) type AccessLevel string @@ -50,7 +50,7 @@ func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { } } -// Architecture - The architecture of the image. Applicable to OS disks only. +// Architecture - CPU architecture supported by an OS disk. type Architecture string const ( @@ -665,30 +665,6 @@ func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { } } -// GalleryApplicationVersionPropertiesProvisioningState - The provisioning state, which only appears in the response. -type GalleryApplicationVersionPropertiesProvisioningState string - -const ( - GalleryApplicationVersionPropertiesProvisioningStateCreating GalleryApplicationVersionPropertiesProvisioningState = "Creating" - GalleryApplicationVersionPropertiesProvisioningStateDeleting GalleryApplicationVersionPropertiesProvisioningState = "Deleting" - GalleryApplicationVersionPropertiesProvisioningStateFailed GalleryApplicationVersionPropertiesProvisioningState = "Failed" - GalleryApplicationVersionPropertiesProvisioningStateMigrating GalleryApplicationVersionPropertiesProvisioningState = "Migrating" - GalleryApplicationVersionPropertiesProvisioningStateSucceeded GalleryApplicationVersionPropertiesProvisioningState = "Succeeded" - GalleryApplicationVersionPropertiesProvisioningStateUpdating GalleryApplicationVersionPropertiesProvisioningState = "Updating" -) - -// PossibleGalleryApplicationVersionPropertiesProvisioningStateValues returns the possible values for the GalleryApplicationVersionPropertiesProvisioningState const type. -func PossibleGalleryApplicationVersionPropertiesProvisioningStateValues() []GalleryApplicationVersionPropertiesProvisioningState { - return []GalleryApplicationVersionPropertiesProvisioningState{ - GalleryApplicationVersionPropertiesProvisioningStateCreating, - GalleryApplicationVersionPropertiesProvisioningStateDeleting, - GalleryApplicationVersionPropertiesProvisioningStateFailed, - GalleryApplicationVersionPropertiesProvisioningStateMigrating, - GalleryApplicationVersionPropertiesProvisioningStateSucceeded, - GalleryApplicationVersionPropertiesProvisioningStateUpdating, - } -} - type GalleryExpandParams string const ( @@ -718,75 +694,27 @@ func PossibleGalleryExtendedLocationTypeValues() []GalleryExtendedLocationType { } } -// GalleryImagePropertiesProvisioningState - The provisioning state, which only appears in the response. -type GalleryImagePropertiesProvisioningState string - -const ( - GalleryImagePropertiesProvisioningStateCreating GalleryImagePropertiesProvisioningState = "Creating" - GalleryImagePropertiesProvisioningStateDeleting GalleryImagePropertiesProvisioningState = "Deleting" - GalleryImagePropertiesProvisioningStateFailed GalleryImagePropertiesProvisioningState = "Failed" - GalleryImagePropertiesProvisioningStateMigrating GalleryImagePropertiesProvisioningState = "Migrating" - GalleryImagePropertiesProvisioningStateSucceeded GalleryImagePropertiesProvisioningState = "Succeeded" - GalleryImagePropertiesProvisioningStateUpdating GalleryImagePropertiesProvisioningState = "Updating" -) - -// PossibleGalleryImagePropertiesProvisioningStateValues returns the possible values for the GalleryImagePropertiesProvisioningState const type. -func PossibleGalleryImagePropertiesProvisioningStateValues() []GalleryImagePropertiesProvisioningState { - return []GalleryImagePropertiesProvisioningState{ - GalleryImagePropertiesProvisioningStateCreating, - GalleryImagePropertiesProvisioningStateDeleting, - GalleryImagePropertiesProvisioningStateFailed, - GalleryImagePropertiesProvisioningStateMigrating, - GalleryImagePropertiesProvisioningStateSucceeded, - GalleryImagePropertiesProvisioningStateUpdating, - } -} - -// GalleryImageVersionPropertiesProvisioningState - The provisioning state, which only appears in the response. -type GalleryImageVersionPropertiesProvisioningState string +// GalleryProvisioningState - The provisioning state, which only appears in the response. +type GalleryProvisioningState string const ( - GalleryImageVersionPropertiesProvisioningStateCreating GalleryImageVersionPropertiesProvisioningState = "Creating" - GalleryImageVersionPropertiesProvisioningStateDeleting GalleryImageVersionPropertiesProvisioningState = "Deleting" - GalleryImageVersionPropertiesProvisioningStateFailed GalleryImageVersionPropertiesProvisioningState = "Failed" - GalleryImageVersionPropertiesProvisioningStateMigrating GalleryImageVersionPropertiesProvisioningState = "Migrating" - GalleryImageVersionPropertiesProvisioningStateSucceeded GalleryImageVersionPropertiesProvisioningState = "Succeeded" - GalleryImageVersionPropertiesProvisioningStateUpdating GalleryImageVersionPropertiesProvisioningState = "Updating" + GalleryProvisioningStateCreating GalleryProvisioningState = "Creating" + GalleryProvisioningStateDeleting GalleryProvisioningState = "Deleting" + GalleryProvisioningStateFailed GalleryProvisioningState = "Failed" + GalleryProvisioningStateMigrating GalleryProvisioningState = "Migrating" + GalleryProvisioningStateSucceeded GalleryProvisioningState = "Succeeded" + GalleryProvisioningStateUpdating GalleryProvisioningState = "Updating" ) -// PossibleGalleryImageVersionPropertiesProvisioningStateValues returns the possible values for the GalleryImageVersionPropertiesProvisioningState const type. -func PossibleGalleryImageVersionPropertiesProvisioningStateValues() []GalleryImageVersionPropertiesProvisioningState { - return []GalleryImageVersionPropertiesProvisioningState{ - GalleryImageVersionPropertiesProvisioningStateCreating, - GalleryImageVersionPropertiesProvisioningStateDeleting, - GalleryImageVersionPropertiesProvisioningStateFailed, - GalleryImageVersionPropertiesProvisioningStateMigrating, - GalleryImageVersionPropertiesProvisioningStateSucceeded, - GalleryImageVersionPropertiesProvisioningStateUpdating, - } -} - -// GalleryPropertiesProvisioningState - The provisioning state, which only appears in the response. -type GalleryPropertiesProvisioningState string - -const ( - GalleryPropertiesProvisioningStateCreating GalleryPropertiesProvisioningState = "Creating" - GalleryPropertiesProvisioningStateDeleting GalleryPropertiesProvisioningState = "Deleting" - GalleryPropertiesProvisioningStateFailed GalleryPropertiesProvisioningState = "Failed" - GalleryPropertiesProvisioningStateMigrating GalleryPropertiesProvisioningState = "Migrating" - GalleryPropertiesProvisioningStateSucceeded GalleryPropertiesProvisioningState = "Succeeded" - GalleryPropertiesProvisioningStateUpdating GalleryPropertiesProvisioningState = "Updating" -) - -// PossibleGalleryPropertiesProvisioningStateValues returns the possible values for the GalleryPropertiesProvisioningState const type. -func PossibleGalleryPropertiesProvisioningStateValues() []GalleryPropertiesProvisioningState { - return []GalleryPropertiesProvisioningState{ - GalleryPropertiesProvisioningStateCreating, - GalleryPropertiesProvisioningStateDeleting, - GalleryPropertiesProvisioningStateFailed, - GalleryPropertiesProvisioningStateMigrating, - GalleryPropertiesProvisioningStateSucceeded, - GalleryPropertiesProvisioningStateUpdating, +// PossibleGalleryProvisioningStateValues returns the possible values for the GalleryProvisioningState const type. +func PossibleGalleryProvisioningStateValues() []GalleryProvisioningState { + return []GalleryProvisioningState{ + GalleryProvisioningStateCreating, + GalleryProvisioningStateDeleting, + GalleryProvisioningStateFailed, + GalleryProvisioningStateMigrating, + GalleryProvisioningStateSucceeded, + GalleryProvisioningStateUpdating, } } @@ -794,16 +722,19 @@ func PossibleGalleryPropertiesProvisioningStateValues() []GalleryPropertiesProvi // Possible values are: // Private // Groups +// Community type GallerySharingPermissionTypes string const ( - GallerySharingPermissionTypesGroups GallerySharingPermissionTypes = "Groups" - GallerySharingPermissionTypesPrivate GallerySharingPermissionTypes = "Private" + GallerySharingPermissionTypesCommunity GallerySharingPermissionTypes = "Community" + GallerySharingPermissionTypesGroups GallerySharingPermissionTypes = "Groups" + GallerySharingPermissionTypesPrivate GallerySharingPermissionTypes = "Private" ) // PossibleGallerySharingPermissionTypesValues returns the possible values for the GallerySharingPermissionTypes const type. func PossibleGallerySharingPermissionTypesValues() []GallerySharingPermissionTypes { return []GallerySharingPermissionTypes{ + GallerySharingPermissionTypesCommunity, GallerySharingPermissionTypesGroups, GallerySharingPermissionTypesPrivate, } @@ -1094,11 +1025,7 @@ func PossibleOperatingSystemTypeValues() []OperatingSystemType { } } -// OperatingSystemTypes - This property allows you to specify the type of the OS that is included in the disk when creating -// a VM from a managed image. -// Possible values are: -// Windows -// Linux +// OperatingSystemTypes - The Operating System type. type OperatingSystemTypes string const ( @@ -1656,6 +1583,24 @@ func PossibleSettingNamesValues() []SettingNames { } } +// SharedGalleryHostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' +type SharedGalleryHostCaching string + +const ( + SharedGalleryHostCachingNone SharedGalleryHostCaching = "None" + SharedGalleryHostCachingReadOnly SharedGalleryHostCaching = "ReadOnly" + SharedGalleryHostCachingReadWrite SharedGalleryHostCaching = "ReadWrite" +) + +// PossibleSharedGalleryHostCachingValues returns the possible values for the SharedGalleryHostCaching const type. +func PossibleSharedGalleryHostCachingValues() []SharedGalleryHostCaching { + return []SharedGalleryHostCaching{ + SharedGalleryHostCachingNone, + SharedGalleryHostCachingReadOnly, + SharedGalleryHostCachingReadWrite, + } +} + type SharedToValues string const ( @@ -1673,12 +1618,10 @@ func PossibleSharedToValuesValues() []SharedToValues { // Possible values are: // Subscriptions // AADTenants -// Community type SharingProfileGroupTypes string const ( SharingProfileGroupTypesAADTenants SharingProfileGroupTypes = "AADTenants" - SharingProfileGroupTypesCommunity SharingProfileGroupTypes = "Community" SharingProfileGroupTypesSubscriptions SharingProfileGroupTypes = "Subscriptions" ) @@ -1686,7 +1629,6 @@ const ( func PossibleSharingProfileGroupTypesValues() []SharingProfileGroupTypes { return []SharingProfileGroupTypes{ SharingProfileGroupTypesAADTenants, - SharingProfileGroupTypesCommunity, SharingProfileGroupTypesSubscriptions, } } diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_galleries_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_galleries_client.go index f2c82893b225..4ec14308cbd8 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_galleries_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_galleries_client.go @@ -57,7 +57,7 @@ func NewGalleriesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Create or update a Shared Image Gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods // allowed in the middle. The maximum length is 80 characters. @@ -78,7 +78,7 @@ func (client *GalleriesClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Create or update a Shared Image Gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, gallery, options) if err != nil { @@ -114,7 +114,7 @@ func (client *GalleriesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, gallery) @@ -122,7 +122,7 @@ func (client *GalleriesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Delete a Shared Image Gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery to be deleted. // options - GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method. @@ -140,7 +140,7 @@ func (client *GalleriesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Delete a Shared Image Gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleriesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, options) if err != nil { @@ -176,7 +176,7 @@ func (client *GalleriesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +184,7 @@ func (client *GalleriesClient) deleteCreateRequest(ctx context.Context, resource // Get - Retrieves information about a Shared Image Gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery. // options - GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method. @@ -223,7 +223,7 @@ func (client *GalleriesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") if options != nil && options.Select != nil { reqQP.Set("$select", string(*options.Select)) } @@ -246,7 +246,7 @@ func (client *GalleriesClient) getHandleResponse(resp *http.Response) (Galleries // NewListPager - List galleries under a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // options - GalleriesClientListOptions contains the optional parameters for the GalleriesClient.List method. func (client *GalleriesClient) NewListPager(options *GalleriesClientListOptions) *runtime.Pager[GalleriesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[GalleriesClientListResponse]{ @@ -288,7 +288,7 @@ func (client *GalleriesClient) listCreateRequest(ctx context.Context, options *G return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,7 +305,7 @@ func (client *GalleriesClient) listHandleResponse(resp *http.Response) (Gallerie // NewListByResourceGroupPager - List galleries under a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // options - GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.ListByResourceGroup // method. @@ -353,7 +353,7 @@ func (client *GalleriesClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,7 +370,7 @@ func (client *GalleriesClient) listByResourceGroupHandleResponse(resp *http.Resp // BeginUpdate - Update a Shared Image Gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery. The allowed characters are alphabets and numbers with dots and periods // allowed in the middle. The maximum length is 80 characters. @@ -390,7 +390,7 @@ func (client *GalleriesClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Update a Shared Image Gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleriesClient) update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, gallery, options) if err != nil { @@ -426,7 +426,7 @@ func (client *GalleriesClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, gallery) diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplications_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplications_client.go index 342e82b55df8..7dce8ca747a1 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplications_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplications_client.go @@ -57,7 +57,7 @@ func NewGalleryApplicationsClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Create or update a gallery Application Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Application Gallery in which the Application Definition is to be created. // galleryApplicationName - The name of the gallery Application Definition to be created or updated. The allowed characters @@ -80,7 +80,7 @@ func (client *GalleryApplicationsClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create or update a gallery Application Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryApplicationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) if err != nil { @@ -120,7 +120,7 @@ func (client *GalleryApplicationsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, galleryApplication) @@ -128,7 +128,7 @@ func (client *GalleryApplicationsClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a gallery Application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Application Gallery in which the Application Definition is to be deleted. // galleryApplicationName - The name of the gallery Application Definition to be deleted. @@ -148,7 +148,7 @@ func (client *GalleryApplicationsClient) BeginDelete(ctx context.Context, resour // Delete - Delete a gallery Application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, options) if err != nil { @@ -188,7 +188,7 @@ func (client *GalleryApplicationsClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +196,7 @@ func (client *GalleryApplicationsClient) deleteCreateRequest(ctx context.Context // Get - Retrieves information about a gallery Application Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Application Gallery from which the Application Definitions are to be retrieved. // galleryApplicationName - The name of the gallery Application Definition to be retrieved. @@ -240,7 +240,7 @@ func (client *GalleryApplicationsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +257,7 @@ func (client *GalleryApplicationsClient) getHandleResponse(resp *http.Response) // NewListByGalleryPager - List gallery Application Definitions in a gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Application Gallery from which Application Definitions are to be listed. // options - GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.ListByGallery @@ -310,7 +310,7 @@ func (client *GalleryApplicationsClient) listByGalleryCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +327,7 @@ func (client *GalleryApplicationsClient) listByGalleryHandleResponse(resp *http. // BeginUpdate - Update a gallery Application Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Application Gallery in which the Application Definition is to be updated. // galleryApplicationName - The name of the gallery Application Definition to be updated. The allowed characters are alphabets @@ -350,7 +350,7 @@ func (client *GalleryApplicationsClient) BeginUpdate(ctx context.Context, resour // Update - Update a gallery Application Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryApplicationsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication, options) if err != nil { @@ -390,7 +390,7 @@ func (client *GalleryApplicationsClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, galleryApplication) diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplicationversions_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplicationversions_client.go index 373f659ce9c0..dd674f3d9a1b 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplicationversions_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_galleryapplicationversions_client.go @@ -57,7 +57,7 @@ func NewGalleryApplicationVersionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Create or update a gallery Application Version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Application Gallery in which the Application Definition resides. // galleryApplicationName - The name of the gallery Application Definition in which the Application Version is to be created. @@ -81,7 +81,7 @@ func (client *GalleryApplicationVersionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Create or update a gallery Application Version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryApplicationVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) if err != nil { @@ -125,7 +125,7 @@ func (client *GalleryApplicationVersionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, galleryApplicationVersion) @@ -133,7 +133,7 @@ func (client *GalleryApplicationVersionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Delete a gallery Application Version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Application Gallery in which the Application Definition resides. // galleryApplicationName - The name of the gallery Application Definition in which the Application Version resides. @@ -154,7 +154,7 @@ func (client *GalleryApplicationVersionsClient) BeginDelete(ctx context.Context, // Delete - Delete a gallery Application Version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryApplicationVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, options) if err != nil { @@ -198,7 +198,7 @@ func (client *GalleryApplicationVersionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -206,7 +206,7 @@ func (client *GalleryApplicationVersionsClient) deleteCreateRequest(ctx context. // Get - Retrieves information about a gallery Application Version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Application Gallery in which the Application Definition resides. // galleryApplicationName - The name of the gallery Application Definition in which the Application Version resides. @@ -259,7 +259,7 @@ func (client *GalleryApplicationVersionsClient) getCreateRequest(ctx context.Con if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *GalleryApplicationVersionsClient) getHandleResponse(resp *http.Res // NewListByGalleryApplicationPager - List gallery Application Versions in a gallery Application Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Application Gallery in which the Application Definition resides. // galleryApplicationName - The name of the Shared Application Gallery Application Definition from which the Application Versions @@ -335,7 +335,7 @@ func (client *GalleryApplicationVersionsClient) listByGalleryApplicationCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +352,7 @@ func (client *GalleryApplicationVersionsClient) listByGalleryApplicationHandleRe // BeginUpdate - Update a gallery Application Version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Application Gallery in which the Application Definition resides. // galleryApplicationName - The name of the gallery Application Definition in which the Application Version is to be updated. @@ -376,7 +376,7 @@ func (client *GalleryApplicationVersionsClient) BeginUpdate(ctx context.Context, // Update - Update a gallery Application Version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryApplicationVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion, options) if err != nil { @@ -420,7 +420,7 @@ func (client *GalleryApplicationVersionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, galleryApplicationVersion) diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimages_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimages_client.go index 8427d5f4b5de..92a02e63fd6a 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimages_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimages_client.go @@ -57,7 +57,7 @@ func NewGalleryImagesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Create or update a gallery image definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery in which the Image Definition is to be created. // galleryImageName - The name of the gallery image definition to be created or updated. The allowed characters are alphabets @@ -80,7 +80,7 @@ func (client *GalleryImagesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Create or update a gallery image definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) if err != nil { @@ -120,7 +120,7 @@ func (client *GalleryImagesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, galleryImage) @@ -128,7 +128,7 @@ func (client *GalleryImagesClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Delete a gallery image. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery in which the Image Definition is to be deleted. // galleryImageName - The name of the gallery image definition to be deleted. @@ -148,7 +148,7 @@ func (client *GalleryImagesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Delete a gallery image. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, options) if err != nil { @@ -188,7 +188,7 @@ func (client *GalleryImagesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +196,7 @@ func (client *GalleryImagesClient) deleteCreateRequest(ctx context.Context, reso // Get - Retrieves information about a gallery image definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery from which the Image Definitions are to be retrieved. // galleryImageName - The name of the gallery image definition to be retrieved. @@ -240,7 +240,7 @@ func (client *GalleryImagesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +257,7 @@ func (client *GalleryImagesClient) getHandleResponse(resp *http.Response) (Galle // NewListByGalleryPager - List gallery image definitions in a gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery from which Image Definitions are to be listed. // options - GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.ListByGallery @@ -310,7 +310,7 @@ func (client *GalleryImagesClient) listByGalleryCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +327,7 @@ func (client *GalleryImagesClient) listByGalleryHandleResponse(resp *http.Respon // BeginUpdate - Update a gallery image definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery in which the Image Definition is to be updated. // galleryImageName - The name of the gallery image definition to be updated. The allowed characters are alphabets and numbers @@ -349,7 +349,7 @@ func (client *GalleryImagesClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Update a gallery image definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryImagesClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage, options) if err != nil { @@ -389,7 +389,7 @@ func (client *GalleryImagesClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, galleryImage) diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimageversions_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimageversions_client.go index df24c4d2c31c..cd9a87eab1a6 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimageversions_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_galleryimageversions_client.go @@ -57,7 +57,7 @@ func NewGalleryImageVersionsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Create or update a gallery image version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery in which the Image Definition resides. // galleryImageName - The name of the gallery image definition in which the Image Version is to be created. @@ -81,7 +81,7 @@ func (client *GalleryImageVersionsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Create or update a gallery image version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryImageVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) if err != nil { @@ -125,7 +125,7 @@ func (client *GalleryImageVersionsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, galleryImageVersion) @@ -133,7 +133,7 @@ func (client *GalleryImageVersionsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Delete a gallery image version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery in which the Image Definition resides. // galleryImageName - The name of the gallery image definition in which the Image Version resides. @@ -154,7 +154,7 @@ func (client *GalleryImageVersionsClient) BeginDelete(ctx context.Context, resou // Delete - Delete a gallery image version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryImageVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, options) if err != nil { @@ -198,7 +198,7 @@ func (client *GalleryImageVersionsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -206,7 +206,7 @@ func (client *GalleryImageVersionsClient) deleteCreateRequest(ctx context.Contex // Get - Retrieves information about a gallery image version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery in which the Image Definition resides. // galleryImageName - The name of the gallery image definition in which the Image Version resides. @@ -259,7 +259,7 @@ func (client *GalleryImageVersionsClient) getCreateRequest(ctx context.Context, if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +276,7 @@ func (client *GalleryImageVersionsClient) getHandleResponse(resp *http.Response) // NewListByGalleryImagePager - List gallery image versions in a gallery image definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery in which the Image Definition resides. // galleryImageName - The name of the Shared Image Gallery Image Definition from which the Image Versions are to be listed. @@ -334,7 +334,7 @@ func (client *GalleryImageVersionsClient) listByGalleryImageCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *GalleryImageVersionsClient) listByGalleryImageHandleResponse(resp // BeginUpdate - Update a gallery image version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery in which the Image Definition resides. // galleryImageName - The name of the gallery image definition in which the Image Version is to be updated. @@ -375,7 +375,7 @@ func (client *GalleryImageVersionsClient) BeginUpdate(ctx context.Context, resou // Update - Update a gallery image version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GalleryImageVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion, options) if err != nil { @@ -419,7 +419,7 @@ func (client *GalleryImageVersionsClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, galleryImageVersion) diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_gallerysharingprofile_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_gallerysharingprofile_client.go index 3ddc9614b9d5..54dd3e5e4120 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_gallerysharingprofile_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_gallerysharingprofile_client.go @@ -57,7 +57,7 @@ func NewGallerySharingProfileClient(subscriptionID string, credential azcore.Tok // BeginUpdate - Update sharing profile of a gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 // resourceGroupName - The name of the resource group. // galleryName - The name of the Shared Image Gallery. // sharingUpdate - Parameters supplied to the update gallery sharing profile. @@ -77,7 +77,7 @@ func (client *GallerySharingProfileClient) BeginUpdate(ctx context.Context, reso // Update - Update sharing profile of a gallery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-01-03 func (client *GallerySharingProfileClient) update(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, sharingUpdate, options) if err != nil { @@ -113,7 +113,7 @@ func (client *GallerySharingProfileClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, sharingUpdate) diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_models.go b/sdk/resourcemanager/compute/armcompute/zz_generated_models.go index e74c02baec63..08c00530ef09 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_models.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_models.go @@ -1085,6 +1085,16 @@ type CommunityGalleryImage struct { Type *string `json:"type,omitempty" azure:"ro"` } +// CommunityGalleryImageList - The List Community Gallery Images operation response. +type CommunityGalleryImageList struct { + // REQUIRED; A list of community gallery images. + Value []*CommunityGalleryImage `json:"value,omitempty"` + + // The uri to fetch the next page of community gallery images. Call ListNext() with this to fetch the next page of community + // gallery images. + NextLink *string `json:"nextLink,omitempty"` +} + // CommunityGalleryImageProperties - Describes the properties of a gallery image definition. type CommunityGalleryImageProperties struct { // REQUIRED; This is the gallery image definition identifier. @@ -1101,6 +1111,9 @@ type CommunityGalleryImageProperties struct { // Linux OSType *OperatingSystemTypes `json:"osType,omitempty"` + // CPU architecture supported by an OS disk. + Architecture *Architecture `json:"architecture,omitempty"` + // Describes the disallowed disk types. Disallowed *Disallowed `json:"disallowed,omitempty"` @@ -1108,12 +1121,18 @@ type CommunityGalleryImageProperties struct { // is updatable. EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` + // End-user license agreement for the current community gallery image. + Eula *string `json:"eula,omitempty"` + // A list of gallery image features. Features []*GalleryImageFeature `json:"features,omitempty"` // The hypervisor generation of the Virtual Machine. Applicable to OS disks only. HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` + // Privacy statement uri for the current community gallery image. + PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` + // Describes the gallery image definition purchase plan. This is used by marketplace images. PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` @@ -1139,15 +1158,31 @@ type CommunityGalleryImageVersion struct { Type *string `json:"type,omitempty" azure:"ro"` } +// CommunityGalleryImageVersionList - The List Community Gallery Image versions operation response. +type CommunityGalleryImageVersionList struct { + // REQUIRED; A list of community gallery image versions. + Value []*CommunityGalleryImageVersion `json:"value,omitempty"` + + // The uri to fetch the next page of community gallery image versions. Call ListNext() with this to fetch the next page of + // community gallery image versions. + NextLink *string `json:"nextLink,omitempty"` +} + // CommunityGalleryImageVersionProperties - Describes the properties of a gallery image version. type CommunityGalleryImageVersionProperties struct { // The end of life date of the gallery image version Definition. This property can be used for decommissioning purposes. This // property is updatable. EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` + // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. + ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` + // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This // property is updatable. PublishedDate *time.Time `json:"publishedDate,omitempty"` + + // Describes the storage profile of the image version. + StorageProfile *SharedGalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` } // CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get @@ -1156,23 +1191,34 @@ type CommunityGalleryImageVersionsClientGetOptions struct { // placeholder for future optional parameters } +// CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.List +// method. +type CommunityGalleryImageVersionsClientListOptions struct { + // placeholder for future optional parameters +} + // CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get method. type CommunityGalleryImagesClientGetOptions struct { // placeholder for future optional parameters } +// CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.List method. +type CommunityGalleryImagesClientListOptions struct { + // placeholder for future optional parameters +} + // CommunityGalleryInfo - Information of community gallery if current gallery is shared to community type CommunityGalleryInfo struct { - // Community gallery publisher eula + // End-user license agreement for community gallery image. Eula *string `json:"eula,omitempty"` - // Community gallery public name prefix + // The prefix of the gallery name that will be displayed publicly. Visible to all users. PublicNamePrefix *string `json:"publicNamePrefix,omitempty"` - // Community gallery publisher contact email + // Community gallery publisher support email. The email address of the publisher. Visible to all users. PublisherContact *string `json:"publisherContact,omitempty"` - // Community gallery publisher uri + // The link to the publisher website. Visible to all users. PublisherURI *string `json:"publisherUri,omitempty"` // READ-ONLY; Contains info about whether community gallery sharing is enabled. @@ -2606,7 +2652,7 @@ type GalleryApplicationVersionProperties struct { PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryApplicationVersionPropertiesProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *GalleryProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; This is the replication status of the gallery image version. ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty" azure:"ro"` @@ -2617,6 +2663,9 @@ type GalleryApplicationVersionPublishingProfile struct { // REQUIRED; The source image from which the Image Version is going to be created. Source *UserArtifactSource `json:"source,omitempty"` + // Optional. Additional settings to pass to the vm-application-manager extension. For advanced use only. + AdvancedSettings map[string]*string `json:"advancedSettings,omitempty"` + // Optional. Whether or not this application reports health. EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` @@ -2635,6 +2684,10 @@ type GalleryApplicationVersionPublishingProfile struct { // Optional parameter which specifies the mode to be used for replication. This property is not updatable. ReplicationMode *ReplicationMode `json:"replicationMode,omitempty"` + // Additional settings for the VM app that contains the target package and config file name when it is deployed to target + // VM or VM scale set. + Settings *UserArtifactSettings `json:"settings,omitempty"` + // Specifies the storage account type to be used to store the image. This property is not updatable. StorageAccountType *StorageAccountType `json:"storageAccountType,omitempty"` @@ -2887,7 +2940,7 @@ type GalleryImageProperties struct { // Linux OSType *OperatingSystemTypes `json:"osType,omitempty"` - // The architecture of the image. Applicable to OS disks only. + // CPU architecture supported by an OS disk. Architecture *Architecture `json:"architecture,omitempty"` // The description of this gallery image definition resource. This property is updatable. @@ -2922,7 +2975,7 @@ type GalleryImageProperties struct { ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryImagePropertiesProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *GalleryProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } // GalleryImageUpdate - Specifies information about the gallery image definition that you want to update. @@ -2983,7 +3036,7 @@ type GalleryImageVersionProperties struct { PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryImageVersionPropertiesProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *GalleryProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; This is the replication status of the gallery image version. ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty" azure:"ro"` @@ -3146,7 +3199,7 @@ type GalleryProperties struct { SoftDeletePolicy *SoftDeletePolicy `json:"softDeletePolicy,omitempty"` // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryPropertiesProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + ProvisioningState *GalleryProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // READ-ONLY; Sharing status of current gallery. SharingStatus *SharingStatus `json:"sharingStatus,omitempty" azure:"ro"` @@ -5578,6 +5631,29 @@ type SharedGallery struct { Name *string `json:"name,omitempty" azure:"ro"` } +// SharedGalleryDataDiskImage - This is the data disk image. +type SharedGalleryDataDiskImage struct { + // REQUIRED; This property specifies the logical unit number of the data disk. This value is used to identify data disks within + // the Virtual Machine and therefore must be unique for each data disk attached to the + // Virtual Machine. + Lun *int32 `json:"lun,omitempty"` + + // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' + HostCaching *SharedGalleryHostCaching `json:"hostCaching,omitempty"` + + // READ-ONLY; This property indicates the size of the VHD to be created. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty" azure:"ro"` +} + +// SharedGalleryDiskImage - This is the disk image base class. +type SharedGalleryDiskImage struct { + // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' + HostCaching *SharedGalleryHostCaching `json:"hostCaching,omitempty"` + + // READ-ONLY; This property indicates the size of the VHD to be created. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty" azure:"ro"` +} + // SharedGalleryIdentifier - The identifier information of shared gallery. type SharedGalleryIdentifier struct { // The unique id of this shared gallery. @@ -5625,6 +5701,9 @@ type SharedGalleryImageProperties struct { // Linux OSType *OperatingSystemTypes `json:"osType,omitempty"` + // CPU architecture supported by an OS disk. + Architecture *Architecture `json:"architecture,omitempty"` + // Describes the disallowed disk types. Disallowed *Disallowed `json:"disallowed,omitempty"` @@ -5676,9 +5755,24 @@ type SharedGalleryImageVersionProperties struct { // property is updatable. EndOfLifeDate *time.Time `json:"endOfLifeDate,omitempty"` + // If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. + ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` + // The published date of the gallery image version Definition. This property can be used for decommissioning purposes. This // property is updatable. PublishedDate *time.Time `json:"publishedDate,omitempty"` + + // Describes the storage profile of the image version. + StorageProfile *SharedGalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` +} + +// SharedGalleryImageVersionStorageProfile - This is the storage profile of a Gallery Image Version. +type SharedGalleryImageVersionStorageProfile struct { + // A list of data disk images. + DataDiskImages []*SharedGalleryDataDiskImage `json:"dataDiskImages,omitempty"` + + // This is the OS disk image. + OSDiskImage *SharedGalleryOSDiskImage `json:"osDiskImage,omitempty"` } // SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get @@ -5714,6 +5808,15 @@ type SharedGalleryList struct { NextLink *string `json:"nextLink,omitempty"` } +// SharedGalleryOSDiskImage - This is the OS disk image. +type SharedGalleryOSDiskImage struct { + // The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' + HostCaching *SharedGalleryHostCaching `json:"hostCaching,omitempty"` + + // READ-ONLY; This property indicates the size of the VHD to be created. + DiskSizeGB *int32 `json:"diskSizeGB,omitempty" azure:"ro"` +} + // SharingProfile - Profile for gallery sharing to subscription or tenant type SharingProfile struct { // Information of community gallery if current gallery is shared to community. @@ -5723,6 +5826,7 @@ type SharingProfile struct { // Possible values are: // Private // Groups + // Community Permissions *GallerySharingPermissionTypes `json:"permissions,omitempty"` // READ-ONLY; A list of sharing profile groups. @@ -5738,7 +5842,6 @@ type SharingProfileGroup struct { // Possible values are: // Subscriptions // AADTenants - // Community Type *SharingProfileGroupTypes `json:"type,omitempty"` } @@ -6259,6 +6362,19 @@ type UserArtifactManage struct { Update *string `json:"update,omitempty"` } +// UserArtifactSettings - Additional settings for the VM app that contains the target package and config file name when it +// is deployed to target VM or VM scale set. +type UserArtifactSettings struct { + // Optional. The name to assign the downloaded config file on the VM. This is limited to 4096 characters. If not specified, + // the config file will be named the Gallery Application name appended with + // "_config". + ConfigFileName *string `json:"configFileName,omitempty"` + + // Optional. The name to assign the downloaded package file on the VM. This is limited to 4096 characters. If not specified, + // the package file will be named the same as the Gallery Application name. + PackageFileName *string `json:"packageFileName,omitempty"` +} + // UserArtifactSource - The source image from which the Image Version is going to be created. type UserArtifactSource struct { // REQUIRED; Required. The mediaLink of the artifact, must be a readable storage page blob. diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_models_serde.go b/sdk/resourcemanager/compute/armcompute/zz_generated_models_serde.go index 3de398566447..732697f2af1f 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_models_serde.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_models_serde.go @@ -333,12 +333,18 @@ func (c *CommunityGalleryImageProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "architecture": + err = unpopulate(val, "Architecture", &c.Architecture) + delete(rawMsg, key) case "disallowed": err = unpopulate(val, "Disallowed", &c.Disallowed) delete(rawMsg, key) case "endOfLifeDate": err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &c.EndOfLifeDate) delete(rawMsg, key) + case "eula": + err = unpopulate(val, "Eula", &c.Eula) + delete(rawMsg, key) case "features": err = unpopulate(val, "Features", &c.Features) delete(rawMsg, key) @@ -354,6 +360,9 @@ func (c *CommunityGalleryImageProperties) UnmarshalJSON(data []byte) error { case "osType": err = unpopulate(val, "OSType", &c.OSType) delete(rawMsg, key) + case "privacyStatementUri": + err = unpopulate(val, "PrivacyStatementURI", &c.PrivacyStatementURI) + delete(rawMsg, key) case "purchasePlan": err = unpopulate(val, "PurchasePlan", &c.PurchasePlan) delete(rawMsg, key) @@ -380,9 +389,15 @@ func (c *CommunityGalleryImageVersionProperties) UnmarshalJSON(data []byte) erro case "endOfLifeDate": err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &c.EndOfLifeDate) delete(rawMsg, key) + case "excludeFromLatest": + err = unpopulate(val, "ExcludeFromLatest", &c.ExcludeFromLatest) + delete(rawMsg, key) case "publishedDate": err = unpopulateTimeRFC3339(val, "PublishedDate", &c.PublishedDate) delete(rawMsg, key) + case "storageProfile": + err = unpopulate(val, "StorageProfile", &c.StorageProfile) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -1025,6 +1040,7 @@ func (g GalleryApplicationVersion) MarshalJSON() ([]byte, error) { // MarshalJSON implements the json.Marshaller interface for type GalleryApplicationVersionPublishingProfile. func (g GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "advancedSettings", g.AdvancedSettings) populate(objectMap, "enableHealthCheck", g.EnableHealthCheck) populateTimeRFC3339(objectMap, "endOfLifeDate", g.EndOfLifeDate) populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) @@ -1032,6 +1048,7 @@ func (g GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error populateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) populate(objectMap, "replicaCount", g.ReplicaCount) populate(objectMap, "replicationMode", g.ReplicationMode) + populate(objectMap, "settings", g.Settings) populate(objectMap, "source", g.Source) populate(objectMap, "storageAccountType", g.StorageAccountType) populate(objectMap, "targetExtendedLocations", g.TargetExtendedLocations) @@ -1048,6 +1065,9 @@ func (g *GalleryApplicationVersionPublishingProfile) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { + case "advancedSettings": + err = unpopulate(val, "AdvancedSettings", &g.AdvancedSettings) + delete(rawMsg, key) case "enableHealthCheck": err = unpopulate(val, "EnableHealthCheck", &g.EnableHealthCheck) delete(rawMsg, key) @@ -1069,6 +1089,9 @@ func (g *GalleryApplicationVersionPublishingProfile) UnmarshalJSON(data []byte) case "replicationMode": err = unpopulate(val, "ReplicationMode", &g.ReplicationMode) delete(rawMsg, key) + case "settings": + err = unpopulate(val, "Settings", &g.Settings) + delete(rawMsg, key) case "source": err = unpopulate(val, "Source", &g.Source) delete(rawMsg, key) @@ -2014,6 +2037,9 @@ func (s *SharedGalleryImageProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "architecture": + err = unpopulate(val, "Architecture", &s.Architecture) + delete(rawMsg, key) case "disallowed": err = unpopulate(val, "Disallowed", &s.Disallowed) delete(rawMsg, key) @@ -2061,9 +2087,15 @@ func (s *SharedGalleryImageVersionProperties) UnmarshalJSON(data []byte) error { case "endOfLifeDate": err = unpopulateTimeRFC3339(val, "EndOfLifeDate", &s.EndOfLifeDate) delete(rawMsg, key) + case "excludeFromLatest": + err = unpopulate(val, "ExcludeFromLatest", &s.ExcludeFromLatest) + delete(rawMsg, key) case "publishedDate": err = unpopulateTimeRFC3339(val, "PublishedDate", &s.PublishedDate) delete(rawMsg, key) + case "storageProfile": + err = unpopulate(val, "StorageProfile", &s.StorageProfile) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_response_types.go b/sdk/resourcemanager/compute/armcompute/zz_generated_response_types.go index 4b95829dbf83..873a319a7da5 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_response_types.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_response_types.go @@ -261,11 +261,21 @@ type CommunityGalleryImageVersionsClientGetResponse struct { CommunityGalleryImageVersion } +// CommunityGalleryImageVersionsClientListResponse contains the response from method CommunityGalleryImageVersionsClient.List. +type CommunityGalleryImageVersionsClientListResponse struct { + CommunityGalleryImageVersionList +} + // CommunityGalleryImagesClientGetResponse contains the response from method CommunityGalleryImagesClient.Get. type CommunityGalleryImagesClientGetResponse struct { CommunityGalleryImage } +// CommunityGalleryImagesClientListResponse contains the response from method CommunityGalleryImagesClient.List. +type CommunityGalleryImagesClientListResponse struct { + CommunityGalleryImageList +} + // DedicatedHostGroupsClientCreateOrUpdateResponse contains the response from method DedicatedHostGroupsClient.CreateOrUpdate. type DedicatedHostGroupsClientCreateOrUpdateResponse struct { DedicatedHostGroup diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleries_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleries_client.go index 9f73e7295f8f..72b6b6f9796a 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleries_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleries_client.go @@ -57,7 +57,7 @@ func NewSharedGalleriesClient(subscriptionID string, credential azcore.TokenCred // Get - Get a shared gallery by subscription id or tenant id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 +// Generated from API version 2022-01-03 // location - Resource location. // galleryUniqueName - The unique name of the Shared Gallery. // options - SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. @@ -96,7 +96,7 @@ func (client *SharedGalleriesClient) getCreateRequest(ctx context.Context, locat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,7 +113,7 @@ func (client *SharedGalleriesClient) getHandleResponse(resp *http.Response) (Sha // NewListPager - List shared galleries by subscription id or tenant id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 +// Generated from API version 2022-01-03 // location - Resource location. // options - SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.List method. func (client *SharedGalleriesClient) NewListPager(location string, options *SharedGalleriesClientListOptions) *runtime.Pager[SharedGalleriesClientListResponse] { @@ -160,7 +160,7 @@ func (client *SharedGalleriesClient) listCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") + reqQP.Set("api-version", "2022-01-03") if options != nil && options.SharedTo != nil { reqQP.Set("sharedTo", string(*options.SharedTo)) } diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimages_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimages_client.go index fca3e47af50a..653f9f9a38f1 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimages_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimages_client.go @@ -57,7 +57,7 @@ func NewSharedGalleryImagesClient(subscriptionID string, credential azcore.Token // Get - Get a shared gallery image by subscription id or tenant id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 +// Generated from API version 2022-01-03 // location - Resource location. // galleryUniqueName - The unique name of the Shared Gallery. // galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. @@ -101,7 +101,7 @@ func (client *SharedGalleryImagesClient) getCreateRequest(ctx context.Context, l return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,7 +118,7 @@ func (client *SharedGalleryImagesClient) getHandleResponse(resp *http.Response) // NewListPager - List shared gallery images by subscription id or tenant id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 +// Generated from API version 2022-01-03 // location - Resource location. // galleryUniqueName - The unique name of the Shared Gallery. // options - SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.List @@ -171,7 +171,7 @@ func (client *SharedGalleryImagesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") + reqQP.Set("api-version", "2022-01-03") if options != nil && options.SharedTo != nil { reqQP.Set("sharedTo", string(*options.SharedTo)) } diff --git a/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimageversions_client.go b/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimageversions_client.go index d2257bf3273d..0bdcc816a836 100644 --- a/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimageversions_client.go +++ b/sdk/resourcemanager/compute/armcompute/zz_generated_sharedgalleryimageversions_client.go @@ -57,7 +57,7 @@ func NewSharedGalleryImageVersionsClient(subscriptionID string, credential azcor // Get - Get a shared gallery image version by subscription id or tenant id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 +// Generated from API version 2022-01-03 // location - Resource location. // galleryUniqueName - The unique name of the Shared Gallery. // galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. @@ -109,7 +109,7 @@ func (client *SharedGalleryImageVersionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") + reqQP.Set("api-version", "2022-01-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,7 +126,7 @@ func (client *SharedGalleryImageVersionsClient) getHandleResponse(resp *http.Res // NewListPager - List shared gallery image versions by subscription id or tenant id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-01 +// Generated from API version 2022-01-03 // location - Resource location. // galleryUniqueName - The unique name of the Shared Gallery. // galleryImageName - The name of the Shared Gallery Image Definition from which the Image Versions are to be listed. @@ -184,7 +184,7 @@ func (client *SharedGalleryImageVersionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-01") + reqQP.Set("api-version", "2022-01-03") if options != nil && options.SharedTo != nil { reqQP.Set("sharedTo", string(*options.SharedTo)) }