diff --git a/sdk/resourcemanager/compute/armcompute/CHANGELOG.md b/sdk/resourcemanager/compute/armcompute/CHANGELOG.md index 5d7e4d9af072..d85249dac587 100644 --- a/sdk/resourcemanager/compute/armcompute/CHANGELOG.md +++ b/sdk/resourcemanager/compute/armcompute/CHANGELOG.md @@ -1,5 +1,67 @@ # Release History +## 7.0.0 (2025-02-03) +### Breaking Changes + +- `StorageAccountTypePremiumV2LRS` from enum `StorageAccountType` has been removed +- Enum `AccessControlRulesMode` has been removed +- Enum `EndpointAccess` has been removed +- Enum `EndpointTypes` has been removed +- Enum `GalleryApplicationScriptRebootBehavior` has been removed +- Enum `SoftDeletedArtifactTypes` has been removed +- Enum `ValidationStatus` has been removed +- Function `*ClientFactory.NewGalleryInVMAccessControlProfileVersionsClient` has been removed +- Function `*ClientFactory.NewGalleryInVMAccessControlProfilesClient` has been removed +- Function `*ClientFactory.NewSoftDeletedResourceClient` has been removed +- Function `NewGalleryInVMAccessControlProfileVersionsClient` has been removed +- Function `*GalleryInVMAccessControlProfileVersionsClient.BeginCreateOrUpdate` has been removed +- Function `*GalleryInVMAccessControlProfileVersionsClient.BeginDelete` has been removed +- Function `*GalleryInVMAccessControlProfileVersionsClient.Get` has been removed +- Function `*GalleryInVMAccessControlProfileVersionsClient.NewListByGalleryInVMAccessControlProfilePager` has been removed +- Function `*GalleryInVMAccessControlProfileVersionsClient.BeginUpdate` has been removed +- Function `NewGalleryInVMAccessControlProfilesClient` has been removed +- Function `*GalleryInVMAccessControlProfilesClient.BeginCreateOrUpdate` has been removed +- Function `*GalleryInVMAccessControlProfilesClient.BeginDelete` has been removed +- Function `*GalleryInVMAccessControlProfilesClient.Get` has been removed +- Function `*GalleryInVMAccessControlProfilesClient.NewListByGalleryPager` has been removed +- Function `*GalleryInVMAccessControlProfilesClient.BeginUpdate` has been removed +- Function `NewSoftDeletedResourceClient` has been removed +- Function `*SoftDeletedResourceClient.NewListByArtifactNamePager` has been removed +- Struct `AccessControlRules` has been removed +- Struct `AccessControlRulesIdentity` has been removed +- Struct `AccessControlRulesPrivilege` has been removed +- Struct `AccessControlRulesRole` has been removed +- Struct `AccessControlRulesRoleAssignment` has been removed +- Struct `AdditionalReplicaSet` has been removed +- Struct `ExecutedValidation` has been removed +- Struct `GalleryIdentity` has been removed +- Struct `GalleryInVMAccessControlProfile` has been removed +- Struct `GalleryInVMAccessControlProfileList` has been removed +- Struct `GalleryInVMAccessControlProfileProperties` has been removed +- Struct `GalleryInVMAccessControlProfileUpdate` has been removed +- Struct `GalleryInVMAccessControlProfileVersion` has been removed +- Struct `GalleryInVMAccessControlProfileVersionList` has been removed +- Struct `GalleryInVMAccessControlProfileVersionProperties` has been removed +- Struct `GalleryInVMAccessControlProfileVersionUpdate` has been removed +- Struct `GalleryResourceProfilePropertiesBase` has been removed +- Struct `GalleryResourceProfileVersionPropertiesBase` has been removed +- Struct `GallerySoftDeletedResource` has been removed +- Struct `GallerySoftDeletedResourceList` has been removed +- Struct `GallerySoftDeletedResourceProperties` has been removed +- Struct `PlatformAttribute` has been removed +- Struct `ValidationsProfile` has been removed +- Field `IsBootstrapCertificate` of struct `CloudServiceVaultCertificate` has been removed +- Field `Identity` of struct `Gallery` has been removed +- Field `StartsAtVersion` of struct `GalleryImageFeature` has been removed +- Field `AllowUpdateImage` of struct `GalleryImageProperties` has been removed +- Field `Restore`, `ValidationsProfile` of struct `GalleryImageVersionProperties` has been removed +- Field `BlockDeletionBeforeEndOfLife` of struct `GalleryImageVersionSafetyProfile` has been removed +- Field `SecurityProfile` of struct `GalleryList` has been removed +- Field `Identity` of struct `GalleryUpdate` has been removed +- Field `AdditionalReplicaSets` of struct `TargetRegion` has been removed +- Field `ScriptBehaviorAfterReboot` of struct `UserArtifactSettings` has been removed + + ## 6.3.0 (2025-01-24) ### Features Added diff --git a/sdk/resourcemanager/compute/armcompute/README.md b/sdk/resourcemanager/compute/armcompute/README.md index 869a19f3f45f..aabcd8e45f32 100644 --- a/sdk/resourcemanager/compute/armcompute/README.md +++ b/sdk/resourcemanager/compute/armcompute/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Compute module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7 ``` ## Authorization diff --git a/sdk/resourcemanager/compute/armcompute/autorest.md b/sdk/resourcemanager/compute/armcompute/autorest.md index 6173e180c587..f6c4706ff310 100644 --- a/sdk/resourcemanager/compute/armcompute/autorest.md +++ b/sdk/resourcemanager/compute/armcompute/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/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: 6.3.0 -tag: package-2024-11-04 +module-version: 7.0.0 ``` diff --git a/sdk/resourcemanager/compute/armcompute/availabilityset_live_test.go b/sdk/resourcemanager/compute/armcompute/availabilityset_live_test.go index 760ae67003cc..df80a9e53b4e 100644 --- a/sdk/resourcemanager/compute/armcompute/availabilityset_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/availabilityset_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/availabilitysets_client.go b/sdk/resourcemanager/compute/armcompute/availabilitysets_client.go index d0389db49a05..63a296559d51 100644 --- a/sdk/resourcemanager/compute/armcompute/availabilitysets_client.go +++ b/sdk/resourcemanager/compute/armcompute/availabilitysets_client.go @@ -47,7 +47,7 @@ func NewAvailabilitySetsClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Create or update an availability set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - availabilitySetName - The name of the availability set. // - parameters - Parameters supplied to the Create Availability Set operation. @@ -95,7 +95,7 @@ func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -116,7 +116,7 @@ func (client *AvailabilitySetsClient) createOrUpdateHandleResponse(resp *http.Re // Delete - Delete an availability set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - availabilitySetName - The name of the availability set. // - options - AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method. @@ -161,7 +161,7 @@ func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +170,7 @@ func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, r // Get - Retrieves information about an availability set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - availabilitySetName - The name of the availability set. // - options - AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. @@ -216,7 +216,7 @@ func (client *AvailabilitySetsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,7 +233,7 @@ func (client *AvailabilitySetsClient) getHandleResponse(resp *http.Response) (Av // NewListPager - Lists all availability sets in a resource group. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - options - AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager // method. @@ -276,7 +276,7 @@ func (client *AvailabilitySetsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -294,7 +294,7 @@ func (client *AvailabilitySetsClient) listHandleResponse(resp *http.Response) (A // NewListAvailableSizesPager - Lists all available virtual machine sizes that can be used to create a new virtual machine // in an existing availability set. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - availabilitySetName - The name of the availability set. // - options - AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.NewListAvailableSizesPager @@ -343,7 +343,7 @@ func (client *AvailabilitySetsClient) listAvailableSizesCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -360,7 +360,7 @@ func (client *AvailabilitySetsClient) listAvailableSizesHandleResponse(resp *htt // NewListBySubscriptionPager - Lists all availability sets in a subscription. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager // method. func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse] { @@ -401,7 +401,7 @@ func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -419,7 +419,7 @@ func (client *AvailabilitySetsClient) listBySubscriptionHandleResponse(resp *htt // Update - Update an availability set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - availabilitySetName - The name of the availability set. // - parameters - Parameters supplied to the Update Availability Set operation. @@ -466,7 +466,7 @@ func (client *AvailabilitySetsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/availabilitysets_client_example_test.go b/sdk/resourcemanager/compute/armcompute/availabilitysets_client_example_test.go deleted file mode 100644 index 89b2eec4dd3e..000000000000 --- a/sdk/resourcemanager/compute/armcompute/availabilitysets_client_example_test.go +++ /dev/null @@ -1,699 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Create_WithScheduledEventProfile.json -func ExampleAvailabilitySetsClient_CreateOrUpdate_createAnAvailabilitySetWithScheduledEventPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armcompute.AvailabilitySet{ - // Name: to.Ptr("myAvailabilitySet"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.AvailabilitySetProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](2), - // PlatformUpdateDomainCount: to.Ptr[int32](20), - // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - // Enable: to.Ptr(true), - // }, - // }, - // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Create.json -func ExampleAvailabilitySetsClient_CreateOrUpdate_createAnAvailabilitySet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armcompute.AvailabilitySet{ - // Name: to.Ptr("myAvailabilitySet"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.AvailabilitySetProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](2), - // PlatformUpdateDomainCount: to.Ptr[int32](20), - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Update_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_Update_availabilitySetUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armcompute.AvailabilitySet{ - // Name: to.Ptr("myAvailabilitySet"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key2505": to.Ptr("aa"), - // "key9626": to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // }, - // 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}"), - // }, - // 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}()), - // }}, - // VirtualMachines: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // Capacity: to.Ptr[int64](29), - // Tier: to.Ptr("aaaaaaaaaaaaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Update_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_Update_availabilitySetUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().Update(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", armcompute.AvailabilitySetUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armcompute.AvailabilitySet{ - // Location: to.Ptr("westus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_Delete_availabilitySetDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAvailabilitySetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Delete_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_Delete_availabilitySetDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAvailabilitySetsClient().Delete(ctx, "rgcompute", "aaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_Get_availabilitySetGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "rgcompute", "aaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armcompute.AvailabilitySet{ - // Name: to.Ptr("myAvailabilitySet"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key2505": to.Ptr("aa"), - // "key9626": to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // }, - // 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}"), - // }, - // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - // Enable: to.Ptr(true), - // }, - // }, - // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // }, - // 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}()), - // }}, - // VirtualMachines: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // Capacity: to.Ptr[int64](29), - // Tier: to.Ptr("aaaaaaaaaaaaaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_Get_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_Get_availabilitySetGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armcompute.AvailabilitySet{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet"), - // Location: to.Ptr("westus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListBySubscriptionPager(&armcompute.AvailabilitySetsClientListBySubscriptionOptions{Expand: to.Ptr("virtualMachines\\$ref")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armcompute.AvailabilitySetListResult{ - // Value: []*armcompute.AvailabilitySet{ - // { - // Name: to.Ptr("{availabilitySetName}"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // Location: to.Ptr("australiasoutheast"), - // Properties: &armcompute.AvailabilitySetProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // PlatformUpdateDomainCount: to.Ptr[int32](5), - // VirtualMachines: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // }, - // }, - // { - // Name: to.Ptr("{availabilitySetName}"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // Location: to.Ptr("australiasoutheast"), - // Properties: &armcompute.AvailabilitySetProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // PlatformUpdateDomainCount: to.Ptr[int32](5), - // VirtualMachines: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // }, - // }, - // { - // Name: to.Ptr("{availabilitySetName}"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "{tagName}": to.Ptr("{tagValue}"), - // }, - // Properties: &armcompute.AvailabilitySetProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // PlatformUpdateDomainCount: to.Ptr[int32](5), - // VirtualMachines: []*armcompute.SubResource{ - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // }, - // }, - // { - // Name: to.Ptr("{availabilitySetName}"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "{tagName}": to.Ptr("{tagValue}"), - // }, - // Properties: &armcompute.AvailabilitySetProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // PlatformUpdateDomainCount: to.Ptr[int32](5), - // VirtualMachines: []*armcompute.SubResource{ - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_List_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListPager_availabilitySetListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListPager("rgcompute", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armcompute.AvailabilitySetListResult{ - // Value: []*armcompute.AvailabilitySet{ - // { - // Name: to.Ptr("{availabilitySetName}"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // Location: to.Ptr("australiasoutheast"), - // Tags: map[string]*string{ - // "key2039": to.Ptr("aaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.AvailabilitySetProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // PlatformUpdateDomainCount: to.Ptr[int32](5), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:39:56.427Z"); return t}()), - // }}, - // VirtualMachines: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // Capacity: to.Ptr[int64](22), - // Tier: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // { - // Name: to.Ptr("{availabilitySetName}"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // Location: to.Ptr("australiasoutheast"), - // Tags: map[string]*string{ - // "key5849": to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.AvailabilitySetProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // PlatformUpdateDomainCount: to.Ptr[int32](5), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:39:56.427Z"); return t}()), - // }}, - // VirtualMachines: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // Capacity: to.Ptr[int64](23), - // Tier: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // { - // Name: to.Ptr("{availabilitySetName}"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.AvailabilitySetProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // PlatformUpdateDomainCount: to.Ptr[int32](5), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:39:56.427Z"); return t}()), - // }}, - // VirtualMachines: []*armcompute.SubResource{ - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // Capacity: to.Ptr[int64](26), - // Tier: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // { - // Name: to.Ptr("{availabilitySetName}"), - // Type: to.Ptr("Microsoft.Compute/availabilitySets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.AvailabilitySetProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // PlatformUpdateDomainCount: to.Ptr[int32](5), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:39:56.427Z"); return t}()), - // }}, - // VirtualMachines: []*armcompute.SubResource{ - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // Capacity: to.Ptr[int64](6), - // Tier: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_List_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListPager_availabilitySetListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListPager("rgcompute", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armcompute.AvailabilitySetListResult{ - // Value: []*armcompute.AvailabilitySet{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet1"), - // Location: to.Ptr("australiasoutheast"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet2"), - // Location: to.Ptr("australiasoutheast"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet3"), - // Location: to.Ptr("westcentralus"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/availabilitySets/myAvailabilitySet4"), - // Location: to.Ptr("westcentralus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListAvailableSizesPager_availabilitySetListAvailableSizesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListAvailableSizesPager("rgcompute", "aaaaaaaaaaaaaaaaaaaa", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineSizeListResult = armcompute.VirtualMachineSizeListResult{ - // Value: []*armcompute.VirtualMachineSize{ - // { - // Name: to.Ptr("Standard_A1_V2"), - // MaxDataDiskCount: to.Ptr[int32](2), - // MemoryInMB: to.Ptr[int32](2048), - // NumberOfCores: to.Ptr[int32](1), - // OSDiskSizeInMB: to.Ptr[int32](1047552), - // ResourceDiskSizeInMB: to.Ptr[int32](10240), - // }, - // { - // Name: to.Ptr("Standard_A2_V2"), - // MaxDataDiskCount: to.Ptr[int32](4), - // MemoryInMB: to.Ptr[int32](4096), - // NumberOfCores: to.Ptr[int32](2), - // OSDiskSizeInMB: to.Ptr[int32](1047552), - // ResourceDiskSizeInMB: to.Ptr[int32](20480), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/availabilitySetExamples/AvailabilitySet_ListAvailableSizes_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListAvailableSizesPager_availabilitySetListAvailableSizesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListAvailableSizesPager("rgcompute", "aa", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineSizeListResult = armcompute.VirtualMachineSizeListResult{ - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/capacityreservation_live_test.go b/sdk/resourcemanager/compute/armcompute/capacityreservation_live_test.go index 09a600ef82ae..1cf3c31acf0c 100644 --- a/sdk/resourcemanager/compute/armcompute/capacityreservation_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/capacityreservation_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/capacityreservationgroups_client.go b/sdk/resourcemanager/compute/armcompute/capacityreservationgroups_client.go index 8eca45bd3a08..f3012ff2d957 100644 --- a/sdk/resourcemanager/compute/armcompute/capacityreservationgroups_client.go +++ b/sdk/resourcemanager/compute/armcompute/capacityreservationgroups_client.go @@ -49,7 +49,7 @@ func NewCapacityReservationGroupsClient(subscriptionID string, credential azcore // https://aka.ms/CapacityReservation for more details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - capacityReservationGroupName - The name of the capacity reservation group. // - parameters - Parameters supplied to the Create capacity reservation Group. @@ -97,7 +97,7 @@ func (client *CapacityReservationGroupsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +120,7 @@ func (client *CapacityReservationGroupsClient) createOrUpdateHandleResponse(resp // the reservation group have also been deleted. Please refer to https://aka.ms/CapacityReservation for more details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - capacityReservationGroupName - The name of the capacity reservation group. // - options - CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete @@ -166,7 +166,7 @@ func (client *CapacityReservationGroupsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -175,7 +175,7 @@ func (client *CapacityReservationGroupsClient) deleteCreateRequest(ctx context.C // Get - The operation that retrieves information about a capacity reservation group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - capacityReservationGroupName - The name of the capacity reservation group. // - options - CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get @@ -225,7 +225,7 @@ func (client *CapacityReservationGroupsClient) getCreateRequest(ctx context.Cont if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -243,7 +243,7 @@ func (client *CapacityReservationGroupsClient) getHandleResponse(resp *http.Resp // NewListByResourceGroupPager - Lists all of the capacity reservation groups in the specified resource group. Use the nextLink // property in the response to get the next page of capacity reservation groups. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - options - CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager // method. @@ -289,7 +289,7 @@ func (client *CapacityReservationGroupsClient) listByResourceGroupCreateRequest( if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,7 +307,7 @@ func (client *CapacityReservationGroupsClient) listByResourceGroupHandleResponse // NewListBySubscriptionPager - Lists all of the capacity reservation groups in the subscription. Use the nextLink property // in the response to get the next page of capacity reservation groups. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - options - CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager // method. func (client *CapacityReservationGroupsClient) NewListBySubscriptionPager(options *CapacityReservationGroupsClientListBySubscriptionOptions) *runtime.Pager[CapacityReservationGroupsClientListBySubscriptionResponse] { @@ -348,7 +348,7 @@ func (client *CapacityReservationGroupsClient) listBySubscriptionCreateRequest(c if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.ResourceIDsOnly != nil { reqQP.Set("resourceIdsOnly", string(*options.ResourceIDsOnly)) } @@ -370,7 +370,7 @@ func (client *CapacityReservationGroupsClient) listBySubscriptionHandleResponse( // sharing profile may be modified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - capacityReservationGroupName - The name of the capacity reservation group. // - parameters - Parameters supplied to the Update capacity reservation Group operation. @@ -418,7 +418,7 @@ func (client *CapacityReservationGroupsClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/capacityreservationgroups_client_example_test.go b/sdk/resourcemanager/compute/armcompute/capacityreservationgroups_client_example_test.go deleted file mode 100644 index 42c2ed8853fc..000000000000 --- a/sdk/resourcemanager/compute/armcompute/capacityreservationgroups_client_example_test.go +++ /dev/null @@ -1,483 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCapacityReservationGroupsClient().CreateOrUpdate(ctx, "myResourceGroup", "myCapacityReservationGroup", armcompute.CapacityReservationGroup{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "department": to.Ptr("finance"), - }, - Properties: &armcompute.CapacityReservationGroupProperties{ - SharingProfile: &armcompute.ResourceSharingProfile{ - SubscriptionIDs: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscription-id1}"), - }, - { - ID: to.Ptr("/subscriptions/{subscription-id2}"), - }}, - }, - }, - Zones: []*string{ - to.Ptr("1"), - to.Ptr("2")}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityReservationGroup = armcompute.CapacityReservationGroup{ - // Name: to.Ptr("myCapacityReservationGroup"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/myCapacityReservationGroup"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("finance"), - // "owner": to.Ptr("myCompany"), - // }, - // Properties: &armcompute.CapacityReservationGroupProperties{ - // SharingProfile: &armcompute.ResourceSharingProfile{ - // SubscriptionIDs: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id1}"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id2}"), - // }}, - // }, - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MaximumSet_Gen.json -func ExampleCapacityReservationGroupsClient_Update_capacityReservationGroupUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCapacityReservationGroupsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityReservationGroup = armcompute.CapacityReservationGroup{ - // Name: to.Ptr("myCapacityReservationGroup"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/myCapacityReservationGroup"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.CapacityReservationGroupProperties{ - // CapacityReservations: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // InstanceView: &armcompute.CapacityReservationGroupInstanceView{ - // CapacityReservations: []*armcompute.CapacityReservationInstanceViewWithName{ - // { - // 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{ - // VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // }, - // Name: to.Ptr("aaaaaaaaaaaaaaaa"), - // }}, - // }, - // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Update_MinimumSet_Gen.json -func ExampleCapacityReservationGroupsClient_Update_capacityReservationGroupUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCapacityReservationGroupsClient().Update(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", armcompute.CapacityReservationGroupUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityReservationGroup = armcompute.CapacityReservationGroup{ - // Location: to.Ptr("westus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MaximumSet_Gen.json -func ExampleCapacityReservationGroupsClient_Delete_capacityReservationGroupDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCapacityReservationGroupsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_Delete_MinimumSet_Gen.json -func ExampleCapacityReservationGroupsClient_Delete_capacityReservationGroupDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCapacityReservationGroupsClient().Delete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCapacityReservationGroupsClient().Get(ctx, "myResourceGroup", "myCapacityReservationGroup", &armcompute.CapacityReservationGroupsClientGetOptions{Expand: to.Ptr(armcompute.CapacityReservationGroupInstanceViewTypesInstanceView)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityReservationGroup = armcompute.CapacityReservationGroup{ - // Name: to.Ptr("myCapacityReservationGroup"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/myCapacityReservationGroup"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "{tagName}": to.Ptr("{tagValue}"), - // }, - // Properties: &armcompute.CapacityReservationGroupProperties{ - // CapacityReservations: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation1"), - // }, - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation2"), - // }}, - // InstanceView: &armcompute.CapacityReservationGroupInstanceView{ - // CapacityReservations: []*armcompute.CapacityReservationInstanceViewWithName{ - // { - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // UtilizationInfo: &armcompute.CapacityReservationUtilization{ - // CurrentCapacity: to.Ptr[int32](5), - // VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"), - // }}, - // }, - // Name: to.Ptr("myCapacityReservation1"), - // }, - // { - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // UtilizationInfo: &armcompute.CapacityReservationUtilization{ - // CurrentCapacity: to.Ptr[int32](5), - // VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM4"), - // }}, - // }, - // Name: to.Ptr("myCapacityReservation2"), - // }}, - // SharedSubscriptionIDs: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id1}"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id2}"), - // }}, - // }, - // SharingProfile: &armcompute.ResourceSharingProfile{ - // SubscriptionIDs: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id1}"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id2}"), - // }}, - // }, - // }, - // Zones: []*string{ - // to.Ptr("3"), - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCapacityReservationGroupsClient().NewListByResourceGroupPager("myResourceGroup", &armcompute.CapacityReservationGroupsClientListByResourceGroupOptions{Expand: to.Ptr(armcompute.ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef)}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CapacityReservationGroupListResult = armcompute.CapacityReservationGroupListResult{ - // Value: []*armcompute.CapacityReservationGroup{ - // { - // Name: to.Ptr("{capacityReservationGroupName}"), - // Type: to.Ptr("Microsoft.Compute/CapacityReservationGroups"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.CapacityReservationGroupProperties{ - // CapacityReservations: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation1"), - // }, - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation2"), - // }}, - // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("{capacityReservationGroupName}"), - // Type: to.Ptr("Microsoft.Compute/CapacityReservationGroups"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.CapacityReservationGroupProperties{ - // CapacityReservations: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation3"), - // }, - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation4"), - // }}, - // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscription.json -func ExampleCapacityReservationGroupsClient_NewListBySubscriptionPager_listCapacityReservationGroupsInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCapacityReservationGroupsClient().NewListBySubscriptionPager(&armcompute.CapacityReservationGroupsClientListBySubscriptionOptions{Expand: to.Ptr(armcompute.ExpandTypesForGetCapacityReservationGroupsVirtualMachinesRef), - ResourceIDsOnly: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CapacityReservationGroupListResult = armcompute.CapacityReservationGroupListResult{ - // Value: []*armcompute.CapacityReservationGroup{ - // { - // Name: to.Ptr("{capacityReservationGroupName}"), - // Type: to.Ptr("Microsoft.Compute/CapacityReservationGroups"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.CapacityReservationGroupProperties{ - // CapacityReservations: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation1"), - // }, - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation2"), - // }}, - // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/virtualMachines/myVM1"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/virtualMachines/myVM2"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("{capacityReservationGroupName}"), - // Type: to.Ptr("Microsoft.Compute/CapacityReservationGroups"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup2/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.CapacityReservationGroupProperties{ - // CapacityReservations: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup2/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation3"), - // }, - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup2/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation4"), - // }}, - // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup2/providers/Microsoft.Compute/virtualMachines/myVM3"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservationGroup_ListBySubscriptionWithResourceIdsQuery.json -func ExampleCapacityReservationGroupsClient_NewListBySubscriptionPager_listCapacityReservationGroupsWithResourceIdsOnlyInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCapacityReservationGroupsClient().NewListBySubscriptionPager(&armcompute.CapacityReservationGroupsClientListBySubscriptionOptions{Expand: nil, - ResourceIDsOnly: to.Ptr(armcompute.ResourceIDOptionsForGetCapacityReservationGroupsAll), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CapacityReservationGroupListResult = armcompute.CapacityReservationGroupListResult{ - // Value: []*armcompute.CapacityReservationGroup{ - // { - // Type: to.Ptr("Microsoft.Compute/capacityReservationGroups"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup1/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName1}"), - // Location: to.Ptr("SouthCentralUSSTG"), - // }, - // { - // Type: to.Ptr("Microsoft.Compute/capacityReservationGroups"), - // ID: to.Ptr("/subscriptions/{subscriptionId2}/resourceGroups/myResourceGroup2/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName2}"), - // Location: to.Ptr("SouthCentralUSSTG"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/capacityreservations_client.go b/sdk/resourcemanager/compute/armcompute/capacityreservations_client.go index 0fddd0adaa8a..e8c31b7e874c 100644 --- a/sdk/resourcemanager/compute/armcompute/capacityreservations_client.go +++ b/sdk/resourcemanager/compute/armcompute/capacityreservations_client.go @@ -49,7 +49,7 @@ func NewCapacityReservationsClient(subscriptionID string, credential azcore.Toke // details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - capacityReservationGroupName - The name of the capacity reservation group. // - capacityReservationName - The name of the capacity reservation. @@ -78,7 +78,7 @@ func (client *CapacityReservationsClient) BeginCreateOrUpdate(ctx context.Contex // details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *CapacityReservationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservation, options *CapacityReservationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CapacityReservationsClient.BeginCreateOrUpdate" @@ -124,7 +124,7 @@ func (client *CapacityReservationsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -138,7 +138,7 @@ func (client *CapacityReservationsClient) createOrUpdateCreateRequest(ctx contex // https://aka.ms/CapacityReservation for more details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - capacityReservationGroupName - The name of the capacity reservation group. // - capacityReservationName - The name of the capacity reservation. @@ -166,7 +166,7 @@ func (client *CapacityReservationsClient) BeginDelete(ctx context.Context, resou // https://aka.ms/CapacityReservation for more details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *CapacityReservationsClient) deleteOperation(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, options *CapacityReservationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CapacityReservationsClient.BeginDelete" @@ -212,7 +212,7 @@ func (client *CapacityReservationsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -221,7 +221,7 @@ func (client *CapacityReservationsClient) deleteCreateRequest(ctx context.Contex // Get - The operation that retrieves information about the capacity reservation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - capacityReservationGroupName - The name of the capacity reservation group. // - capacityReservationName - The name of the capacity reservation. @@ -276,7 +276,7 @@ func (client *CapacityReservationsClient) getCreateRequest(ctx context.Context, if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -294,7 +294,7 @@ func (client *CapacityReservationsClient) getHandleResponse(resp *http.Response) // NewListByCapacityReservationGroupPager - Lists all of the capacity reservations in the specified capacity reservation group. // Use the nextLink property in the response to get the next page of capacity reservations. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - capacityReservationGroupName - The name of the capacity reservation group. // - options - CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager @@ -342,7 +342,7 @@ func (client *CapacityReservationsClient) listByCapacityReservationGroupCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -360,7 +360,7 @@ func (client *CapacityReservationsClient) listByCapacityReservationGroupHandleRe // BeginUpdate - The operation to update a capacity reservation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - capacityReservationGroupName - The name of the capacity reservation group. // - capacityReservationName - The name of the capacity reservation. @@ -387,7 +387,7 @@ func (client *CapacityReservationsClient) BeginUpdate(ctx context.Context, resou // Update - The operation to update a capacity reservation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *CapacityReservationsClient) update(ctx context.Context, resourceGroupName string, capacityReservationGroupName string, capacityReservationName string, parameters CapacityReservationUpdate, options *CapacityReservationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CapacityReservationsClient.BeginUpdate" @@ -433,7 +433,7 @@ func (client *CapacityReservationsClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/capacityreservations_client_example_test.go b/sdk/resourcemanager/compute/armcompute/capacityreservations_client_example_test.go deleted file mode 100644 index a63ecea44af9..000000000000 --- a/sdk/resourcemanager/compute/armcompute/capacityreservations_client_example_test.go +++ /dev/null @@ -1,387 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCapacityReservationsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityReservation = armcompute.CapacityReservation{ - // Name: to.Ptr("myCapacityReservation"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("HR"), - // }, - // Properties: &armcompute.CapacityReservationProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), - // ReservationID: to.Ptr("{GUID}"), - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DS1_v2"), - // Capacity: to.Ptr[int64](4), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Update_MaximumSet_Gen.json -func ExampleCapacityReservationsClient_BeginUpdate_capacityReservationUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCapacityReservationsClient().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("Standard_DS1_v2"), - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityReservation = armcompute.CapacityReservation{ - // Name: to.Ptr("myCapacityReservation"), - // Type: to.Ptr("aaaaaaaaaaaaaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // 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{ - // VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // }, - // }, - // PlatformFaultDomainCount: to.Ptr[int32](3), - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), - // ReservationID: to.Ptr("{GUID}"), - // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DS1_v2"), - // Capacity: to.Ptr[int64](4), - // Tier: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Update_MinimumSet_Gen.json -func ExampleCapacityReservationsClient_BeginUpdate_capacityReservationUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCapacityReservationsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaa", armcompute.CapacityReservationUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityReservation = armcompute.CapacityReservation{ - // Location: to.Ptr("westus"), - // SKU: &armcompute.SKU{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Delete_MaximumSet_Gen.json -func ExampleCapacityReservationsClient_BeginDelete_capacityReservationDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCapacityReservationsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/capacityReservationExamples/CapacityReservation_Delete_MinimumSet_Gen.json -func ExampleCapacityReservationsClient_BeginDelete_capacityReservationDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCapacityReservationsClient().BeginDelete(ctx, "rgcompute", "aaa", "aaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCapacityReservationsClient().Get(ctx, "myResourceGroup", "myCapacityReservationGroup", "myCapacityReservation", &armcompute.CapacityReservationsClientGetOptions{Expand: to.Ptr(armcompute.CapacityReservationInstanceViewTypesInstanceView)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CapacityReservation = armcompute.CapacityReservation{ - // Name: to.Ptr("myCapacityReservation"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup/capacityReservations/myCapacityReservation"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("HR"), - // }, - // Properties: &armcompute.CapacityReservationProperties{ - // InstanceView: &armcompute.CapacityReservationInstanceView{ - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // UtilizationInfo: &armcompute.CapacityReservationUtilization{ - // CurrentCapacity: to.Ptr[int32](5), - // VirtualMachinesAllocated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"), - // }}, - // }, - // }, - // PlatformFaultDomainCount: to.Ptr[int32](3), - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), - // ReservationID: to.Ptr("{GUID}"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), - // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DS1_v2"), - // Capacity: to.Ptr[int64](4), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCapacityReservationsClient().NewListByCapacityReservationGroupPager("myResourceGroup", "myCapacityReservationGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CapacityReservationListResult = armcompute.CapacityReservationListResult{ - // Value: []*armcompute.CapacityReservation{ - // { - // Name: to.Ptr("{capacityReservationName}"), - // Type: to.Ptr("Microsoft.Compute/CapacityReservations"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/CapacityReservation/{capacityReservationName}"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "department": to.Ptr("HR"), - // }, - // Properties: &armcompute.CapacityReservationProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), - // ReservationID: to.Ptr("{GUID}"), - // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM1"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM2"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM3"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DS1_v2"), - // Capacity: to.Ptr[int64](4), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // { - // Name: to.Ptr("{capacityReservationName}"), - // Type: to.Ptr("Microsoft.Compute/CapacityReservations"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}/CapacityReservation/{capacityReservationName}"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "department": to.Ptr("HR"), - // }, - // Properties: &armcompute.CapacityReservationProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), - // ReservationID: to.Ptr("{GUID}"), - // VirtualMachinesAssociated: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM4"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_A1_v2"), - // Capacity: to.Ptr[int64](4), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/client_factory.go b/sdk/resourcemanager/compute/armcompute/client_factory.go index e4b1178136fe..dab27c87cb64 100644 --- a/sdk/resourcemanager/compute/armcompute/client_factory.go +++ b/sdk/resourcemanager/compute/armcompute/client_factory.go @@ -213,22 +213,6 @@ func (c *ClientFactory) NewGalleryImagesClient() *GalleryImagesClient { } } -// NewGalleryInVMAccessControlProfileVersionsClient creates a new instance of GalleryInVMAccessControlProfileVersionsClient. -func (c *ClientFactory) NewGalleryInVMAccessControlProfileVersionsClient() *GalleryInVMAccessControlProfileVersionsClient { - return &GalleryInVMAccessControlProfileVersionsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewGalleryInVMAccessControlProfilesClient creates a new instance of GalleryInVMAccessControlProfilesClient. -func (c *ClientFactory) NewGalleryInVMAccessControlProfilesClient() *GalleryInVMAccessControlProfilesClient { - return &GalleryInVMAccessControlProfilesClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewGallerySharingProfileClient creates a new instance of GallerySharingProfileClient. func (c *ClientFactory) NewGallerySharingProfileClient() *GallerySharingProfileClient { return &GallerySharingProfileClient{ @@ -332,14 +316,6 @@ func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient { } } -// NewSoftDeletedResourceClient creates a new instance of SoftDeletedResourceClient. -func (c *ClientFactory) NewSoftDeletedResourceClient() *SoftDeletedResourceClient { - return &SoftDeletedResourceClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewUsageClient creates a new instance of UsageClient. func (c *ClientFactory) NewUsageClient() *UsageClient { return &UsageClient{ diff --git a/sdk/resourcemanager/compute/armcompute/cloudserviceoperatingsystems_client.go b/sdk/resourcemanager/compute/armcompute/cloudserviceoperatingsystems_client.go index 3e5ee2bdfc1d..bd0cda902fb5 100644 --- a/sdk/resourcemanager/compute/armcompute/cloudserviceoperatingsystems_client.go +++ b/sdk/resourcemanager/compute/armcompute/cloudserviceoperatingsystems_client.go @@ -48,7 +48,7 @@ func NewCloudServiceOperatingSystemsClient(subscriptionID string, credential azc // (.cscfg) for a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - location - Name of the location that the OS family pertains to. // - osFamilyName - Name of the OS family. // - options - CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily @@ -95,7 +95,7 @@ func (client *CloudServiceOperatingSystemsClient) getOSFamilyCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *CloudServiceOperatingSystemsClient) getOSFamilyHandleResponse(resp // (.cscfg) for a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - location - Name of the location that the OS version pertains to. // - osVersionName - Name of the OS version. // - options - CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion @@ -161,7 +161,7 @@ func (client *CloudServiceOperatingSystemsClient) getOSVersionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *CloudServiceOperatingSystemsClient) getOSVersionHandleResponse(res // configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page // of OS Families. Do this till nextLink is null to fetch all the OS Families. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - location - Name of the location that the OS families pertain to. // - options - CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager // method. @@ -223,7 +223,7 @@ func (client *CloudServiceOperatingSystemsClient) listOSFamiliesCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +242,7 @@ func (client *CloudServiceOperatingSystemsClient) listOSFamiliesHandleResponse(r // configuration (.cscfg) for a cloud service. Use nextLink property in the response to get the next page // of OS versions. Do this till nextLink is null to fetch all the OS versions. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - location - Name of the location that the OS versions pertain to. // - options - CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager // method. @@ -285,7 +285,7 @@ func (client *CloudServiceOperatingSystemsClient) listOSVersionsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/cloudserviceoperatingsystems_client_example_test.go b/sdk/resourcemanager/compute/armcompute/cloudserviceoperatingsystems_client_example_test.go deleted file mode 100644 index e0299c36b857..000000000000 --- a/sdk/resourcemanager/compute/armcompute/cloudserviceoperatingsystems_client_example_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. -// DO NOT EDIT. - -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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_Get.json -func ExampleCloudServiceOperatingSystemsClient_GetOSVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudServiceOperatingSystemsClient().GetOSVersion(ctx, "westus2", "WA-GUEST-OS-3.90_202010-02", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OSVersion = armcompute.OSVersion{ - // Name: to.Ptr("WA-GUEST-OS-3.90_202010-02"), - // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsVersions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSVersions/WA-GUEST-OS-3.90_202010-02"), - // Location: to.Ptr("westus2"), - // Properties: &armcompute.OSVersionProperties{ - // Family: to.Ptr("3"), - // FamilyLabel: to.Ptr("Windows Server 2012"), - // IsActive: to.Ptr(true), - // IsDefault: to.Ptr(true), - // Label: to.Ptr("Windows Azure Guest OS 3.90 (Release 202010-02)"), - // Version: to.Ptr("WA-GUEST-OS-3.90_202010-02"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSVersion_List.json -func ExampleCloudServiceOperatingSystemsClient_NewListOSVersionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudServiceOperatingSystemsClient().NewListOSVersionsPager("westus2", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OSVersionListResult = armcompute.OSVersionListResult{ - // Value: []*armcompute.OSVersion{ - // { - // Name: to.Ptr("WA-GUEST-OS-3.90_202010-02"), - // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsVersions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSVersions/WA-GUEST-OS-3.90_202010-02"), - // Location: to.Ptr("westus2"), - // Properties: &armcompute.OSVersionProperties{ - // Family: to.Ptr("3"), - // FamilyLabel: to.Ptr("Windows Server 2012"), - // IsActive: to.Ptr(true), - // IsDefault: to.Ptr(true), - // Label: to.Ptr("Windows Azure Guest OS 3.90 (Release 202010-02)"), - // Version: to.Ptr("WA-GUEST-OS-3.90_202010-02"), - // }, - // }, - // { - // Name: to.Ptr("WA-GUEST-OS-4.83_202010-02"), - // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsVersions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSVersions/WA-GUEST-OS-4.83_202010-02"), - // Location: to.Ptr("westus2"), - // Properties: &armcompute.OSVersionProperties{ - // Family: to.Ptr("4"), - // FamilyLabel: to.Ptr("Windows Server 2012 R2"), - // IsActive: to.Ptr(true), - // IsDefault: to.Ptr(true), - // Label: to.Ptr("Windows Azure Guest OS 4.83 (Release 202010-02)"), - // Version: to.Ptr("WA-GUEST-OS-4.83_202010-02"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamily_Get.json -func ExampleCloudServiceOperatingSystemsClient_GetOSFamily() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudServiceOperatingSystemsClient().GetOSFamily(ctx, "westus2", "3", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OSFamily = armcompute.OSFamily{ - // Name: to.Ptr("3"), - // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsFamilies"), - // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSFamilies/3"), - // Location: to.Ptr("westus2"), - // Properties: &armcompute.OSFamilyProperties{ - // Name: to.Ptr("3"), - // Label: to.Ptr("Windows Server 2012"), - // Versions: []*armcompute.OSVersionPropertiesBase{ - // { - // IsActive: to.Ptr(true), - // IsDefault: to.Ptr(true), - // Label: to.Ptr("Windows Azure Guest OS 3.90 (Release 202010-02)"), - // Version: to.Ptr("WA-GUEST-OS-3.90_202010-02"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceOSFamilies_List.json -func ExampleCloudServiceOperatingSystemsClient_NewListOSFamiliesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudServiceOperatingSystemsClient().NewListOSFamiliesPager("westus2", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OSFamilyListResult = armcompute.OSFamilyListResult{ - // Value: []*armcompute.OSFamily{ - // { - // Name: to.Ptr("3"), - // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsFamilies"), - // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSFamilies/3"), - // Location: to.Ptr("westus2"), - // Properties: &armcompute.OSFamilyProperties{ - // Name: to.Ptr("3"), - // Label: to.Ptr("Windows Server 2012"), - // Versions: []*armcompute.OSVersionPropertiesBase{ - // { - // IsActive: to.Ptr(true), - // IsDefault: to.Ptr(true), - // Label: to.Ptr("Windows Azure Guest OS 3.90 (Release 202010-02)"), - // Version: to.Ptr("WA-GUEST-OS-3.90_202010-02"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("4"), - // Type: to.Ptr("Microsoft.Compute/locations/cloudServiceOsFamilies"), - // ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Compute/locations/westus2/cloudServiceOSFamilies/4"), - // Location: to.Ptr("westus2"), - // Properties: &armcompute.OSFamilyProperties{ - // Name: to.Ptr("4"), - // Label: to.Ptr("Windows Server 2012 R2"), - // Versions: []*armcompute.OSVersionPropertiesBase{ - // { - // IsActive: to.Ptr(true), - // IsDefault: to.Ptr(true), - // Label: to.Ptr("Windows Azure Guest OS 4.83 (Release 202010-02)"), - // Version: to.Ptr("WA-GUEST-OS-4.83_202010-02"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/cloudserviceroleinstances_client.go b/sdk/resourcemanager/compute/armcompute/cloudserviceroleinstances_client.go index 06e025bb808e..1f7cdb7c382e 100644 --- a/sdk/resourcemanager/compute/armcompute/cloudserviceroleinstances_client.go +++ b/sdk/resourcemanager/compute/armcompute/cloudserviceroleinstances_client.go @@ -47,7 +47,7 @@ func NewCloudServiceRoleInstancesClient(subscriptionID string, credential azcore // BeginDelete - Deletes a role instance from a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - roleInstanceName - Name of the role instance. // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. @@ -73,7 +73,7 @@ func (client *CloudServiceRoleInstancesClient) BeginDelete(ctx context.Context, // Delete - Deletes a role instance from a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServiceRoleInstancesClient) deleteOperation(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CloudServiceRoleInstancesClient.BeginDelete" @@ -119,7 +119,7 @@ func (client *CloudServiceRoleInstancesClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,7 +128,7 @@ func (client *CloudServiceRoleInstancesClient) deleteCreateRequest(ctx context.C // Get - Gets a role instance from a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - roleInstanceName - Name of the role instance. // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. @@ -183,7 +183,7 @@ func (client *CloudServiceRoleInstancesClient) getCreateRequest(ctx context.Cont if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *CloudServiceRoleInstancesClient) getHandleResponse(resp *http.Resp // GetInstanceView - Retrieves information about the run-time state of a role instance in a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - roleInstanceName - Name of the role instance. // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. @@ -253,7 +253,7 @@ func (client *CloudServiceRoleInstancesClient) getInstanceViewCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *CloudServiceRoleInstancesClient) getInstanceViewHandleResponse(res // GetRemoteDesktopFile - Gets a remote desktop file for a role instance in a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - roleInstanceName - Name of the role instance. // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. @@ -322,7 +322,7 @@ func (client *CloudServiceRoleInstancesClient) getRemoteDesktopFileCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() runtime.SkipBodyDownload(req) req.Raw().Header["Accept"] = []string{"application/x-rdp"} @@ -332,7 +332,7 @@ func (client *CloudServiceRoleInstancesClient) getRemoteDesktopFileCreateRequest // NewListPager - Gets the list of all role instances in a cloud service. Use nextLink property in the response to get the // next page of role instances. Do this till nextLink is null to fetch all the role instances. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager @@ -383,7 +383,7 @@ func (client *CloudServiceRoleInstancesClient) listCreateRequest(ctx context.Con if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -403,7 +403,7 @@ func (client *CloudServiceRoleInstancesClient) listHandleResponse(resp *http.Res // want to initialize storage resources, you can use Reimage Role Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - roleInstanceName - Name of the role instance. // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. @@ -431,7 +431,7 @@ func (client *CloudServiceRoleInstancesClient) BeginRebuild(ctx context.Context, // want to initialize storage resources, you can use Reimage Role Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServiceRoleInstancesClient) rebuild(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRebuildOptions) (*http.Response, error) { var err error const operationName = "CloudServiceRoleInstancesClient.BeginRebuild" @@ -477,7 +477,7 @@ func (client *CloudServiceRoleInstancesClient) rebuildCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -487,7 +487,7 @@ func (client *CloudServiceRoleInstancesClient) rebuildCreateRequest(ctx context. // or worker roles. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - roleInstanceName - Name of the role instance. // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. @@ -514,7 +514,7 @@ func (client *CloudServiceRoleInstancesClient) BeginReimage(ctx context.Context, // worker roles. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServiceRoleInstancesClient) reimage(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginReimageOptions) (*http.Response, error) { var err error const operationName = "CloudServiceRoleInstancesClient.BeginReimage" @@ -560,7 +560,7 @@ func (client *CloudServiceRoleInstancesClient) reimageCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -569,7 +569,7 @@ func (client *CloudServiceRoleInstancesClient) reimageCreateRequest(ctx context. // BeginRestart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - roleInstanceName - Name of the role instance. // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. @@ -595,7 +595,7 @@ func (client *CloudServiceRoleInstancesClient) BeginRestart(ctx context.Context, // Restart - The Reboot Role Instance asynchronous operation requests a reboot of a role instance in the cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServiceRoleInstancesClient) restart(ctx context.Context, roleInstanceName string, resourceGroupName string, cloudServiceName string, options *CloudServiceRoleInstancesClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "CloudServiceRoleInstancesClient.BeginRestart" @@ -641,7 +641,7 @@ func (client *CloudServiceRoleInstancesClient) restartCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/cloudserviceroleinstances_client_example_test.go b/sdk/resourcemanager/compute/armcompute/cloudserviceroleinstances_client_example_test.go deleted file mode 100644 index 7e6bfbcb957d..000000000000 --- a/sdk/resourcemanager/compute/armcompute/cloudserviceroleinstances_client_example_test.go +++ /dev/null @@ -1,289 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete.json -func ExampleCloudServiceRoleInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServiceRoleInstancesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get.json -func ExampleCloudServiceRoleInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudServiceRoleInstancesClient().Get(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", &armcompute.CloudServiceRoleInstancesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RoleInstance = armcompute.RoleInstance{ - // Name: to.Ptr("{roleInstance-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices/roleInstances"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/{roleInstance-name}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.RoleInstanceProperties{ - // NetworkProfile: &armcompute.RoleInstanceNetworkProfile{ - // NetworkInterfaces: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/{roleInstance-name}/networkInterfaces/nic1"), - // }}, - // }, - // }, - // SKU: &armcompute.InstanceSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_InstanceView.json -func ExampleCloudServiceRoleInstancesClient_GetInstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudServiceRoleInstancesClient().GetInstanceView(ctx, "{roleInstance-name}", "ConstosoRG", "{cs-name}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RoleInstanceView = armcompute.RoleInstanceView{ - // PlatformFaultDomain: to.Ptr[int32](0), - // PlatformUpdateDomain: to.Ptr[int32](0), - // PrivateID: to.Ptr("3491bc0c-1f6c-444f-b1d0-ec0751a74e3e"), - // Statuses: []*armcompute.ResourceInstanceViewStatus{ - // { - // Code: to.Ptr("RoleState/RoleStateStarted"), - // DisplayStatus: to.Ptr("RoleStateStarted"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr(""), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRolesInstance_List.json -func ExampleCloudServiceRoleInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudServiceRoleInstancesClient().NewListPager("ConstosoRG", "{cs-name}", &armcompute.CloudServiceRoleInstancesClientListOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RoleInstanceListResult = armcompute.RoleInstanceListResult{ - // Value: []*armcompute.RoleInstance{ - // { - // Name: to.Ptr("ContosoFrontend_IN_0"), - // Type: to.Ptr("Microsoft.Compute/cloudServices/roleInstances"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoFrontend_IN_0"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.RoleInstanceProperties{ - // NetworkProfile: &armcompute.RoleInstanceNetworkProfile{ - // NetworkInterfaces: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoFrontend_IN_0/networkInterfaces/nic1"), - // }}, - // }, - // }, - // SKU: &armcompute.InstanceSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("ContosoFrontend_IN_1"), - // Type: to.Ptr("Microsoft.Compute/cloudServices/roleInstances"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoFrontend_IN_1"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.RoleInstanceProperties{ - // NetworkProfile: &armcompute.RoleInstanceNetworkProfile{ - // NetworkInterfaces: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoFrontend_IN_1/networkInterfaces/nic1"), - // }}, - // }, - // }, - // SKU: &armcompute.InstanceSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("ContosoBackend_IN_0"), - // Type: to.Ptr("Microsoft.Compute/cloudServices/roleInstances"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoBackend_IN_0"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.RoleInstanceProperties{ - // NetworkProfile: &armcompute.RoleInstanceNetworkProfile{ - // NetworkInterfaces: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoBackend_IN_0/networkInterfaces/nic1"), - // }}, - // }, - // }, - // SKU: &armcompute.InstanceSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("ContosoBackend_IN_1"), - // Type: to.Ptr("Microsoft.Compute/cloudServices/roleInstances"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoBackend_IN_1"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.RoleInstanceProperties{ - // NetworkProfile: &armcompute.RoleInstanceNetworkProfile{ - // NetworkInterfaces: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roleInstances/ContosoBackend_IN_1/networkInterfaces/nic1"), - // }}, - // }, - // }, - // SKU: &armcompute.InstanceSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart.json -func ExampleCloudServiceRoleInstancesClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServiceRoleInstancesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage.json -func ExampleCloudServiceRoleInstancesClient_BeginReimage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServiceRoleInstancesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild.json -func ExampleCloudServiceRoleInstancesClient_BeginRebuild() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServiceRoleInstancesClient().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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Get_RemoteDesktopFile.json -func ExampleCloudServiceRoleInstancesClient_GetRemoteDesktopFile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCloudServiceRoleInstancesClient().GetRemoteDesktopFile(ctx, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "rgcloudService", "aaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/compute/armcompute/cloudserviceroles_client.go b/sdk/resourcemanager/compute/armcompute/cloudserviceroles_client.go index a7643007b4e0..a4572cf143d3 100644 --- a/sdk/resourcemanager/compute/armcompute/cloudserviceroles_client.go +++ b/sdk/resourcemanager/compute/armcompute/cloudserviceroles_client.go @@ -47,7 +47,7 @@ func NewCloudServiceRolesClient(subscriptionID string, credential azcore.TokenCr // Get - Gets a role from a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - roleName - Name of the role. // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. @@ -98,7 +98,7 @@ func (client *CloudServiceRolesClient) getCreateRequest(ctx context.Context, rol return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *CloudServiceRolesClient) getHandleResponse(resp *http.Response) (C // NewListPager - Gets a list of all roles in a cloud service. Use nextLink property in the response to get the next page // of roles. Do this till nextLink is null to fetch all the roles. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager @@ -164,7 +164,7 @@ func (client *CloudServiceRolesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/cloudserviceroles_client_example_test.go b/sdk/resourcemanager/compute/armcompute/cloudserviceroles_client_example_test.go deleted file mode 100644 index da7197b22783..000000000000 --- a/sdk/resourcemanager/compute/armcompute/cloudserviceroles_client_example_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_Get.json -func ExampleCloudServiceRolesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudServiceRolesClient().Get(ctx, "{role-name}", "ConstosoRG", "{cs-name}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudServiceRole = armcompute.CloudServiceRole{ - // Name: to.Ptr("{role-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices/roles"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roles/{role-name}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.CloudServiceRoleProperties{ - // UniqueID: to.Ptr("b03bc269-766b-4921-b91a-7dffaae4d03b:{role-name}"), - // }, - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRole_List.json -func ExampleCloudServiceRolesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudServiceRolesClient().NewListPager("ConstosoRG", "{cs-name}", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudServiceRoleListResult = armcompute.CloudServiceRoleListResult{ - // Value: []*armcompute.CloudServiceRole{ - // { - // Name: to.Ptr("ContosoFrontend"), - // Type: to.Ptr("Microsoft.Compute/cloudServices/roles"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roles/ContosoFrontend"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.CloudServiceRoleProperties{ - // UniqueID: to.Ptr("b03bc269-766b-4921-b91a-7dffaae4d03b:ContosoFrontend"), - // }, - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("ContosoBackend"), - // Type: to.Ptr("Microsoft.Compute/cloudServices/roles"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/roles/ContosoBackend"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.CloudServiceRoleProperties{ - // UniqueID: to.Ptr("b03bc269-766b-4921-b91a-7dffaae4d03b:ContosoBackend"), - // }, - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/cloudservices_client.go b/sdk/resourcemanager/compute/armcompute/cloudservices_client.go index 4bf892683efe..283d3a6feb7a 100644 --- a/sdk/resourcemanager/compute/armcompute/cloudservices_client.go +++ b/sdk/resourcemanager/compute/armcompute/cloudservices_client.go @@ -48,7 +48,7 @@ func NewCloudServicesClient(subscriptionID string, credential azcore.TokenCreden // creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - parameters - The cloud service object. @@ -74,7 +74,7 @@ func (client *CloudServicesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Create or update a cloud service. Please note some properties can be set only during cloud service creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudService, options *CloudServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudServicesClient.BeginCreateOrUpdate" @@ -116,7 +116,7 @@ func (client *CloudServicesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -128,7 +128,7 @@ func (client *CloudServicesClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete @@ -153,7 +153,7 @@ func (client *CloudServicesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CloudServicesClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *CloudServicesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -204,7 +204,7 @@ func (client *CloudServicesClient) deleteCreateRequest(ctx context.Context, reso // BeginDeleteInstances - Deletes role instances in a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances @@ -229,7 +229,7 @@ func (client *CloudServicesClient) BeginDeleteInstances(ctx context.Context, res // DeleteInstances - Deletes role instances in a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServicesClient) deleteInstances(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginDeleteInstancesOptions) (*http.Response, error) { var err error const operationName = "CloudServicesClient.BeginDeleteInstances" @@ -271,7 +271,7 @@ func (client *CloudServicesClient) deleteInstancesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -286,7 +286,7 @@ func (client *CloudServicesClient) deleteInstancesCreateRequest(ctx context.Cont // Get - Display information about a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method. @@ -332,7 +332,7 @@ func (client *CloudServicesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +350,7 @@ func (client *CloudServicesClient) getHandleResponse(resp *http.Response) (Cloud // GetInstanceView - Gets the status of a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView @@ -397,7 +397,7 @@ func (client *CloudServicesClient) getInstanceViewCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -415,7 +415,7 @@ func (client *CloudServicesClient) getInstanceViewHandleResponse(resp *http.Resp // NewListPager - Gets a list of all cloud services under a resource group. Use nextLink property in the response to get the // next page of Cloud Services. Do this till nextLink is null to fetch all the Cloud Services. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - options - CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method. func (client *CloudServicesClient) NewListPager(resourceGroupName string, options *CloudServicesClientListOptions) *runtime.Pager[CloudServicesClientListResponse] { @@ -457,7 +457,7 @@ func (client *CloudServicesClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -476,7 +476,7 @@ func (client *CloudServicesClient) listHandleResponse(resp *http.Response) (Clou // nextLink property in the response to get the next page of Cloud Services. Do this till nextLink // is null to fetch all the Cloud Services. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - options - CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager // method. func (client *CloudServicesClient) NewListAllPager(options *CloudServicesClientListAllOptions) *runtime.Pager[CloudServicesClientListAllResponse] { @@ -514,7 +514,7 @@ func (client *CloudServicesClient) listAllCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -533,7 +533,7 @@ func (client *CloudServicesClient) listAllHandleResponse(resp *http.Response) (C // resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff @@ -558,7 +558,7 @@ func (client *CloudServicesClient) BeginPowerOff(ctx context.Context, resourceGr // PowerOff - Power off the cloud service. Note that resources are still attached and you are getting charged for the resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServicesClient) powerOff(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginPowerOffOptions) (*http.Response, error) { var err error const operationName = "CloudServicesClient.BeginPowerOff" @@ -600,7 +600,7 @@ func (client *CloudServicesClient) powerOffCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -611,7 +611,7 @@ func (client *CloudServicesClient) powerOffCreateRequest(ctx context.Context, re // resources, you can use Reimage Role Instances. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild @@ -638,7 +638,7 @@ func (client *CloudServicesClient) BeginRebuild(ctx context.Context, resourceGro // resources, you can use Reimage Role Instances. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServicesClient) rebuild(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRebuildOptions) (*http.Response, error) { var err error const operationName = "CloudServicesClient.BeginRebuild" @@ -680,7 +680,7 @@ func (client *CloudServicesClient) rebuildCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -695,7 +695,7 @@ func (client *CloudServicesClient) rebuildCreateRequest(ctx context.Context, res // BeginReimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage @@ -720,7 +720,7 @@ func (client *CloudServicesClient) BeginReimage(ctx context.Context, resourceGro // Reimage - Reimage asynchronous operation reinstalls the operating system on instances of web roles or worker roles. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServicesClient) reimage(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginReimageOptions) (*http.Response, error) { var err error const operationName = "CloudServicesClient.BeginReimage" @@ -762,7 +762,7 @@ func (client *CloudServicesClient) reimageCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -777,7 +777,7 @@ func (client *CloudServicesClient) reimageCreateRequest(ctx context.Context, res // BeginRestart - Restarts one or more role instances in a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart @@ -802,7 +802,7 @@ func (client *CloudServicesClient) BeginRestart(ctx context.Context, resourceGro // Restart - Restarts one or more role instances in a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServicesClient) restart(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "CloudServicesClient.BeginRestart" @@ -844,7 +844,7 @@ func (client *CloudServicesClient) restartCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -859,7 +859,7 @@ func (client *CloudServicesClient) restartCreateRequest(ctx context.Context, res // BeginStart - Starts the cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart @@ -884,7 +884,7 @@ func (client *CloudServicesClient) BeginStart(ctx context.Context, resourceGroup // Start - Starts the cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServicesClient) start(ctx context.Context, resourceGroupName string, cloudServiceName string, options *CloudServicesClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "CloudServicesClient.BeginStart" @@ -926,7 +926,7 @@ func (client *CloudServicesClient) startCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -935,7 +935,7 @@ func (client *CloudServicesClient) startCreateRequest(ctx context.Context, resou // BeginUpdate - Update a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - parameters - The cloud service object. @@ -961,7 +961,7 @@ func (client *CloudServicesClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Update a cloud service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServicesClient) update(ctx context.Context, resourceGroupName string, cloudServiceName string, parameters CloudServiceUpdate, options *CloudServicesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudServicesClient.BeginUpdate" @@ -1003,7 +1003,7 @@ func (client *CloudServicesClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/cloudservices_client_example_test.go b/sdk/resourcemanager/compute/armcompute/cloudservices_client_example_test.go deleted file mode 100644 index 060712ad94ef..000000000000 --- a/sdk/resourcemanager/compute/armcompute/cloudservices_client_example_test.go +++ /dev/null @@ -1,1244 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithMultiRole.json -func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithMultipleRoles() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", 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), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudService = armcompute.CloudService{ - // Name: to.Ptr("{cs-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), - // 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"), - // }, - // }, - // }}, - // }, - // }}, - // }, - // OSProfile: &armcompute.CloudServiceOsProfile{ - // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ - // }, - // }, - // PackageURL: to.Ptr("{PackageUrl}"), - // ProvisioningState: to.Ptr("Succeeded"), - // 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"), - // }, - // }}, - // }, - // UniqueID: to.Ptr("7f3edf91-cb34-4a3e-971a-177dc3dd43cb"), - // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - // }, - // SystemData: &armcompute.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithMultiRole_WithZones.json -func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithMultipleRolesInASpecificAvailabilityZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", 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), - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudService = armcompute.CloudService{ - // Name: to.Ptr("{cs-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), - // 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"), - // }, - // }, - // }}, - // }, - // }}, - // }, - // OSProfile: &armcompute.CloudServiceOsProfile{ - // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ - // }, - // }, - // PackageURL: to.Ptr("{PackageUrl}"), - // ProvisioningState: to.Ptr("Succeeded"), - // 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"), - // }, - // }}, - // }, - // UniqueID: to.Ptr("7f3edf91-cb34-4a3e-971a-177dc3dd43cb"), - // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - // }, - // SystemData: &armcompute.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRole.json -func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithSingleRole() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ - Location: to.Ptr("westus"), - Properties: &armcompute.CloudServiceProperties{ - Configuration: to.Ptr("{ServiceConfiguration}"), - NetworkProfile: &armcompute.CloudServiceNetworkProfile{ - LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ - { - Name: to.Ptr("myLoadBalancer"), - Properties: &armcompute.LoadBalancerConfigurationProperties{ - FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ - { - Name: to.Ptr("myfe"), - Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ - PublicIPAddress: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"), - }, - }, - }}, - }, - }}, - }, - 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"), - }, - }}, - }, - UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudService = armcompute.CloudService{ - // Name: to.Ptr("{cs-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices"), - // ID: to.Ptr("/subscriptions/5393f919-a68a-43d0-9063-4b2bda6bffdf/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.CloudServiceProperties{ - // Configuration: to.Ptr("{ServiceConfiguration}"), - // NetworkProfile: &armcompute.CloudServiceNetworkProfile{ - // LoadBalancerConfigurations: []*armcompute.LoadBalancerConfiguration{ - // { - // Name: to.Ptr("myLoadBalancer"), - // Properties: &armcompute.LoadBalancerConfigurationProperties{ - // FrontendIPConfigurations: []*armcompute.LoadBalancerFrontendIPConfiguration{ - // { - // Name: to.Ptr("myfe"), - // Properties: &armcompute.LoadBalancerFrontendIPConfigurationProperties{ - // PublicIPAddress: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP"), - // }, - // }, - // }}, - // }, - // }}, - // }, - // OSProfile: &armcompute.CloudServiceOsProfile{ - // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ - // }, - // }, - // PackageURL: to.Ptr("{PackageUrl}"), - // ProvisioningState: to.Ptr("Succeeded"), - // 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"), - // }, - // }}, - // }, - // UniqueID: to.Ptr("14d10b45-ced7-42ef-a406-50a3df2cea7d"), - // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - // }, - // SystemData: &armcompute.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRoleAndCertificate.json -func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithSingleRoleAndCertificateFromKeyVault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", 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"), - }, - }, - }}, - }, - }}, - }, - OSProfile: &armcompute.CloudServiceOsProfile{ - Secrets: []*armcompute.CloudServiceVaultSecretGroup{ - { - SourceVault: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"), - }, - VaultCertificates: []*armcompute.CloudServiceVaultCertificate{ - { - CertificateURL: to.Ptr("https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"), - IsBootstrapCertificate: to.Ptr(true), - }}, - }}, - }, - 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"), - }, - }}, - }, - UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudService = armcompute.CloudService{ - // Name: to.Ptr("{cs-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), - // 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"), - // }, - // }, - // }}, - // }, - // }}, - // }, - // OSProfile: &armcompute.CloudServiceOsProfile{ - // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ - // { - // SourceVault: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}"), - // }, - // VaultCertificates: []*armcompute.CloudServiceVaultCertificate{ - // { - // CertificateURL: to.Ptr("https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"), - // IsBootstrapCertificate: to.Ptr(true), - // }}, - // }}, - // }, - // PackageURL: to.Ptr("{PackageUrl}"), - // ProvisioningState: to.Ptr("Succeeded"), - // 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"), - // }, - // }}, - // }, - // UniqueID: to.Ptr("60b6cd59-600b-4e02-b717-521b07aa94bf"), - // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - // }, - // SystemData: &armcompute.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Create_WithSingleRoleAndRDP.json -func ExampleCloudServicesClient_BeginCreateOrUpdate_createNewCloudServiceWithSingleRoleAndRdpExtension() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().BeginCreateOrUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudService{ - Location: to.Ptr("westus"), - Properties: &armcompute.CloudServiceProperties{ - Configuration: to.Ptr("{ServiceConfiguration}"), - ExtensionProfile: &armcompute.CloudServiceExtensionProfile{ - Extensions: []*armcompute.Extension{ - { - Name: to.Ptr("RDPExtension"), - Properties: &armcompute.CloudServiceExtensionProperties{ - Type: to.Ptr("RDP"), - AutoUpgradeMinorVersion: to.Ptr(false), - ProtectedSettings: "{password}", - Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"), - Settings: "UserAzure10/22/2021 15:05:45", - TypeHandlerVersion: to.Ptr("1.2"), - }, - }}, - }, - 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"), - }, - }}, - }, - UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudService = armcompute.CloudService{ - // Name: to.Ptr("{cs-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.CloudServiceProperties{ - // Configuration: to.Ptr("{ServiceConfiguration}"), - // ExtensionProfile: &armcompute.CloudServiceExtensionProfile{ - // Extensions: []*armcompute.Extension{ - // { - // Name: to.Ptr("RDPExtension"), - // Properties: &armcompute.CloudServiceExtensionProperties{ - // Type: to.Ptr("RDP"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"), - // RolesAppliedTo: []*string{ - // to.Ptr("*")}, - // Settings: "UserAzure10/22/2021 15:05:45", - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // }}, - // }, - // 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"), - // }, - // }, - // }}, - // }, - // }}, - // }, - // OSProfile: &armcompute.CloudServiceOsProfile{ - // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ - // }, - // }, - // PackageURL: to.Ptr("{PackageUrl}"), - // ProvisioningState: to.Ptr("Succeeded"), - // 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"), - // }, - // }}, - // }, - // UniqueID: to.Ptr("c948cccb-bbfa-4516-a250-c28abc4d0c15"), - // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - // }, - // SystemData: &armcompute.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Update_ToIncludeTags.json -func ExampleCloudServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().BeginUpdate(ctx, "ConstosoRG", "{cs-name}", armcompute.CloudServiceUpdate{ - Tags: map[string]*string{ - "Documentation": to.Ptr("RestAPI"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudService = armcompute.CloudService{ - // Name: to.Ptr("{cs-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), - // Location: to.Ptr("eastus2euap"), - // 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"), - // }, - // }, - // }}, - // }, - // }}, - // }, - // OSProfile: &armcompute.CloudServiceOsProfile{ - // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // RoleProfile: &armcompute.CloudServiceRoleProfile{ - // Roles: []*armcompute.CloudServiceRoleProfileProperties{ - // { - // Name: to.Ptr("ContosoFrontend"), - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("ContosoBackend"), - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // }, - // UniqueID: to.Ptr("4ccb4323-4740-4545-bb81-780b27375947"), - // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - // }, - // Tags: map[string]*string{ - // "Documentation": to.Ptr("RestAPI"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Delete.json -func ExampleCloudServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_WithMultiRoleAndRDP.json -func ExampleCloudServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudServicesClient().Get(ctx, "ConstosoRG", "{cs-name}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudService = armcompute.CloudService{ - // Name: to.Ptr("{cs-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.CloudServiceProperties{ - // Configuration: to.Ptr("{ServiceConfiguration}"), - // ExtensionProfile: &armcompute.CloudServiceExtensionProfile{ - // Extensions: []*armcompute.Extension{ - // { - // Name: to.Ptr("RDPExtension"), - // Properties: &armcompute.CloudServiceExtensionProperties{ - // Type: to.Ptr("RDP"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"), - // RolesAppliedTo: []*string{ - // to.Ptr("*")}, - // Settings: "userazure01/12/2022 16:29:02", - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // }}, - // }, - // 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"), - // }, - // }, - // }}, - // }, - // }}, - // }, - // OSProfile: &armcompute.CloudServiceOsProfile{ - // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // RoleProfile: &armcompute.CloudServiceRoleProfile{ - // Roles: []*armcompute.CloudServiceRoleProfileProperties{ - // { - // Name: to.Ptr("ContosoFrontend"), - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("ContosoBackend"), - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // }, - // UniqueID: to.Ptr("4ccb4323-4740-4545-bb81-780b27375947"), - // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - // }, - // SystemData: &armcompute.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-01T17:18:19.123Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Get_InstanceViewWithMultiRole.json -func ExampleCloudServicesClient_GetInstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudServicesClient().GetInstanceView(ctx, "ConstosoRG", "{cs-name}", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CloudServiceInstanceView = armcompute.CloudServiceInstanceView{ - // PrivateIDs: []*string{ - // to.Ptr("3491bc0c-1f6c-444f-b1d0-ec0751a74e3e")}, - // RoleInstance: &armcompute.InstanceViewStatusesSummary{ - // StatusesSummary: []*armcompute.StatusCodeCount{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // Count: to.Ptr[int32](4), - // }, - // { - // Code: to.Ptr("PowerState/started"), - // Count: to.Ptr[int32](4), - // }, - // { - // Code: to.Ptr("RoleState/RoleStateStarted"), - // Count: to.Ptr[int32](4), - // }}, - // }, - // SdkVersion: to.Ptr("2.9.6496.3"), - // Statuses: []*armcompute.ResourceInstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-12T11:20:07.095Z"); return t}()), - // }, - // { - // Code: to.Ptr("PowerState/started"), - // DisplayStatus: to.Ptr("Started"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-12T11:20:07.095Z"); return t}()), - // }, - // { - // Code: to.Ptr("CurrentUpgradeDomain/-1"), - // DisplayStatus: to.Ptr("Current Upgrade Domain of cloud service is -1."), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }, - // { - // Code: to.Ptr("MaxUpgradeDomain/1"), - // DisplayStatus: to.Ptr("Max Upgrade Domain of cloud service is 1."), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_BySubscription.json -func ExampleCloudServicesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudServicesClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudServiceListResult = armcompute.CloudServiceListResult{ - // Value: []*armcompute.CloudService{ - // { - // Name: to.Ptr("{cs-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.CloudServiceProperties{ - // Configuration: to.Ptr("{ServiceConfiguration}"), - // ExtensionProfile: &armcompute.CloudServiceExtensionProfile{ - // Extensions: []*armcompute.Extension{ - // { - // Name: to.Ptr("RDPExtension"), - // Properties: &armcompute.CloudServiceExtensionProperties{ - // Type: to.Ptr("RDP"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"), - // RolesAppliedTo: []*string{ - // to.Ptr("*")}, - // Settings: "userazure01/12/2022 16:29:02", - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // }}, - // }, - // 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"), - // }, - // }, - // }}, - // }, - // }}, - // }, - // OSProfile: &armcompute.CloudServiceOsProfile{ - // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // RoleProfile: &armcompute.CloudServiceRoleProfile{ - // Roles: []*armcompute.CloudServiceRoleProfileProperties{ - // { - // Name: to.Ptr("ContosoFrontend"), - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("ContosoBackend"), - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // }, - // UniqueID: to.Ptr("4ccb4323-4740-4545-bb81-780b27375947"), - // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_List_ByResourceGroup.json -func ExampleCloudServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudServicesClient().NewListPager("ConstosoRG", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudServiceListResult = armcompute.CloudServiceListResult{ - // Value: []*armcompute.CloudService{ - // { - // Name: to.Ptr("{cs-name}"), - // Type: to.Ptr("Microsoft.Compute/cloudServices"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.CloudServiceProperties{ - // Configuration: to.Ptr("{ServiceConfiguration}"), - // ExtensionProfile: &armcompute.CloudServiceExtensionProfile{ - // Extensions: []*armcompute.Extension{ - // { - // Name: to.Ptr("RDPExtension"), - // Properties: &armcompute.CloudServiceExtensionProperties{ - // Type: to.Ptr("RDP"), - // AutoUpgradeMinorVersion: to.Ptr(false), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Windows.Azure.Extensions"), - // RolesAppliedTo: []*string{ - // to.Ptr("*")}, - // Settings: "userazure01/12/2022 16:29:02", - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // }}, - // }, - // 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"), - // }, - // }, - // }}, - // }, - // }}, - // }, - // OSProfile: &armcompute.CloudServiceOsProfile{ - // Secrets: []*armcompute.CloudServiceVaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // RoleProfile: &armcompute.CloudServiceRoleProfile{ - // Roles: []*armcompute.CloudServiceRoleProfileProperties{ - // { - // Name: to.Ptr("ContosoFrontend"), - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("ContosoBackend"), - // SKU: &armcompute.CloudServiceRoleSKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // }, - // UniqueID: to.Ptr("4ccb4323-4740-4545-bb81-780b27375947"), - // UpgradeMode: to.Ptr(armcompute.CloudServiceUpgradeModeAuto), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_Start.json -func ExampleCloudServicesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudService_PowerOff.json -func ExampleCloudServicesClient_BeginPowerOff() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Restart_ByCloudService.json -func ExampleCloudServicesClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Reimage_ByCloudService.json -func ExampleCloudServicesClient_BeginReimage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Rebuild_ByCloudService.json -func ExampleCloudServicesClient_BeginRebuild() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceRoleInstance_Delete_ByCloudService.json -func ExampleCloudServicesClient_BeginDeleteInstances() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesClient().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/cloudservicesupdatedomain_client.go b/sdk/resourcemanager/compute/armcompute/cloudservicesupdatedomain_client.go index cf43568df474..a4bd1e7b126b 100644 --- a/sdk/resourcemanager/compute/armcompute/cloudservicesupdatedomain_client.go +++ b/sdk/resourcemanager/compute/armcompute/cloudservicesupdatedomain_client.go @@ -49,7 +49,7 @@ func NewCloudServicesUpdateDomainClient(subscriptionID string, credential azcore // next page of update domains. Do this till nextLink is null to fetch all the update domains. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based @@ -99,7 +99,7 @@ func (client *CloudServicesUpdateDomainClient) getUpdateDomainCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *CloudServicesUpdateDomainClient) getUpdateDomainHandleResponse(res // NewListUpdateDomainsPager - Gets a list of all update domains in a cloud service. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - options - CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager @@ -164,7 +164,7 @@ func (client *CloudServicesUpdateDomainClient) listUpdateDomainsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *CloudServicesUpdateDomainClient) listUpdateDomainsHandleResponse(r // BeginWalkUpdateDomain - Updates the role instances in the specified update domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 // - resourceGroupName - Name of the resource group. // - cloudServiceName - Name of the cloud service. // - updateDomain - Specifies an integer value that identifies the update domain. Update domains are identified with a zero-based @@ -210,7 +210,7 @@ func (client *CloudServicesUpdateDomainClient) BeginWalkUpdateDomain(ctx context // WalkUpdateDomain - Updates the role instances in the specified update domain. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-11-04 +// Generated from API version 2022-09-04 func (client *CloudServicesUpdateDomainClient) walkUpdateDomain(ctx context.Context, resourceGroupName string, cloudServiceName string, updateDomain int32, parameters UpdateDomain, options *CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions) (*http.Response, error) { var err error const operationName = "CloudServicesUpdateDomainClient.BeginWalkUpdateDomain" @@ -253,7 +253,7 @@ func (client *CloudServicesUpdateDomainClient) walkUpdateDomainCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-11-04") + reqQP.Set("api-version", "2022-09-04") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/cloudservicesupdatedomain_client_example_test.go b/sdk/resourcemanager/compute/armcompute/cloudservicesupdatedomain_client_example_test.go deleted file mode 100644 index 81822af50452..000000000000 --- a/sdk/resourcemanager/compute/armcompute/cloudservicesupdatedomain_client_example_test.go +++ /dev/null @@ -1,99 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Update.json -func ExampleCloudServicesUpdateDomainClient_BeginWalkUpdateDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudServicesUpdateDomainClient().BeginWalkUpdateDomain(ctx, "ConstosoRG", "{cs-name}", 1, armcompute.UpdateDomain{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_Get.json -func ExampleCloudServicesUpdateDomainClient_GetUpdateDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudServicesUpdateDomainClient().GetUpdateDomain(ctx, "ConstosoRG", "{cs-name}", 1, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.UpdateDomain = armcompute.UpdateDomain{ - // Name: to.Ptr("1"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/updateDomains/1"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2024-11-04/examples/CloudServiceUpdateDomain_List.json -func ExampleCloudServicesUpdateDomainClient_NewListUpdateDomainsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudServicesUpdateDomainClient().NewListUpdateDomainsPager("ConstosoRG", "{cs-name}", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.UpdateDomainListResult = armcompute.UpdateDomainListResult{ - // Value: []*armcompute.UpdateDomain{ - // { - // Name: to.Ptr("0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/updateDomains/0"), - // }, - // { - // Name: to.Ptr("1"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}/updateDomains/1"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/communitygalleries_client.go b/sdk/resourcemanager/compute/armcompute/communitygalleries_client.go index 8ec49a6e6501..431a26cdef24 100644 --- a/sdk/resourcemanager/compute/armcompute/communitygalleries_client.go +++ b/sdk/resourcemanager/compute/armcompute/communitygalleries_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-03 // - location - Resource location. // - publicGalleryName - The public name of the community gallery. // - options - CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method. @@ -93,7 +93,7 @@ func (client *CommunityGalleriesClient) getCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/communitygalleries_client_example_test.go b/sdk/resourcemanager/compute/armcompute/communitygalleries_client_example_test.go deleted file mode 100644 index f00ded4520e7..000000000000 --- a/sdk/resourcemanager/compute/armcompute/communitygalleries_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/communityGalleryExamples/CommunityGallery_Get.json -func ExampleCommunityGalleriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCommunityGalleriesClient().Get(ctx, "myLocation", "publicGalleryName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CommunityGallery = armcompute.CommunityGallery{ - // Name: to.Ptr("publicGalleryName"), - // Type: to.Ptr("Microsoft.Compute/locations/communityGallery"), - // Identifier: &armcompute.CommunityGalleryIdentifier{ - // UniqueID: to.Ptr("/CommunityGalleries/publicGalleryName"), - // }, - // Location: to.Ptr("myLocation"), - // Properties: &armcompute.CommunityGalleryProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-CommunityGallery": to.Ptr("CommunityGallery"), - // }, - // CommunityMetadata: &armcompute.CommunityGalleryMetadata{ - // Eula: to.Ptr("https://test-uri.com"), - // PrivacyStatementURI: to.Ptr("https://test-uri.com"), - // PublicNames: []*string{ - // to.Ptr("prefix-xxxxx")}, - // PublisherContact: to.Ptr("sameple@email.com"), - // PublisherURI: to.Ptr("https://test-uri.com"), - // }, - // Disclaimer: to.Ptr("https://test-uri.com"), - // }, - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/communitygalleryimages_client.go b/sdk/resourcemanager/compute/armcompute/communitygalleryimages_client.go index e802a6f687f8..4ecc005caafe 100644 --- a/sdk/resourcemanager/compute/armcompute/communitygalleryimages_client.go +++ b/sdk/resourcemanager/compute/armcompute/communitygalleryimages_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-03 // - location - Resource location. // - publicGalleryName - The public name of the community gallery. // - galleryImageName - The name of the community gallery image definition. @@ -99,7 +99,7 @@ func (client *CommunityGalleryImagesClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +116,7 @@ func (client *CommunityGalleryImagesClient) getHandleResponse(resp *http.Respons // NewListPager - List community gallery images inside a gallery. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-03 // - location - Resource location. // - publicGalleryName - The public name of the community gallery. // - options - CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager @@ -164,7 +164,7 @@ func (client *CommunityGalleryImagesClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/communitygalleryimages_client_example_test.go b/sdk/resourcemanager/compute/armcompute/communitygalleryimages_client_example_test.go deleted file mode 100644 index 55b54744b121..000000000000 --- a/sdk/resourcemanager/compute/armcompute/communitygalleryimages_client_example_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. -// DO NOT EDIT. - -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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/communityGalleryExamples/CommunityGalleryImage_Get.json -func ExampleCommunityGalleryImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCommunityGalleryImagesClient().Get(ctx, "myLocation", "publicGalleryName", "myGalleryImageName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CommunityGalleryImage = armcompute.CommunityGalleryImage{ - // Name: to.Ptr("myGalleryImageName"), - // Type: to.Ptr("Microsoft.Compute/locations/communityGalleryImage"), - // Identifier: &armcompute.CommunityGalleryIdentifier{ - // UniqueID: to.Ptr("/CommunityGalleries/publicGalleryName/Images/myGalleryImageName"), - // }, - // Location: to.Ptr("myLocation"), - // Properties: &armcompute.CommunityGalleryImageProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-CommunityGallery": to.Ptr("CommunityGallery"), - // }, - // Disclaimer: to.Ptr("https://test-uri.com"), - // Eula: to.Ptr("https://test-uri.com"), - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // Identifier: &armcompute.CommunityGalleryImageIdentifier{ - // Offer: to.Ptr("myOfferName"), - // Publisher: to.Ptr("myPublisherName"), - // SKU: to.Ptr("mySkuName"), - // }, - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // PrivacyStatementURI: to.Ptr("https://test-uri.com"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/communityGalleryExamples/CommunityGalleryImage_List.json -func ExampleCommunityGalleryImagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCommunityGalleryImagesClient().NewListPager("myLocation", "publicGalleryName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CommunityGalleryImageList = armcompute.CommunityGalleryImageList{ - // Value: []*armcompute.CommunityGalleryImage{ - // { - // Name: to.Ptr("myGalleryImageName"), - // Identifier: &armcompute.CommunityGalleryIdentifier{ - // UniqueID: to.Ptr("/CommunityGalleries/publicGalleryName/Images/myGalleryImageName"), - // }, - // Location: to.Ptr("myLocation"), - // Properties: &armcompute.CommunityGalleryImageProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-CommunityGallery": to.Ptr("CommunityGallery"), - // }, - // Disclaimer: to.Ptr("https://test-uri.com"), - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // Identifier: &armcompute.CommunityGalleryImageIdentifier{ - // Offer: to.Ptr("myOfferName"), - // Publisher: to.Ptr("myPublisherName"), - // SKU: to.Ptr("mySkuName"), - // }, - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/communitygalleryimageversions_client.go b/sdk/resourcemanager/compute/armcompute/communitygalleryimageversions_client.go index 60855501886b..e98cfa506c7d 100644 --- a/sdk/resourcemanager/compute/armcompute/communitygalleryimageversions_client.go +++ b/sdk/resourcemanager/compute/armcompute/communitygalleryimageversions_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-03 // - location - Resource location. // - publicGalleryName - The public name of the community gallery. // - galleryImageName - The name of the community gallery image definition. @@ -106,7 +106,7 @@ func (client *CommunityGalleryImageVersionsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +123,7 @@ func (client *CommunityGalleryImageVersionsClient) getHandleResponse(resp *http. // NewListPager - List community gallery image versions inside an image. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-03 // - location - Resource location. // - publicGalleryName - The public name of the community gallery. // - galleryImageName - The name of the community gallery image definition. @@ -176,7 +176,7 @@ func (client *CommunityGalleryImageVersionsClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/communitygalleryimageversions_client_example_test.go b/sdk/resourcemanager/compute/armcompute/communitygalleryimageversions_client_example_test.go deleted file mode 100644 index d37b3004a738..000000000000 --- a/sdk/resourcemanager/compute/armcompute/communitygalleryimageversions_client_example_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. -// DO NOT EDIT. - -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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_Get.json -func ExampleCommunityGalleryImageVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCommunityGalleryImageVersionsClient().Get(ctx, "myLocation", "publicGalleryName", "myGalleryImageName", "myGalleryImageVersionName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CommunityGalleryImageVersion = armcompute.CommunityGalleryImageVersion{ - // Name: to.Ptr("myGalleryImageVersionName"), - // Type: to.Ptr("Microsoft.Compute/locations/communityGalleryImageVersion"), - // Identifier: &armcompute.CommunityGalleryIdentifier{ - // UniqueID: to.Ptr("/CommunityGalleries/publicGalleryName/Images/myGalleryImageName/Versions/myGalleryImageVersionName"), - // }, - // Location: to.Ptr("myLocation"), - // Properties: &armcompute.CommunityGalleryImageVersionProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-CommunityGallery": to.Ptr("CommunityGallery"), - // }, - // Disclaimer: to.Ptr("https://test-uri.com"), - // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-20T09:12:28.000Z"); return t}()), - // ExcludeFromLatest: to.Ptr(false), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-20T09:12:28.000Z"); return t}()), - // StorageProfile: &armcompute.SharedGalleryImageVersionStorageProfile{ - // OSDiskImage: &armcompute.SharedGalleryOSDiskImage{ - // DiskSizeGB: to.Ptr[int32](29), - // HostCaching: to.Ptr(armcompute.SharedGalleryHostCachingNone), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/communityGalleryExamples/CommunityGalleryImageVersion_List.json -func ExampleCommunityGalleryImageVersionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCommunityGalleryImageVersionsClient().NewListPager("myLocation", "publicGalleryName", "myGalleryImageName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CommunityGalleryImageVersionList = armcompute.CommunityGalleryImageVersionList{ - // Value: []*armcompute.CommunityGalleryImageVersion{ - // { - // Name: to.Ptr("myGalleryImageVersionName"), - // Identifier: &armcompute.CommunityGalleryIdentifier{ - // UniqueID: to.Ptr("/CommunityGalleries/publicGalleryName/Images/myGalleryImageName/Versions/myGalleryImageVersionName"), - // }, - // Location: to.Ptr("myLocation"), - // Properties: &armcompute.CommunityGalleryImageVersionProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-CommunityGallery": to.Ptr("CommunityGallery"), - // }, - // Disclaimer: to.Ptr("https://test-uri.com"), - // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-20T09:12:28.000Z"); return t}()), - // ExcludeFromLatest: to.Ptr(false), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-20T09:12:28.000Z"); return t}()), - // StorageProfile: &armcompute.SharedGalleryImageVersionStorageProfile{ - // OSDiskImage: &armcompute.SharedGalleryOSDiskImage{ - // DiskSizeGB: to.Ptr[int32](29), - // HostCaching: to.Ptr(armcompute.SharedGalleryHostCachingNone), - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/computerpcommon_live_test.go b/sdk/resourcemanager/compute/armcompute/computerpcommon_live_test.go index 22617a0eb2f5..6bb3cd6cb26d 100644 --- a/sdk/resourcemanager/compute/armcompute/computerpcommon_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/computerpcommon_live_test.go @@ -14,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/constants.go b/sdk/resourcemanager/compute/armcompute/constants.go index 82371fb0fb7d..907a015ca0e0 100644 --- a/sdk/resourcemanager/compute/armcompute/constants.go +++ b/sdk/resourcemanager/compute/armcompute/constants.go @@ -10,28 +10,9 @@ package armcompute const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute" - moduleVersion = "v6.3.0" + moduleVersion = "v7.0.0" ) -// AccessControlRulesMode - This property allows you to specify whether the access control rules are in Audit mode, in Enforce -// mode or Disabled. Possible values are: 'Audit', 'Enforce' or 'Disabled'. -type AccessControlRulesMode string - -const ( - AccessControlRulesModeAudit AccessControlRulesMode = "Audit" - AccessControlRulesModeDisabled AccessControlRulesMode = "Disabled" - AccessControlRulesModeEnforce AccessControlRulesMode = "Enforce" -) - -// PossibleAccessControlRulesModeValues returns the possible values for the AccessControlRulesMode const type. -func PossibleAccessControlRulesModeValues() []AccessControlRulesMode { - return []AccessControlRulesMode{ - AccessControlRulesModeAudit, - AccessControlRulesModeDisabled, - AccessControlRulesModeEnforce, - } -} - type AccessLevel string const ( @@ -104,7 +85,7 @@ func PossibleAlternativeTypeValues() []AlternativeType { } } -// Architecture - CPU architecture supported by an OS disk. +// Architecture - The architecture of the image. Applicable to OS disks only. type Architecture string const ( @@ -751,40 +732,6 @@ func PossibleEncryptionTypeValues() []EncryptionType { } } -// EndpointAccess - This property allows you to specify if the requests will be allowed to access the host endpoints. Possible -// values are: 'Allow', 'Deny'. -type EndpointAccess string - -const ( - EndpointAccessAllow EndpointAccess = "Allow" - EndpointAccessDeny EndpointAccess = "Deny" -) - -// PossibleEndpointAccessValues returns the possible values for the EndpointAccess const type. -func PossibleEndpointAccessValues() []EndpointAccess { - return []EndpointAccess{ - EndpointAccessAllow, - EndpointAccessDeny, - } -} - -// EndpointTypes - This property allows you to specify the Endpoint type for which this profile is defining the access control -// for. Possible values are: 'WireServer' or 'IMDS' -type EndpointTypes string - -const ( - EndpointTypesIMDS EndpointTypes = "IMDS" - EndpointTypesWireServer EndpointTypes = "WireServer" -) - -// PossibleEndpointTypesValues returns the possible values for the EndpointTypes const type. -func PossibleEndpointTypesValues() []EndpointTypes { - return []EndpointTypes{ - EndpointTypesIMDS, - EndpointTypesWireServer, - } -} - // ExecutionState - Script execution status. type ExecutionState string @@ -930,23 +877,6 @@ func PossibleGalleryApplicationCustomActionParameterTypeValues() []GalleryApplic } } -// GalleryApplicationScriptRebootBehavior - Optional. The action to be taken with regards to install/update/remove of the -// gallery application in the event of a reboot. -type GalleryApplicationScriptRebootBehavior string - -const ( - GalleryApplicationScriptRebootBehaviorNone GalleryApplicationScriptRebootBehavior = "None" - GalleryApplicationScriptRebootBehaviorRerun GalleryApplicationScriptRebootBehavior = "Rerun" -) - -// PossibleGalleryApplicationScriptRebootBehaviorValues returns the possible values for the GalleryApplicationScriptRebootBehavior const type. -func PossibleGalleryApplicationScriptRebootBehaviorValues() []GalleryApplicationScriptRebootBehavior { - return []GalleryApplicationScriptRebootBehavior{ - GalleryApplicationScriptRebootBehaviorNone, - GalleryApplicationScriptRebootBehaviorRerun, - } -} - type GalleryExpandParams string const ( @@ -1380,7 +1310,8 @@ func PossibleOperatingSystemTypeValues() []OperatingSystemType { } } -// OperatingSystemTypes - The Operating System type. +// OperatingSystemTypes - This property allows you to specify the supported type of the OS that application is built for. +// Possible values are: Windows, Linux. type OperatingSystemTypes string const ( @@ -1789,9 +1720,9 @@ func PossibleResourceIDOptionsForGetCapacityReservationGroupsValues() []Resource } } -// ResourceIdentityType - The type of identity used for the gallery. The type 'SystemAssigned, UserAssigned' includes both -// an implicitly created identity and a set of user assigned identities. The type 'None' will remove all -// identities from the gallery. +// ResourceIdentityType - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' +// includes both an implicitly created identity and a set of user assigned identities. The type 'None' +// will remove any identities from the virtual machine scale set. type ResourceIdentityType string const ( @@ -2143,20 +2074,6 @@ func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { } } -// SoftDeletedArtifactTypes - artifact type of the soft-deleted resource -type SoftDeletedArtifactTypes string - -const ( - SoftDeletedArtifactTypesImages SoftDeletedArtifactTypes = "Images" -) - -// PossibleSoftDeletedArtifactTypesValues returns the possible values for the SoftDeletedArtifactTypes const type. -func PossibleSoftDeletedArtifactTypesValues() []SoftDeletedArtifactTypes { - return []SoftDeletedArtifactTypes{ - SoftDeletedArtifactTypesImages, - } -} - // StatusLevelTypes - The level code. type StatusLevelTypes string @@ -2179,17 +2096,15 @@ func PossibleStatusLevelTypesValues() []StatusLevelTypes { type StorageAccountType string const ( - StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" - StorageAccountTypePremiumV2LRS StorageAccountType = "PremiumV2_LRS" - StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" - StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" + StorageAccountTypePremiumLRS StorageAccountType = "Premium_LRS" + StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" + StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" ) // PossibleStorageAccountTypeValues returns the possible values for the StorageAccountType const type. func PossibleStorageAccountTypeValues() []StorageAccountType { return []StorageAccountType{ StorageAccountTypePremiumLRS, - StorageAccountTypePremiumV2LRS, StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS, } @@ -2443,24 +2358,6 @@ func PossibleVMGuestPatchRebootStatusValues() []VMGuestPatchRebootStatus { } } -// ValidationStatus - This property specifies the status of the validationProfile of the image version. -type ValidationStatus string - -const ( - ValidationStatusFailed ValidationStatus = "Failed" - ValidationStatusSucceeded ValidationStatus = "Succeeded" - ValidationStatusUnknown ValidationStatus = "Unknown" -) - -// PossibleValidationStatusValues returns the possible values for the ValidationStatus const type. -func PossibleValidationStatusValues() []ValidationStatus { - return []ValidationStatus{ - ValidationStatusFailed, - ValidationStatusSucceeded, - ValidationStatusUnknown, - } -} - // VirtualMachineEvictionPolicyTypes - Specifies the eviction policy for the Azure Spot VM/VMSS type VirtualMachineEvictionPolicyTypes string diff --git a/sdk/resourcemanager/compute/armcompute/dedicatedhost_live_test.go b/sdk/resourcemanager/compute/armcompute/dedicatedhost_live_test.go index 02af9447bb9a..423da449e901 100644 --- a/sdk/resourcemanager/compute/armcompute/dedicatedhost_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/dedicatedhost_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/dedicatedhostgroups_client.go b/sdk/resourcemanager/compute/armcompute/dedicatedhostgroups_client.go index d228814d13c9..2c2d8e6860fb 100644 --- a/sdk/resourcemanager/compute/armcompute/dedicatedhostgroups_client.go +++ b/sdk/resourcemanager/compute/armcompute/dedicatedhostgroups_client.go @@ -48,7 +48,7 @@ func NewDedicatedHostGroupsClient(subscriptionID string, credential azcore.Token // see Dedicated Host Documentation [https://go.microsoft.com/fwlink/?linkid=2082596] // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - parameters - Parameters supplied to the Create Dedicated Host Group. @@ -96,7 +96,7 @@ func (client *DedicatedHostGroupsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -117,7 +117,7 @@ func (client *DedicatedHostGroupsClient) createOrUpdateHandleResponse(resp *http // Delete - Delete a dedicated host group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - options - DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete @@ -163,7 +163,7 @@ func (client *DedicatedHostGroupsClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -172,7 +172,7 @@ func (client *DedicatedHostGroupsClient) deleteCreateRequest(ctx context.Context // Get - Retrieves information about a dedicated host group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - options - DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method. @@ -221,7 +221,7 @@ func (client *DedicatedHostGroupsClient) getCreateRequest(ctx context.Context, r if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +239,7 @@ func (client *DedicatedHostGroupsClient) getHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Lists all of the dedicated host groups in the specified resource group. Use the nextLink // property in the response to get the next page of dedicated host groups. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - options - DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager // method. @@ -282,7 +282,7 @@ func (client *DedicatedHostGroupsClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +300,7 @@ func (client *DedicatedHostGroupsClient) listByResourceGroupHandleResponse(resp // NewListBySubscriptionPager - Lists all of the dedicated host groups in the subscription. Use the nextLink property in the // response to get the next page of dedicated host groups. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - options - DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager // method. func (client *DedicatedHostGroupsClient) NewListBySubscriptionPager(options *DedicatedHostGroupsClientListBySubscriptionOptions) *runtime.Pager[DedicatedHostGroupsClientListBySubscriptionResponse] { @@ -338,7 +338,7 @@ func (client *DedicatedHostGroupsClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -356,7 +356,7 @@ func (client *DedicatedHostGroupsClient) listBySubscriptionHandleResponse(resp * // Update - Update an dedicated host group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - parameters - Parameters supplied to the Update Dedicated Host Group operation. @@ -404,7 +404,7 @@ func (client *DedicatedHostGroupsClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/dedicatedhostgroups_client_example_test.go b/sdk/resourcemanager/compute/armcompute/dedicatedhostgroups_client_example_test.go deleted file mode 100644 index 19eea7bbe85e..000000000000 --- a/sdk/resourcemanager/compute/armcompute/dedicatedhostgroups_client_example_test.go +++ /dev/null @@ -1,620 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate_WithUltraSSD.json -func ExampleDedicatedHostGroupsClient_CreateOrUpdate_createOrUpdateADedicatedHostGroupWithUltraSsdSupport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDedicatedHostGroupsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ - // Name: to.Ptr("myDedicatedHostGroup"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("finance"), - // "owner": to.Ptr("myCompany"), - // }, - // Properties: &armcompute.DedicatedHostGroupProperties{ - // AdditionalCapabilities: &armcompute.DedicatedHostGroupPropertiesAdditionalCapabilities{ - // UltraSSDEnabled: to.Ptr(true), - // }, - // PlatformFaultDomainCount: to.Ptr[int32](3), - // SupportAutomaticPlacement: to.Ptr(true), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_CreateOrUpdate.json -func ExampleDedicatedHostGroupsClient_CreateOrUpdate_createOrUpdateADedicatedHostGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDedicatedHostGroupsClient().CreateOrUpdate(ctx, "myResourceGroup", "myDedicatedHostGroup", armcompute.DedicatedHostGroup{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "department": to.Ptr("finance"), - }, - Properties: &armcompute.DedicatedHostGroupProperties{ - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ - // Name: to.Ptr("myDedicatedHostGroup"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("finance"), - // "owner": to.Ptr("myCompany"), - // }, - // Properties: &armcompute.DedicatedHostGroupProperties{ - // PlatformFaultDomainCount: to.Ptr[int32](3), - // SupportAutomaticPlacement: to.Ptr(true), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MaximumSet_Gen.json -func ExampleDedicatedHostGroupsClient_Update_dedicatedHostGroupUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDedicatedHostGroupsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ - // Name: to.Ptr("myDedicatedHostGroup"), - // Type: to.Ptr("aaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.DedicatedHostGroupProperties{ - // Hosts: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // InstanceView: &armcompute.DedicatedHostGroupInstanceView{ - // Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ - // { - // AssetID: to.Ptr("aaaa"), - // 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}()), - // }}, - // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }}, - // }, - // PlatformFaultDomainCount: to.Ptr[int32](3), - // SupportAutomaticPlacement: to.Ptr(true), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Update_MinimumSet_Gen.json -func ExampleDedicatedHostGroupsClient_Update_dedicatedHostGroupUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDedicatedHostGroupsClient().Update(ctx, "rgcompute", "aaaaaaaaaaa", armcompute.DedicatedHostGroupUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ - // Location: to.Ptr("westus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MaximumSet_Gen.json -func ExampleDedicatedHostGroupsClient_Delete_dedicatedHostGroupDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDedicatedHostGroupsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Delete_MinimumSet_Gen.json -func ExampleDedicatedHostGroupsClient_Delete_dedicatedHostGroupDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDedicatedHostGroupsClient().Delete(ctx, "rgcompute", "aaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get.json -func ExampleDedicatedHostGroupsClient_Get_createADedicatedHostGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDedicatedHostGroupsClient().Get(ctx, "myResourceGroup", "myDedicatedHostGroup", &armcompute.DedicatedHostGroupsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ - // Name: to.Ptr("myDedicatedHostGroup"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "{tagName}": to.Ptr("{tagValue}"), - // }, - // Properties: &armcompute.DedicatedHostGroupProperties{ - // Hosts: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/myDedicatedHostGroup/myHostGroup/Hosts/myHost1"), - // }, - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/myDedicatedHostGroup/myHostGroup/Hosts/myHost2"), - // }}, - // InstanceView: &armcompute.DedicatedHostGroupInstanceView{ - // Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ - // { - // AssetID: to.Ptr("eb3f58b8-b4e8-4882-b69f-301a01812407"), - // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ - // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ - // { - // Count: to.Ptr[float64](10), - // VMSize: to.Ptr("Standard_A1"), - // }}, - // }, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }, - // { - // Code: to.Ptr("HealthState/available"), - // DisplayStatus: to.Ptr("Host available"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // Name: to.Ptr("myHost1"), - // }, - // { - // AssetID: to.Ptr("f293d4ac-5eea-4be2-b0c0-0fcaa09aebf8"), - // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ - // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ - // { - // Count: to.Ptr[float64](10), - // VMSize: to.Ptr("Standard_A1"), - // }}, - // }, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }, - // { - // Code: to.Ptr("HealthState/available"), - // DisplayStatus: to.Ptr("Host available"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // Name: to.Ptr("myHost2"), - // }}, - // }, - // PlatformFaultDomainCount: to.Ptr[int32](3), - // SupportAutomaticPlacement: to.Ptr(true), - // }, - // Zones: []*string{ - // to.Ptr("3")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_Get_UltraSSDEnabledDedicatedHostGroup.json -func ExampleDedicatedHostGroupsClient_Get_createAnUltraSsdEnabledDedicatedHostGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDedicatedHostGroupsClient().Get(ctx, "myResourceGroup", "myDedicatedHostGroup", &armcompute.DedicatedHostGroupsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHostGroup = armcompute.DedicatedHostGroup{ - // Name: to.Ptr("myDedicatedHostGroup"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "{tagName}": to.Ptr("{tagValue}"), - // }, - // Properties: &armcompute.DedicatedHostGroupProperties{ - // AdditionalCapabilities: &armcompute.DedicatedHostGroupPropertiesAdditionalCapabilities{ - // UltraSSDEnabled: to.Ptr(true), - // }, - // Hosts: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/myDedicatedHostGroup/myHostGroup/Hosts/myHost"), - // }}, - // InstanceView: &armcompute.DedicatedHostGroupInstanceView{ - // Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ - // { - // AssetID: to.Ptr("eb3f58b8-b4e8-4882-b69f-301a01812407"), - // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ - // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ - // { - // Count: to.Ptr[float64](10), - // VMSize: to.Ptr("Standard_A1"), - // }}, - // }, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }, - // { - // Code: to.Ptr("HealthState/available"), - // DisplayStatus: to.Ptr("Host available"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // Name: to.Ptr("myHost"), - // }}, - // }, - // PlatformFaultDomainCount: to.Ptr[int32](3), - // SupportAutomaticPlacement: to.Ptr(true), - // }, - // Zones: []*string{ - // to.Ptr("3")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MaximumSet_Gen.json -func ExampleDedicatedHostGroupsClient_NewListByResourceGroupPager_dedicatedHostGroupListByResourceGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDedicatedHostGroupsClient().NewListByResourceGroupPager("rgcompute", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DedicatedHostGroupListResult = armcompute.DedicatedHostGroupListResult{ - // Value: []*armcompute.DedicatedHostGroup{ - // { - // Name: to.Ptr("myDedicatedHostGroup"), - // Type: to.Ptr("aaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.DedicatedHostGroupProperties{ - // Hosts: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // InstanceView: &armcompute.DedicatedHostGroupInstanceView{ - // Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ - // { - // AssetID: to.Ptr("aaaa"), - // 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}()), - // }}, - // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }}, - // }, - // PlatformFaultDomainCount: to.Ptr[int32](3), - // SupportAutomaticPlacement: to.Ptr(true), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListByResourceGroup_MinimumSet_Gen.json -func ExampleDedicatedHostGroupsClient_NewListByResourceGroupPager_dedicatedHostGroupListByResourceGroupMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDedicatedHostGroupsClient().NewListByResourceGroupPager("rgcompute", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DedicatedHostGroupListResult = armcompute.DedicatedHostGroupListResult{ - // Value: []*armcompute.DedicatedHostGroup{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), - // Location: to.Ptr("westus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MaximumSet_Gen.json -func ExampleDedicatedHostGroupsClient_NewListBySubscriptionPager_dedicatedHostGroupListBySubscriptionMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDedicatedHostGroupsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DedicatedHostGroupListResult = armcompute.DedicatedHostGroupListResult{ - // Value: []*armcompute.DedicatedHostGroup{ - // { - // Name: to.Ptr("myDedicatedHostGroup"), - // Type: to.Ptr("aaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.DedicatedHostGroupProperties{ - // Hosts: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // InstanceView: &armcompute.DedicatedHostGroupInstanceView{ - // Hosts: []*armcompute.DedicatedHostInstanceViewWithName{ - // { - // AssetID: to.Ptr("aaaa"), - // 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}()), - // }}, - // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }}, - // }, - // PlatformFaultDomainCount: to.Ptr[int32](3), - // SupportAutomaticPlacement: to.Ptr(true), - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHostGroup_ListBySubscription_MinimumSet_Gen.json -func ExampleDedicatedHostGroupsClient_NewListBySubscriptionPager_dedicatedHostGroupListBySubscriptionMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDedicatedHostGroupsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DedicatedHostGroupListResult = armcompute.DedicatedHostGroupListResult{ - // Value: []*armcompute.DedicatedHostGroup{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup"), - // Location: to.Ptr("westus"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/dedicatedhosts_client.go b/sdk/resourcemanager/compute/armcompute/dedicatedhosts_client.go index 715c81291314..41ef774d24dd 100644 --- a/sdk/resourcemanager/compute/armcompute/dedicatedhosts_client.go +++ b/sdk/resourcemanager/compute/armcompute/dedicatedhosts_client.go @@ -47,7 +47,7 @@ func NewDedicatedHostsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Create or update a dedicated host . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - hostName - The name of the dedicated host . @@ -74,7 +74,7 @@ func (client *DedicatedHostsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Create or update a dedicated host . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *DedicatedHostsClient) createOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost, options *DedicatedHostsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DedicatedHostsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *DedicatedHostsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ func (client *DedicatedHostsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Delete a dedicated host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - hostName - The name of the dedicated host. @@ -158,7 +158,7 @@ func (client *DedicatedHostsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Delete a dedicated host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *DedicatedHostsClient) deleteOperation(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DedicatedHostsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *DedicatedHostsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ func (client *DedicatedHostsClient) deleteCreateRequest(ctx context.Context, res // Get - Retrieves information about a dedicated host. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - hostName - The name of the dedicated host. @@ -267,7 +267,7 @@ func (client *DedicatedHostsClient) getCreateRequest(ctx context.Context, resour if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,7 @@ func (client *DedicatedHostsClient) getHandleResponse(resp *http.Response) (Dedi // NewListAvailableSizesPager - Lists all available dedicated host sizes to which the specified dedicated host can be resized. // NOTE: The dedicated host sizes provided can be used to only scale up the existing dedicated host. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - hostName - The name of the dedicated host. @@ -339,7 +339,7 @@ func (client *DedicatedHostsClient) listAvailableSizesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -357,7 +357,7 @@ func (client *DedicatedHostsClient) listAvailableSizesHandleResponse(resp *http. // NewListByHostGroupPager - Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property // in the response to get the next page of dedicated hosts. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - options - DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager @@ -405,7 +405,7 @@ func (client *DedicatedHostsClient) listByHostGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -426,7 +426,7 @@ func (client *DedicatedHostsClient) listByHostGroupHandleResponse(resp *http.Res // for more details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - hostName - The name of the dedicated host. @@ -455,7 +455,7 @@ func (client *DedicatedHostsClient) BeginRedeploy(ctx context.Context, resourceG // for more details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *DedicatedHostsClient) redeploy(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRedeployOptions) (*http.Response, error) { var err error const operationName = "DedicatedHostsClient.BeginRedeploy" @@ -501,7 +501,7 @@ func (client *DedicatedHostsClient) redeployCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -513,7 +513,7 @@ func (client *DedicatedHostsClient) redeployCreateRequest(ctx context.Context, r // for more details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - hostName - The name of the dedicated host. @@ -542,7 +542,7 @@ func (client *DedicatedHostsClient) BeginRestart(ctx context.Context, resourceGr // for more details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *DedicatedHostsClient) restart(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, options *DedicatedHostsClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "DedicatedHostsClient.BeginRestart" @@ -588,7 +588,7 @@ func (client *DedicatedHostsClient) restartCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -597,7 +597,7 @@ func (client *DedicatedHostsClient) restartCreateRequest(ctx context.Context, re // BeginUpdate - Update a dedicated host . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - hostGroupName - The name of the dedicated host group. // - hostName - The name of the dedicated host . @@ -624,7 +624,7 @@ func (client *DedicatedHostsClient) BeginUpdate(ctx context.Context, resourceGro // Update - Update a dedicated host . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *DedicatedHostsClient) update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate, options *DedicatedHostsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "DedicatedHostsClient.BeginUpdate" @@ -670,7 +670,7 @@ func (client *DedicatedHostsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/dedicatedhosts_client_example_test.go b/sdk/resourcemanager/compute/armcompute/dedicatedhosts_client_example_test.go deleted file mode 100644 index b662e98669e3..000000000000 --- a/sdk/resourcemanager/compute/armcompute/dedicatedhosts_client_example_test.go +++ /dev/null @@ -1,531 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDedicatedHostsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHost = armcompute.DedicatedHost{ - // Name: to.Ptr("myDedicatedHost"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myDedicatedHost"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("HR"), - // }, - // Properties: &armcompute.DedicatedHostProperties{ - // AutoReplaceOnFailure: to.Ptr(false), - // HostID: to.Ptr("{GUID}"), - // LicenseType: to.Ptr(armcompute.DedicatedHostLicenseTypesWindowsServerHybrid), - // PlatformFaultDomain: to.Ptr[int32](1), - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("DSv3-Type1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Update_MaximumSet_Gen.json -func ExampleDedicatedHostsClient_BeginUpdate_dedicatedHostUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDedicatedHostsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHost = armcompute.DedicatedHost{ - // Name: to.Ptr("myDedicatedHost"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myDedicatedHost"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.DedicatedHostProperties{ - // AutoReplaceOnFailure: to.Ptr(true), - // HostID: to.Ptr("{GUID}"), - // InstanceView: &armcompute.DedicatedHostInstanceView{ - // AssetID: to.Ptr("aaaaaaaaaaaaaaaa"), - // 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), - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.526Z"); return t}()), - // VirtualMachines: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("DSv3-Type1"), - // Capacity: to.Ptr[int64](7), - // Tier: to.Ptr("aaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Update_MinimumSet_Gen.json -func ExampleDedicatedHostsClient_BeginUpdate_dedicatedHostUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDedicatedHostsClient().BeginUpdate(ctx, "rgcompute", "aa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", armcompute.DedicatedHostUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHost = armcompute.DedicatedHost{ - // Location: to.Ptr("westus"), - // SKU: &armcompute.SKU{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Update_Resize.json -func ExampleDedicatedHostsClient_BeginUpdate_dedicatedHostUpdateResize() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDedicatedHostsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", armcompute.DedicatedHostUpdate{ - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHost = armcompute.DedicatedHost{ - // Name: to.Ptr("myDedicatedHost"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myDedicatedHost"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.DedicatedHostProperties{ - // AutoReplaceOnFailure: to.Ptr(true), - // HostID: to.Ptr("{GUID}"), - // LicenseType: to.Ptr(armcompute.DedicatedHostLicenseTypesWindowsServerHybrid), - // PlatformFaultDomain: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.526Z"); return t}()), - // VirtualMachines: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("DSv3-Type1"), - // Capacity: to.Ptr[int64](7), - // Tier: to.Ptr("aaa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MaximumSet_Gen.json -func ExampleDedicatedHostsClient_BeginDelete_dedicatedHostDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDedicatedHostsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Delete_MinimumSet_Gen.json -func ExampleDedicatedHostsClient_BeginDelete_dedicatedHostDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDedicatedHostsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaa", "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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDedicatedHostsClient().Get(ctx, "myResourceGroup", "myDedicatedHostGroup", "myHost", &armcompute.DedicatedHostsClientGetOptions{Expand: to.Ptr(armcompute.InstanceViewTypesInstanceView)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DedicatedHost = armcompute.DedicatedHost{ - // Name: to.Ptr("myHost"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myHost"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("HR"), - // }, - // Properties: &armcompute.DedicatedHostProperties{ - // AutoReplaceOnFailure: to.Ptr(true), - // HostID: to.Ptr("{GUID}"), - // InstanceView: &armcompute.DedicatedHostInstanceView{ - // AssetID: to.Ptr("eb3f58b8-b4e8-4882-b69f-301a01812407"), - // AvailableCapacity: &armcompute.DedicatedHostAvailableCapacity{ - // AllocatableVMs: []*armcompute.DedicatedHostAllocatableVM{ - // { - // Count: to.Ptr[float64](10), - // VMSize: to.Ptr("Standard_A1"), - // }}, - // }, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }, - // { - // Code: to.Ptr("HealthState/available"), - // DisplayStatus: to.Ptr("Host available"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // }, - // PlatformFaultDomain: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-27T01:02:38.313Z"); return t}()), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-27T01:02:38.313Z"); return t}()), - // VirtualMachines: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("/subscriptions/subId/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/vm1"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("DSv3-Type1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MaximumSet_Gen.json -func ExampleDedicatedHostsClient_NewListByHostGroupPager_dedicatedHostListByHostGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDedicatedHostsClient().NewListByHostGroupPager("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DedicatedHostListResult = armcompute.DedicatedHostListResult{ - // Value: []*armcompute.DedicatedHost{ - // { - // Name: to.Ptr("myDedicatedHost"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myDedicatedHost"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.DedicatedHostProperties{ - // AutoReplaceOnFailure: to.Ptr(true), - // HostID: to.Ptr("{GUID}"), - // InstanceView: &armcompute.DedicatedHostInstanceView{ - // AssetID: to.Ptr("aaaaaaaaaaaaaaaa"), - // 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), - // ProvisioningState: to.Ptr("Succeeded"), - // ProvisioningTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.526Z"); return t}()), - // VirtualMachines: []*armcompute.SubResourceReadOnly{ - // { - // ID: to.Ptr("aaaa"), - // }}, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("DSv3-Type1"), - // Capacity: to.Ptr[int64](7), - // Tier: to.Ptr("aaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_ListByHostGroup_MinimumSet_Gen.json -func ExampleDedicatedHostsClient_NewListByHostGroupPager_dedicatedHostListByHostGroupMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDedicatedHostsClient().NewListByHostGroupPager("rgcompute", "aaaa", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DedicatedHostListResult = armcompute.DedicatedHostListResult{ - // Value: []*armcompute.DedicatedHost{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/HostGroups/myDedicatedHostGroup/hosts/myHost"), - // Location: to.Ptr("westus"), - // SKU: &armcompute.SKU{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDedicatedHostsClient().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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_Redeploy.json -func ExampleDedicatedHostsClient_BeginRedeploy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDedicatedHostsClient().BeginRedeploy(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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/dedicatedHostExamples/DedicatedHost_ListAvailableSizes.json -func ExampleDedicatedHostsClient_NewListAvailableSizesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDedicatedHostsClient().NewListAvailableSizesPager("myResourceGroup", "myDedicatedHostGroup", "myHost", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DedicatedHostSizeListResult = armcompute.DedicatedHostSizeListResult{ - // Value: []*string{ - // to.Ptr("Dsv3-Type1"), - // to.Ptr("Esv3-Type1")}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/disk_live_test.go b/sdk/resourcemanager/compute/armcompute/disk_live_test.go index a32724cb4c17..3aab8dbabe1b 100644 --- a/sdk/resourcemanager/compute/armcompute/disk_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/disk_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/diskaccess_live_test.go b/sdk/resourcemanager/compute/armcompute/diskaccess_live_test.go index 6fb6c66f2d15..e8417cf36d82 100644 --- a/sdk/resourcemanager/compute/armcompute/diskaccess_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/diskaccess_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/diskaccesses_client_example_test.go b/sdk/resourcemanager/compute/armcompute/diskaccesses_client_example_test.go deleted file mode 100644 index 101c8aaadea3..000000000000 --- a/sdk/resourcemanager/compute/armcompute/diskaccesses_client_example_test.go +++ /dev/null @@ -1,529 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Create.json -func ExampleDiskAccessesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskAccessesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskAccess = armcompute.DiskAccess{ - // Name: to.Ptr("myDiskAccess"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourcegroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskAccessProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Update.json -func ExampleDiskAccessesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskAccessesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskAccess = armcompute.DiskAccess{ - // Name: to.Ptr("myDiskAccess"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourcegroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("PrivateEndpoints"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get_WithPrivateEndpoints.json -func ExampleDiskAccessesClient_Get_getInformationAboutADiskAccessResourceWithPrivateEndpoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDiskAccessesClient().Get(ctx, "myResourceGroup", "myDiskAccess", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskAccess = armcompute.DiskAccess{ - // Name: to.Ptr("myDiskAccess"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("PrivateEndpoints"), - // }, - // Properties: &armcompute.DiskAccessProperties{ - // PrivateEndpointConnections: []*armcompute.PrivateEndpointConnection{ - // { - // Name: to.Ptr("myDiskAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess/privateEndpoinConnections/myDiskAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), - // Properties: &armcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcompute.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Get.json -func ExampleDiskAccessesClient_Get_getInformationAboutADiskAccessResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDiskAccessesClient().Get(ctx, "myResourceGroup", "myDiskAccess", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskAccess = armcompute.DiskAccess{ - // Name: to.Ptr("myDiskAccess"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("PrivateEndpoints"), - // }, - // Properties: &armcompute.DiskAccessProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_Delete.json -func ExampleDiskAccessesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskAccessesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_ListByResourceGroup.json -func ExampleDiskAccessesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiskAccessesClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiskAccessList = armcompute.DiskAccessList{ - // Value: []*armcompute.DiskAccess{ - // { - // Name: to.Ptr("myDiskAccess"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("PrivateEndpoints"), - // }, - // Properties: &armcompute.DiskAccessProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("myDiskAccess2"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("PrivateEndpoints"), - // }, - // Properties: &armcompute.DiskAccessProperties{ - // PrivateEndpointConnections: []*armcompute.PrivateEndpointConnection{ - // { - // Name: to.Ptr("myDiskAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess2/privateEndpoinConnections/myDiskAccess2.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), - // Properties: &armcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcompute.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint2"), - // }, - // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccess_ListBySubscription.json -func ExampleDiskAccessesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiskAccessesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiskAccessList = armcompute.DiskAccessList{ - // Value: []*armcompute.DiskAccess{ - // { - // Name: to.Ptr("myDiskAccess"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("PrivateEndpoints"), - // }, - // Properties: &armcompute.DiskAccessProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("myDiskAccess2"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/mySecondResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("PrivateEndpoints"), - // }, - // Properties: &armcompute.DiskAccessProperties{ - // PrivateEndpointConnections: []*armcompute.PrivateEndpointConnection{ - // { - // Name: to.Ptr("myDiskAccess.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/mySecondResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess2/privateEndpoinConnections/myDiskAccess2.d4914cfa-6bc2-4049-a57c-3d1f622d8eef"), - // Properties: &armcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcompute.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/mySecondResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint2"), - // }, - // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-01T04:41:35.079Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateLinkResources_Get.json -func ExampleDiskAccessesClient_GetPrivateLinkResources() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDiskAccessesClient().GetPrivateLinkResources(ctx, "myResourceGroup", "myDiskAccess", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateLinkResourceListResult = armcompute.PrivateLinkResourceListResult{ - // Value: []*armcompute.PrivateLinkResource{ - // { - // Name: to.Ptr("disks"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses/privateLinkResources"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess/privateLinkResources/disks"), - // Properties: &armcompute.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("disks"), - // RequiredMembers: []*string{ - // to.Ptr("diskAccess_1")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.blob.core.windows.net")}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Approve.json -func ExampleDiskAccessesClient_BeginUpdateAPrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskAccessesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armcompute.PrivateEndpointConnection{ - // Name: to.Ptr("myPrivateEndpointConnectionName"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess/privateEndpoinConnections/myPrivateEndpointConnectionName"), - // Properties: &armcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcompute.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Approving myPrivateEndpointConnection"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Get.json -func ExampleDiskAccessesClient_GetAPrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDiskAccessesClient().GetAPrivateEndpointConnection(ctx, "myResourceGroup", "myDiskAccess", "myPrivateEndpointConnection", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armcompute.PrivateEndpointConnection{ - // Name: to.Ptr("myPrivateEndpointConnection"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess/privateEndpoinConnections/myPrivateEndpointConnection"), - // Properties: &armcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcompute.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_Delete.json -func ExampleDiskAccessesClient_BeginDeleteAPrivateEndpointConnection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskAccessesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskAccessExamples/DiskAccessPrivateEndpointConnection_ListByDiskAccess.json -func ExampleDiskAccessesClient_NewListPrivateEndpointConnectionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiskAccessesClient().NewListPrivateEndpointConnectionsPager("myResourceGroup", "myDiskAccess", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armcompute.PrivateEndpointConnectionListResult{ - // Value: []*armcompute.PrivateEndpointConnection{ - // { - // Name: to.Ptr("myPrivateEndpointConnection"), - // Type: to.Ptr("Microsoft.Compute/diskAccesses/PrivateEndpointConnections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/myDiskAccess/privateEndpoinConnections/myPrivateEndpointConnection"), - // Properties: &armcompute.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armcompute.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/privateEndpoints/myPrivateEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armcompute.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armcompute.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armcompute.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/diskencryptionsets_client_example_test.go b/sdk/resourcemanager/compute/armcompute/diskencryptionsets_client_example_test.go deleted file mode 100644 index cb624063d83d..000000000000 --- a/sdk/resourcemanager/compute/armcompute/diskencryptionsets_client_example_test.go +++ /dev/null @@ -1,660 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentSubscription.json -func ExampleDiskEncryptionSetsClient_BeginCreateOrUpdate_createADiskEncryptionSetWithKeyVaultFromADifferentSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskEncryptionSetsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ - // Name: to.Ptr("myDiskEncryptionSet"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), - // 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), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create_WithKeyVaultFromADifferentTenant.json -func ExampleDiskEncryptionSetsClient_BeginCreateOrUpdate_createADiskEncryptionSetWithKeyVaultFromADifferentTenant() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSet{ - Location: to.Ptr("West US"), - Identity: &armcompute.EncryptionSetIdentity{ - Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}": {}, - }, - }, - Properties: &armcompute.EncryptionSetProperties{ - ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - KeyURL: to.Ptr("https://myvaultdifferenttenant.vault-int.azure-int.net/keys/{key}"), - }, - EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - FederatedClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ - // Name: to.Ptr("myDiskEncryptionSet"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), - // Location: to.Ptr("West US"), - // Identity: &armcompute.EncryptionSetIdentity{ - // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}": &armcompute.UserAssignedIdentitiesValue{ - // }, - // }, - // }, - // Properties: &armcompute.EncryptionSetProperties{ - // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - // KeyURL: to.Ptr("https://myvaultdifferenttenant.vault-int.azure-int.net/keys/{key}"), - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // FederatedClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Create.json -func ExampleDiskEncryptionSetsClient_BeginCreateOrUpdate_createADiskEncryptionSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskEncryptionSetsClient().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://myvmvault.vault-int.azure-int.net/keys/{key}"), - SourceVault: &armcompute.SourceVault{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - }, - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ - // Name: to.Ptr("myDiskEncryptionSet"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), - // Location: to.Ptr("West US"), - // Identity: &armcompute.EncryptionSetIdentity{ - // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), - // }, - // Properties: &armcompute.EncryptionSetProperties{ - // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabled.json -func ExampleDiskEncryptionSetsClient_BeginUpdate_updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueSucceeded() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskEncryptionSetsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ - // Name: to.Ptr("myDiskEncryptionSet"), - // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), - // 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/keyName/KeyVersion2"), - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // LastKeyRotationTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T04:41:35.079Z"); return t}()), - // ProvisioningState: to.Ptr("Succeeded"), - // RotationToLatestKeyVersionEnabled: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update_WithRotationToLatestKeyVersionEnabledInProgress.json -func ExampleDiskEncryptionSetsClient_BeginUpdate_updateADiskEncryptionSetWithRotationToLatestKeyVersionEnabledSetToTrueUpdating() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskEncryptionSetsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ - // Name: to.Ptr("myDiskEncryptionSet"), - // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), - // 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/keyName/keyVersion2"), - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // LastKeyRotationTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T04:41:35.079Z"); return t}()), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // { - // KeyURL: to.Ptr("https://myvaultdifferentsub.vault-int.azure-int.net/keys/keyName/keyVersion1"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RotationToLatestKeyVersionEnabled: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Update.json -func ExampleDiskEncryptionSetsClient_BeginUpdate_updateADiskEncryptionSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskEncryptionSetsClient().BeginUpdate(ctx, "myResourceGroup", "myDiskEncryptionSet", armcompute.DiskEncryptionSetUpdate{ - Properties: &armcompute.DiskEncryptionSetUpdateProperties{ - ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion"), - SourceVault: &armcompute.SourceVault{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - }, - }, - EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - }, - Tags: map[string]*string{ - "department": to.Ptr("Development"), - "project": to.Ptr("Encryption"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ - // Name: to.Ptr("myDiskEncryptionSet"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Encryption"), - // }, - // Identity: &armcompute.EncryptionSetIdentity{ - // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), - // }, - // Properties: &armcompute.EncryptionSetProperties{ - // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/keyName/keyVersion"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // LastKeyRotationTimestamp: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-01T04:41:35.079Z"); return t}()), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get_WithAutoKeyRotationError.json -func ExampleDiskEncryptionSetsClient_Get_getInformationAboutADiskEncryptionSetWhenAutoKeyRotationFailed() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDiskEncryptionSetsClient().Get(ctx, "myResourceGroup", "myDiskEncryptionSet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ - // Name: to.Ptr("myDiskEncryptionSet"), - // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Encryption"), - // }, - // Identity: &armcompute.EncryptionSetIdentity{ - // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), - // }, - // Properties: &armcompute.EncryptionSetProperties{ - // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // AutoKeyRotationError: &armcompute.APIError{ - // Code: to.Ptr("ManagedServiceIdentityNotFound"), - // Message: to.Ptr("Auto-key rotation was disabled as managed service identity associated with DiskEncryptionSet 'myDiskEncryptionSet' was not found. Please update the resource with correct identity to re-enable auto-key rotation."), - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // RotationToLatestKeyVersionEnabled: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Get.json -func ExampleDiskEncryptionSetsClient_Get_getInformationAboutADiskEncryptionSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDiskEncryptionSetsClient().Get(ctx, "myResourceGroup", "myDiskEncryptionSet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskEncryptionSet = armcompute.DiskEncryptionSet{ - // Name: to.Ptr("myDiskEncryptionSet"), - // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Encryption"), - // }, - // Identity: &armcompute.EncryptionSetIdentity{ - // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), - // }, - // Properties: &armcompute.EncryptionSetProperties{ - // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_Delete.json -func ExampleDiskEncryptionSetsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskEncryptionSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListByResourceGroup.json -func ExampleDiskEncryptionSetsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiskEncryptionSetsClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiskEncryptionSetList = armcompute.DiskEncryptionSetList{ - // Value: []*armcompute.DiskEncryptionSet{ - // { - // Name: to.Ptr("myDiskEncryptionSet"), - // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Encryption"), - // }, - // Identity: &armcompute.EncryptionSetIdentity{ - // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), - // }, - // Properties: &armcompute.EncryptionSetProperties{ - // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("myDiskEncryptionSet2"), - // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Encryption"), - // }, - // Identity: &armcompute.EncryptionSetIdentity{ - // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), - // }, - // Properties: &armcompute.EncryptionSetProperties{ - // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault2"), - // }, - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListBySubscription.json -func ExampleDiskEncryptionSetsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiskEncryptionSetsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiskEncryptionSetList = armcompute.DiskEncryptionSetList{ - // Value: []*armcompute.DiskEncryptionSet{ - // { - // Name: to.Ptr("myDiskEncryptionSet"), - // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Encryption"), - // }, - // Identity: &armcompute.EncryptionSetIdentity{ - // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), - // }, - // Properties: &armcompute.EncryptionSetProperties{ - // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }, - // { - // Name: to.Ptr("myDiskEncryptionSet2"), - // Type: to.Ptr("Microsoft.Compute/diskEncryptionSets"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/mySecondResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/myDiskEncryptionSet2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Encryption"), - // }, - // Identity: &armcompute.EncryptionSetIdentity{ - // Type: to.Ptr(armcompute.DiskEncryptionSetIdentityTypeSystemAssigned), - // }, - // Properties: &armcompute.EncryptionSetProperties{ - // ActiveKey: &armcompute.KeyForDiskEncryptionSet{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/mySecondResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault2"), - // }, - // }, - // EncryptionType: to.Ptr(armcompute.DiskEncryptionSetTypeEncryptionAtRestWithCustomerKey), - // PreviousKeys: []*armcompute.KeyForDiskEncryptionSet{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskEncryptionSetExamples/DiskEncryptionSet_ListAssociatedResources.json -func ExampleDiskEncryptionSetsClient_NewListAssociatedResourcesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiskEncryptionSetsClient().NewListAssociatedResourcesPager("myResourceGroup", "myDiskEncryptionSet", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceURIList = armcompute.ResourceURIList{ - // Value: []*string{ - // to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - // to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot")}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/diskrestorepoint_client_example_test.go b/sdk/resourcemanager/compute/armcompute/diskrestorepoint_client_example_test.go deleted file mode 100644 index 2b78971e8b5e..000000000000 --- a/sdk/resourcemanager/compute/armcompute/diskrestorepoint_client_example_test.go +++ /dev/null @@ -1,187 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get.json -func ExampleDiskRestorePointClient_Get_getAnIncrementalDiskRestorePointResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDiskRestorePointClient().Get(ctx, "myResourceGroup", "rpc", "vmrp", "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskRestorePoint = armcompute.DiskRestorePoint{ - // Name: to.Ptr("TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpc/restorePoints/vmrp/diskRestorePoints/TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), - // Properties: &armcompute.DiskRestorePointProperties{ - // FamilyID: to.Ptr("996bf3ce-b6ff-4e86-9db6-dc27ea06cea5"), - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // LogicalSectorSize: to.Ptr[int32](4096), - // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // PublicNetworkAccess: to.Ptr(armcompute.PublicNetworkAccessDisabled), - // SourceResourceID: to.Ptr("/subscriptions/d2260d06-e00d-422f-8b63-93df551a59ae/resourceGroups/rg0680fb0c-89f1-41b4-96c0-35733a181558/providers/Microsoft.Compute/disks/TestDisk45ceb03433006d1baee0"), - // SourceUniqueID: to.Ptr("48e058b1-7eea-4968-b532-10a8a1130c13"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-16T04:41:35.079Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_Get_WhenSourceResourceIsFromDifferentRegion.json -func ExampleDiskRestorePointClient_Get_getAnIncrementalDiskRestorePointWhenSourceResourceIsFromADifferentRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDiskRestorePointClient().Get(ctx, "myResourceGroup", "rpc", "vmrp", "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiskRestorePoint = armcompute.DiskRestorePoint{ - // Name: to.Ptr("TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpc/restorePoints/vmrp/diskRestorePoints/TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), - // Properties: &armcompute.DiskRestorePointProperties{ - // CompletionPercent: to.Ptr[float32](100), - // FamilyID: to.Ptr("996bf3ce-b6ff-4e86-9db6-dc27ea06cea5"), - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // LogicalSectorSize: to.Ptr[int32](4096), - // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // PublicNetworkAccess: to.Ptr(armcompute.PublicNetworkAccessDisabled), - // ReplicationState: to.Ptr("Succeeded"), - // SourceResourceID: to.Ptr("/subscriptions/d2260d06-e00d-422f-8b63-93df551a59ae/resourceGroups/rg0680fb0c-89f1-41b4-96c0-35733a181558/providers/Microsoft.Compute/disks/TestDisk45ceb03433006d1baee0"), - // SourceResourceLocation: to.Ptr("eastus2"), - // SourceUniqueID: to.Ptr("48e058b1-7eea-4968-b532-10a8a1130c13"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-16T04:41:35.079Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_ListByVmRestorePoint.json -func ExampleDiskRestorePointClient_NewListByRestorePointPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiskRestorePointClient().NewListByRestorePointPager("myResourceGroup", "rpc", "vmrp", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiskRestorePointList = armcompute.DiskRestorePointList{ - // Value: []*armcompute.DiskRestorePoint{ - // { - // Name: to.Ptr("TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpc/restorePoints/vmrp/diskRestorePoints/TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745"), - // Properties: &armcompute.DiskRestorePointProperties{ - // FamilyID: to.Ptr("996bf3ce-b6ff-4e86-9db6-dc27ea06cea5"), - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // LogicalSectorSize: to.Ptr[int32](4096), - // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // PublicNetworkAccess: to.Ptr(armcompute.PublicNetworkAccessDisabled), - // SourceResourceID: to.Ptr("/subscriptions/d2260d06-e00d-422f-8b63-93df551a59ae/resourceGroups/rg0680fb0c-89f1-41b4-96c0-35733a181558/providers/Microsoft.Compute/disks/TestDisk45ceb03433006d1baee0"), - // SourceUniqueID: to.Ptr("48e058b1-7eea-4968-b532-10a8a1130c13"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-09-16T04:41:35.079Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_BeginGetAccess.json -func ExampleDiskRestorePointClient_BeginGrantAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskRestorePointClient().BeginGrantAccess(ctx, "myResourceGroup", "rpc", "vmrp", "TestDisk45ceb03433006d1baee0_b70cd924-3362-4a80-93c2-9415eaa12745", armcompute.GrantAccessData{ - Access: to.Ptr(armcompute.AccessLevelRead), - DurationInSeconds: to.Ptr[int32](300), - FileFormat: to.Ptr(armcompute.FileFormatVHDX), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessURI = armcompute.AccessURI{ - // AccessSAS: to.Ptr("https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskRestorePointExamples/DiskRestorePoint_EndGetAccess.json -func ExampleDiskRestorePointClient_BeginRevokeAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDiskRestorePointClient().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/disks_client_example_test.go b/sdk/resourcemanager/compute/armcompute/disks_client_example_test.go deleted file mode 100644 index f1740b333651..000000000000 --- a/sdk/resourcemanager/compute/armcompute/disks_client_example_test.go +++ /dev/null @@ -1,2186 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ConfidentialVMSupportedDiskEncryptedWithCMK.json -func ExampleDisksClient_BeginCreateOrUpdate_createAConfidentialVmSupportedDiskEncryptedWithCustomerManagedKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // 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), - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.DiskSecurityProfile{ - // SecureVMDiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}"), - // SecurityType: to.Ptr(armcompute.DiskSecurityTypesConfidentialVMDiskEncryptedWithCustomerKey), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithDiskAccess.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskAndAssociateWithDiskAccessResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - }, - DiskAccessID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}"), - DiskSizeGB: to.Ptr[int32](200), - NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowPrivate), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskAccessID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskAccesses/{existing-diskAccess-name}"), - // DiskSizeGB: to.Ptr[int32](200), - // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowPrivate), - // ProvisioningState: to.Ptr("Succeeded"), - // PublicNetworkAccess: to.Ptr(armcompute.PublicNetworkAccessEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithDiskEncryptionSet.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskAndAssociateWithDiskEncryptionSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - }, - DiskSizeGB: to.Ptr[int32](200), - Encryption: &armcompute.Encryption{ - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // Encryption: &armcompute.Encryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ByCopyingASnapshot.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskByCopyingASnapshot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ByImportingBlobFromADifferentSubscription.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskByImportingAnUnmanagedBlobFromADifferentSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), - SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - StorageAccountID: to.Ptr("subscriptions/{subscriptionId}/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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), - // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // StorageAccountID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_ByImportingBlobFromTheSameSubscription.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskByImportingAnUnmanagedBlobFromTheSameSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), - SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), - // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromImportSecure.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskFromImportSecureCreateOption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionImportSecure), - SecurityDataURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd"), - SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - StorageAccountID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), - }, - OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - SecurityProfile: &armcompute.DiskSecurityProfile{ - SecurityType: to.Ptr(armcompute.DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionImportSecure), - // SecurityDataURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/vmgs.vhd"), - // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // StorageAccountID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.DiskSecurityProfile{ - // SecurityType: to.Ptr(armcompute.DiskSecurityTypesConfidentialVMVmguestStateOnlyEncryptedWithPlatformKey), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromUploadPreparedSecure.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskFromUploadPreparedSecureCreateOption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionUploadPreparedSecure), - UploadSizeBytes: to.Ptr[int64](10737418752), - }, - OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - SecurityProfile: &armcompute.DiskSecurityProfile{ - SecurityType: to.Ptr(armcompute.DiskSecurityTypesTrustedLaunch), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionUploadPreparedSecure), - // UploadSizeBytes: to.Ptr[int64](10737418752), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.DiskSecurityProfile{ - // SecurityType: to.Ptr(armcompute.DiskSecurityTypesTrustedLaunch), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAPlatformImage.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskFromAPlatformImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().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), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // 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"), - // }, - // }, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // PurchasePlan: &armcompute.DiskPurchasePlan{ - // Name: to.Ptr("{sku}"), - // Product: to.Ptr("{offer}"), - // Publisher: to.Ptr("{publisher}"), - // }, - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // AcceleratedNetwork: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryCommunityImage.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskFromAnAzureComputeGalleryCommunityImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - GalleryImageReference: &armcompute.ImageDiskReference{ - CommunityGalleryImageID: to.Ptr("/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0"), - }, - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // GalleryImageReference: &armcompute.ImageDiskReference{ - // CommunityGalleryImageID: to.Ptr("/CommunityGalleries/{communityGalleryPublicGalleryName}/Images/{imageName}/Versions/1.0.0"), - // }, - // }, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // AcceleratedNetwork: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryDirectSharedImage.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskFromAnAzureComputeGalleryDirectSharedImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - GalleryImageReference: &armcompute.ImageDiskReference{ - SharedGalleryImageID: to.Ptr("/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0"), - }, - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // GalleryImageReference: &armcompute.ImageDiskReference{ - // SharedGalleryImageID: to.Ptr("/SharedGalleries/{sharedGalleryUniqueName}/Images/{imageName}/Versions/1.0.0"), - // }, - // }, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // AcceleratedNetwork: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnAzureComputeGalleryImage.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskFromAnAzureComputeGalleryImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - GalleryImageReference: &armcompute.ImageDiskReference{ - ID: to.Ptr("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0"), - }, - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // GalleryImageReference: &armcompute.ImageDiskReference{ - // ID: to.Ptr("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Providers/Microsoft.Compute/Galleries/{galleryName}/Images/{imageName}/Versions/1.0.0"), - // }, - // }, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // AcceleratedNetwork: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnExistingManagedDisk.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskFromAnExistingManagedDiskInTheSameOrDifferentSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk2", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk2"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk1"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_FromAnElasticSanVolumeSnapshot.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskFromElasticSanVolumeSnapshot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyFromSanSnapshot), - ElasticSanResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyFromSanSnapshot), - // ElasticSanResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithDataAccessAuthMode.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskWithDataAccessAuthMode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - }, - DataAccessAuthMode: to.Ptr(armcompute.DataAccessAuthModeAzureActiveDirectory), - DiskSizeGB: to.Ptr[int32](200), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DataAccessAuthMode: to.Ptr(armcompute.DataAccessAuthModeAzureActiveDirectory), - // DiskSizeGB: to.Ptr[int32](200), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithOptimizedForFrequentAttach.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskWithOptimizedForFrequentAttach() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - }, - DiskSizeGB: to.Ptr[int32](200), - OptimizedForFrequentAttach: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // OptimizedForFrequentAttach: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_PerformancePlus.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskWithPerformancePlus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionUpload), - PerformancePlus: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionUpload), - // PerformancePlus: to.Ptr(true), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithPremiumV2_LRSAccountType.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskWithPremiumV2AccountType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myPremiumV2Disk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - }, - DiskIOPSReadWrite: to.Ptr[int64](125), - DiskMBpsReadWrite: to.Ptr[int64](3000), - DiskSizeGB: to.Ptr[int32](200), - }, - SKU: &armcompute.DiskSKU{ - Name: to.Ptr(armcompute.DiskStorageAccountTypesPremiumV2LRS), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myPremiumV2Disk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // SKU: &armcompute.DiskSKU{ - // Name: to.Ptr(armcompute.DiskStorageAccountTypesPremiumV2LRS), - // Tier: to.Ptr("Premium"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithSecurityProfile.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskWithSecurityProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("North Central US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - ImageReference: &armcompute.ImageDiskReference{ - ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"), - }, - }, - OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - SecurityProfile: &armcompute.DiskSecurityProfile{ - SecurityType: to.Ptr(armcompute.DiskSecurityTypesTrustedLaunch), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("North Central US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // ImageReference: &armcompute.ImageDiskReference{ - // ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"), - // }, - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.DiskSecurityProfile{ - // SecurityType: to.Ptr(armcompute.DiskSecurityTypesTrustedLaunch), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithSSDZRSAccountType.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskWithSsdZrsAccountType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - }, - DiskSizeGB: to.Ptr[int32](200), - }, - SKU: &armcompute.DiskSKU{ - Name: to.Ptr(armcompute.DiskStorageAccountTypesPremiumZRS), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // SKU: &armcompute.DiskSKU{ - // Name: to.Ptr(armcompute.DiskStorageAccountTypesPremiumZRS), - // Tier: to.Ptr("Premium"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithUltraSSD_ReadOnly.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedDiskWithUltraAccountTypeWithReadOnlyPropertySet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myUltraReadOnlyDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - LogicalSectorSize: to.Ptr[int32](4096), - }, - DiskIOPSReadWrite: to.Ptr[int64](125), - DiskMBpsReadWrite: to.Ptr[int64](3000), - DiskSizeGB: to.Ptr[int32](200), - Encryption: &armcompute.Encryption{ - Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - }, - }, - SKU: &armcompute.DiskSKU{ - Name: to.Ptr(armcompute.DiskStorageAccountTypesUltraSSDLRS), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myUltraReadOnlyDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // SKU: &armcompute.DiskSKU{ - // Name: to.Ptr(armcompute.DiskStorageAccountTypesUltraSSDLRS), - // Tier: to.Ptr("Ultra"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_UploadDisk.json -func ExampleDisksClient_BeginCreateOrUpdate_createAManagedUploadDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionUpload), - UploadSizeBytes: to.Ptr[int64](10737418752), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionUpload), - // UploadSizeBytes: to.Ptr[int64](10737418752), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_InExtendedLocation.json -func ExampleDisksClient_BeginCreateOrUpdate_createAnEmptyManagedDiskInExtendedLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - ExtendedLocation: &armcompute.ExtendedLocation{ - Name: to.Ptr("{edge-zone-id}"), - Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - }, - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - }, - DiskSizeGB: to.Ptr[int32](200), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("{edge-zone-id}"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_Empty.json -func ExampleDisksClient_BeginCreateOrUpdate_createAnEmptyManagedDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - }, - DiskSizeGB: to.Ptr[int32](200), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Create_WithLogicalSectorSize.json -func ExampleDisksClient_BeginCreateOrUpdate_createAnUltraManagedDiskWithLogicalSectorSize512E() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myDisk", armcompute.Disk{ - Location: to.Ptr("West US"), - Properties: &armcompute.DiskProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - LogicalSectorSize: to.Ptr[int32](512), - }, - DiskSizeGB: to.Ptr[int32](200), - }, - SKU: &armcompute.DiskSKU{ - Name: to.Ptr(armcompute.DiskStorageAccountTypesUltraSSDLRS), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // LogicalSectorSize: to.Ptr[int32](512), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // SKU: &armcompute.DiskSKU{ - // Name: to.Ptr(armcompute.DiskStorageAccountTypesUltraSSDLRS), - // Tier: to.Ptr("Ultra"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_CreateOrUpdate_BurstingEnabled.json -func ExampleDisksClient_BeginUpdate_createOrUpdateABurstingEnabledManagedDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // BurstingEnabled: to.Ptr(true), - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](1024), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddAcceleratedNetworking.json -func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddAcceleratedNetworking() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ - Properties: &armcompute.DiskUpdateProperties{ - SupportedCapabilities: &armcompute.SupportedCapabilities{ - AcceleratedNetwork: to.Ptr(false), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // ImageReference: &armcompute.ImageDiskReference{ - // ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"), - // }, - // }, - // DiskSizeGB: to.Ptr[int32](127), - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // AcceleratedNetwork: to.Ptr(false), - // }, - // }, - // SKU: &armcompute.DiskSKU{ - // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ToAddArchitecture.json -func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddArchitecture() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ - Properties: &armcompute.DiskUpdateProperties{ - SupportedCapabilities: &armcompute.SupportedCapabilities{ - Architecture: to.Ptr(armcompute.ArchitectureArm64), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // ImageReference: &armcompute.ImageDiskReference{ - // ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"), - // }, - // }, - // DiskSizeGB: to.Ptr[int32](127), - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // Architecture: to.Ptr(armcompute.ArchitectureArm64), - // }, - // }, - // SKU: &armcompute.DiskSKU{ - // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddPurchasePlan.json -func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddPurchasePlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ - Properties: &armcompute.DiskUpdateProperties{ - PurchasePlan: &armcompute.DiskPurchasePlan{ - Name: to.Ptr("myPurchasePlanName"), - Product: to.Ptr("myPurchasePlanProduct"), - PromotionCode: to.Ptr("myPurchasePlanPromotionCode"), - Publisher: to.Ptr("myPurchasePlanPublisher"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // ImageReference: &armcompute.ImageDiskReference{ - // ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"), - // }, - // }, - // DiskSizeGB: to.Ptr[int32](127), - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // PurchasePlan: &armcompute.DiskPurchasePlan{ - // Name: to.Ptr("myPurchasePlanName"), - // Product: to.Ptr("myPurchasePlanProduct"), - // PromotionCode: to.Ptr("myPurchasePlanPromotionCode"), - // Publisher: to.Ptr("myPurchasePlanPublisher"), - // }, - // }, - // SKU: &armcompute.DiskSKU{ - // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddSupportsHibernation.json -func ExampleDisksClient_BeginUpdate_updateAManagedDiskToAddSupportsHibernation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ - Properties: &armcompute.DiskUpdateProperties{ - SupportsHibernation: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionImport), - // SourceURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // }, - // DiskSizeGB: to.Ptr[int32](127), - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // SupportsHibernation: to.Ptr(true), - // }, - // SKU: &armcompute.DiskSKU{ - // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_ChangeTier.json -func ExampleDisksClient_BeginUpdate_updateAManagedDiskToChangeTier() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ - Properties: &armcompute.DiskUpdateProperties{ - Tier: to.Ptr("P30"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Tier: to.Ptr("P30"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableBursting.json -func ExampleDisksClient_BeginUpdate_updateAManagedDiskToDisableBursting() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ - Properties: &armcompute.DiskUpdateProperties{ - BurstingEnabled: to.Ptr(false), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_DisableOptimizedForFrequentAttach.json -func ExampleDisksClient_BeginUpdate_updateAManagedDiskToDisableOptimizedForFrequentAttach() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ - Properties: &armcompute.DiskUpdateProperties{ - OptimizedForFrequentAttach: to.Ptr(false), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // OptimizedForFrequentAttach: to.Ptr(false), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_AddDiskControllerTypes.json -func ExampleDisksClient_BeginUpdate_updateAManagedDiskWithDiskControllerTypes() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ - Properties: &armcompute.DiskUpdateProperties{ - SupportedCapabilities: &armcompute.SupportedCapabilities{ - DiskControllerTypes: to.Ptr("SCSI"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // ImageReference: &armcompute.ImageDiskReference{ - // ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/marketplacetestfirstparty/ArtifactTypes/VMImage/Offers/nvme_test_062/Skus/test_sku/Versions/1.0.0"), - // }, - // }, - // DiskSizeGB: to.Ptr[int32](127), - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // DiskControllerTypes: to.Ptr("SCSI"), - // }, - // }, - // SKU: &armcompute.DiskSKU{ - // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Update_RemoveDiskAccess.json -func ExampleDisksClient_BeginUpdate_updateManagedDiskToRemoveDiskAccessResourceAssociation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginUpdate(ctx, "myResourceGroup", "myDisk", armcompute.DiskUpdate{ - Properties: &armcompute.DiskUpdateProperties{ - NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myDisk"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicyAllowAll), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Get.json -func ExampleDisksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDisksClient().Get(ctx, "myResourceGroup", "myManagedDisk", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Disk = armcompute.Disk{ - // Name: to.Ptr("myManagedDisk"), - // Type: to.Ptr("Microsoft.Compute/disks"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("ManagedDisks"), - // }, - // ManagedBy: to.Ptr("/subscriptions/123caaa-123v-v211-a49f-f88ccac5bf88/resourceGroups/ResourceGroupName/providers/Microsoft.Compute/virtualMachines/TestVM414689371c88843d65ec"), - // Properties: &armcompute.DiskProperties{ - // LastOwnershipUpdateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.079Z"); return t}()), - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // ImageReference: &armcompute.ImageDiskReference{ - // ID: to.Ptr("/Subscriptions/{subscription-id}/Providers/Microsoft.Compute/Locations/westus/Publishers/test_test_pmc2pc1/ArtifactTypes/VMImage/Offers/marketplace_vm_test/Skus/test_sku/Versions/1.0.0"), - // }, - // }, - // DiskSizeGB: to.Ptr[int32](10), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ - // Enabled: to.Ptr(true), - // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ - // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // }}, - // }, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // PurchasePlan: &armcompute.DiskPurchasePlan{ - // Name: to.Ptr("test_sku"), - // Product: to.Ptr("marketplace_vm_test"), - // Publisher: to.Ptr("test_test_pmc2pc1"), - // }, - // SecurityProfile: &armcompute.DiskSecurityProfile{ - // SecurityType: to.Ptr(armcompute.DiskSecurityTypesTrustedLaunch), - // }, - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // AcceleratedNetwork: to.Ptr(true), - // }, - // SupportsHibernation: to.Ptr(true), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.079Z"); return t}()), - // }, - // SKU: &armcompute.DiskSKU{ - // Name: to.Ptr(armcompute.DiskStorageAccountTypesStandardLRS), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_Delete.json -func ExampleDisksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_ListByResourceGroup.json -func ExampleDisksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDisksClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiskList = armcompute.DiskList{ - // Value: []*armcompute.Disk{ - // { - // Name: to.Ptr("myManagedDisk1"), - // Type: to.Ptr("Microsoft.Compute/disks"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("ManagedDisks"), - // }, - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ - // Enabled: to.Ptr(true), - // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ - // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // }}, - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.927Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("myManagedDisk2"), - // Type: to.Ptr("Microsoft.Compute/disks"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](10), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:36.872Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("myManagedDisk3"), - // Type: to.Ptr("Microsoft.Compute/disks"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("ManagedDisks"), - // }, - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // ImageReference: &armcompute.ImageDiskReference{ - // ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"), - // }, - // }, - // DiskSizeGB: to.Ptr[int32](200), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ - // Enabled: to.Ptr(true), - // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ - // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // }}, - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:36.397Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_ListBySubscription.json -func ExampleDisksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDisksClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiskList = armcompute.DiskList{ - // Value: []*armcompute.Disk{ - // { - // Name: to.Ptr("myManagedDisk1"), - // Type: to.Ptr("Microsoft.Compute/disks"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("ManagedDisks"), - // }, - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ - // Enabled: to.Ptr(true), - // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ - // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // }}, - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.927Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("myManagedDisk2"), - // Type: to.Ptr("Microsoft.Compute/disks"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionEmpty), - // }, - // DiskSizeGB: to.Ptr[int32](10), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:36.872Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("myManagedDisk3"), - // Type: to.Ptr("Microsoft.Compute/disks"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk3"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("ManagedDisks"), - // }, - // Properties: &armcompute.DiskProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionFromImage), - // ImageReference: &armcompute.ImageDiskReference{ - // ID: to.Ptr("/Subscriptions/{subscriptionId}/Providers/Microsoft.Compute/Locations/uswest/Publishers/Microsoft/ArtifactTypes/VMImage/Offers/{offer}"), - // }, - // }, - // DiskSizeGB: to.Ptr[int32](200), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ - // Enabled: to.Ptr(true), - // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ - // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // }}, - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:36.397Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_BeginGetAccess.json -func ExampleDisksClient_BeginGrantAccess_getASasOnAManagedDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginGrantAccess(ctx, "myResourceGroup", "myDisk", armcompute.GrantAccessData{ - Access: to.Ptr(armcompute.AccessLevelRead), - DurationInSeconds: to.Ptr[int32](300), - FileFormat: to.Ptr(armcompute.FileFormatVHD), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessURI = armcompute.AccessURI{ - // AccessSAS: to.Ptr("https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_BeginGetAccess_WithVMGuestState.json -func ExampleDisksClient_BeginGrantAccess_getSasOnManagedDiskAndVmGuestState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().BeginGrantAccess(ctx, "myResourceGroup", "myDisk", armcompute.GrantAccessData{ - Access: to.Ptr(armcompute.AccessLevelRead), - DurationInSeconds: to.Ptr[int32](300), - GetSecureVMGuestStateSAS: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessURI = armcompute.AccessURI{ - // AccessSAS: to.Ptr("https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"), - // SecurityDataAccessSAS: to.Ptr("https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/b9bf5824-6122-49e0-ba22-042f76ccd8a1_vmgs?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/diskExamples/Disk_EndGetAccess.json -func ExampleDisksClient_BeginRevokeAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDisksClient().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/fake/availabilitysets_server.go b/sdk/resourcemanager/compute/armcompute/fake/availabilitysets_server.go index fe15897cfc82..6ec34586893e 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/availabilitysets_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/availabilitysets_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/capacityreservationgroups_server.go b/sdk/resourcemanager/compute/armcompute/fake/capacityreservationgroups_server.go index cd3f0405f994..06a6d1901f28 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/capacityreservationgroups_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/capacityreservationgroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/capacityreservations_server.go b/sdk/resourcemanager/compute/armcompute/fake/capacityreservations_server.go index 62ac5db14aeb..f27cd31e3d48 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/capacityreservations_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/capacityreservations_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceoperatingsystems_server.go b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceoperatingsystems_server.go index aeb55bbb2a30..70e041ee23de 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceoperatingsystems_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceoperatingsystems_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroleinstances_server.go b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroleinstances_server.go index a333b7b620f2..941585d2d98a 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroleinstances_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroleinstances_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroles_server.go b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroles_server.go index 8d517bde868b..10ad9f0db69b 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroles_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroles_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/cloudservices_server.go b/sdk/resourcemanager/compute/armcompute/fake/cloudservices_server.go index 3af38f22798d..fbb98565fff3 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/cloudservices_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/cloudservices_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/compute/armcompute/fake/cloudservicesupdatedomain_server.go b/sdk/resourcemanager/compute/armcompute/fake/cloudservicesupdatedomain_server.go index 50ccb1223449..571468f6e238 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/cloudservicesupdatedomain_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/cloudservicesupdatedomain_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/communitygalleries_server.go b/sdk/resourcemanager/compute/armcompute/fake/communitygalleries_server.go index 0e83cb1370f2..665cf5533fed 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/communitygalleries_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/communitygalleries_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimages_server.go b/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimages_server.go index 8f7344a9d7d3..7730a02b2f47 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimages_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimages_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimageversions_server.go b/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimageversions_server.go index 0633ae10889e..8554f65bb8ea 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimageversions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimageversions_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/dedicatedhostgroups_server.go b/sdk/resourcemanager/compute/armcompute/fake/dedicatedhostgroups_server.go index 1ef6de666e01..fffcaab2a537 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/dedicatedhostgroups_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/dedicatedhostgroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/dedicatedhosts_server.go b/sdk/resourcemanager/compute/armcompute/fake/dedicatedhosts_server.go index 3d9c4fa8d23c..66e417c7959f 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/dedicatedhosts_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/dedicatedhosts_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/diskaccesses_server.go b/sdk/resourcemanager/compute/armcompute/fake/diskaccesses_server.go index 0db223bb87aa..bd474d1a22f6 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/diskaccesses_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/diskaccesses_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/diskencryptionsets_server.go b/sdk/resourcemanager/compute/armcompute/fake/diskencryptionsets_server.go index d9ad608c2738..27c42fe784a3 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/diskencryptionsets_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/diskencryptionsets_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/diskrestorepoint_server.go b/sdk/resourcemanager/compute/armcompute/fake/diskrestorepoint_server.go index fe73c70f4ec4..cca6c52e5e9a 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/diskrestorepoint_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/diskrestorepoint_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/disks_server.go b/sdk/resourcemanager/compute/armcompute/fake/disks_server.go index 05d9d3d8b92d..2986728cfc4d 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/disks_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/disks_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleries_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleries_server.go index 8e2fd60b63e6..982f5d147748 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/galleries_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/galleries_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleryapplications_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleryapplications_server.go index 74f8b5ebfe1b..2b8df8244f1b 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/galleryapplications_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/galleryapplications_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleryapplicationversions_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleryapplicationversions_server.go index 4b858fa2d01a..a5471ecfa682 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/galleryapplicationversions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/galleryapplicationversions_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleryimages_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleryimages_server.go index fd41abaccfbb..4ade151c6756 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/galleryimages_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/galleryimages_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleryimageversions_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleryimageversions_server.go index 2516d2e854d0..53e0fca4d6ce 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/galleryimageversions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/galleryimageversions_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleryinvmaccesscontrolprofiles_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleryinvmaccesscontrolprofiles_server.go deleted file mode 100644 index 081f9446df33..000000000000 --- a/sdk/resourcemanager/compute/armcompute/fake/galleryinvmaccesscontrolprofiles_server.go +++ /dev/null @@ -1,332 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" - "net/http" - "net/url" - "regexp" -) - -// GalleryInVMAccessControlProfilesServer is a fake server for instances of the armcompute.GalleryInVMAccessControlProfilesClient type. -type GalleryInVMAccessControlProfilesServer struct { - // BeginCreateOrUpdate is the fake for method GalleryInVMAccessControlProfilesClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, galleryInVMAccessControlProfile armcompute.GalleryInVMAccessControlProfile, options *armcompute.GalleryInVMAccessControlProfilesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfilesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method GalleryInVMAccessControlProfilesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, options *armcompute.GalleryInVMAccessControlProfilesClientBeginDeleteOptions) (resp azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfilesClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method GalleryInVMAccessControlProfilesClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, options *armcompute.GalleryInVMAccessControlProfilesClientGetOptions) (resp azfake.Responder[armcompute.GalleryInVMAccessControlProfilesClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByGalleryPager is the fake for method GalleryInVMAccessControlProfilesClient.NewListByGalleryPager - // HTTP status codes to indicate success: http.StatusOK - NewListByGalleryPager func(resourceGroupName string, galleryName string, options *armcompute.GalleryInVMAccessControlProfilesClientListByGalleryOptions) (resp azfake.PagerResponder[armcompute.GalleryInVMAccessControlProfilesClientListByGalleryResponse]) - - // BeginUpdate is the fake for method GalleryInVMAccessControlProfilesClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK - BeginUpdate func(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, galleryInVMAccessControlProfile armcompute.GalleryInVMAccessControlProfileUpdate, options *armcompute.GalleryInVMAccessControlProfilesClientBeginUpdateOptions) (resp azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfilesClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewGalleryInVMAccessControlProfilesServerTransport creates a new instance of GalleryInVMAccessControlProfilesServerTransport with the provided implementation. -// The returned GalleryInVMAccessControlProfilesServerTransport instance is connected to an instance of armcompute.GalleryInVMAccessControlProfilesClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewGalleryInVMAccessControlProfilesServerTransport(srv *GalleryInVMAccessControlProfilesServer) *GalleryInVMAccessControlProfilesServerTransport { - return &GalleryInVMAccessControlProfilesServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfilesClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfilesClientDeleteResponse]](), - newListByGalleryPager: newTracker[azfake.PagerResponder[armcompute.GalleryInVMAccessControlProfilesClientListByGalleryResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfilesClientUpdateResponse]](), - } -} - -// GalleryInVMAccessControlProfilesServerTransport connects instances of armcompute.GalleryInVMAccessControlProfilesClient to instances of GalleryInVMAccessControlProfilesServer. -// Don't use this type directly, use NewGalleryInVMAccessControlProfilesServerTransport instead. -type GalleryInVMAccessControlProfilesServerTransport struct { - srv *GalleryInVMAccessControlProfilesServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfilesClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfilesClientDeleteResponse]] - newListByGalleryPager *tracker[azfake.PagerResponder[armcompute.GalleryInVMAccessControlProfilesClientListByGalleryResponse]] - beginUpdate *tracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfilesClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for GalleryInVMAccessControlProfilesServerTransport. -func (g *GalleryInVMAccessControlProfilesServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "GalleryInVMAccessControlProfilesClient.BeginCreateOrUpdate": - resp, err = g.dispatchBeginCreateOrUpdate(req) - case "GalleryInVMAccessControlProfilesClient.BeginDelete": - resp, err = g.dispatchBeginDelete(req) - case "GalleryInVMAccessControlProfilesClient.Get": - resp, err = g.dispatchGet(req) - case "GalleryInVMAccessControlProfilesClient.NewListByGalleryPager": - resp, err = g.dispatchNewListByGalleryPager(req) - case "GalleryInVMAccessControlProfilesClient.BeginUpdate": - resp, err = g.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (g *GalleryInVMAccessControlProfilesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if g.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := g.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inVMAccessControlProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcompute.GalleryInVMAccessControlProfile](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, galleryNameParam, inVMAccessControlProfileNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - g.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - g.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - g.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (g *GalleryInVMAccessControlProfilesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if g.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := g.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inVMAccessControlProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.BeginDelete(req.Context(), resourceGroupNameParam, galleryNameParam, inVMAccessControlProfileNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - g.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - g.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - g.beginDelete.remove(req) - } - - return resp, nil -} - -func (g *GalleryInVMAccessControlProfilesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if g.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inVMAccessControlProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.Get(req.Context(), resourceGroupNameParam, galleryNameParam, inVMAccessControlProfileNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).GalleryInVMAccessControlProfile, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (g *GalleryInVMAccessControlProfilesServerTransport) dispatchNewListByGalleryPager(req *http.Request) (*http.Response, error) { - if g.srv.NewListByGalleryPager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByGalleryPager not implemented")} - } - newListByGalleryPager := g.newListByGalleryPager.get(req) - if newListByGalleryPager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inVMAccessControlProfiles` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - resp := g.srv.NewListByGalleryPager(resourceGroupNameParam, galleryNameParam, nil) - newListByGalleryPager = &resp - g.newListByGalleryPager.add(req, newListByGalleryPager) - server.PagerResponderInjectNextLinks(newListByGalleryPager, req, func(page *armcompute.GalleryInVMAccessControlProfilesClientListByGalleryResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByGalleryPager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - g.newListByGalleryPager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByGalleryPager) { - g.newListByGalleryPager.remove(req) - } - return resp, nil -} - -func (g *GalleryInVMAccessControlProfilesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if g.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := g.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inVMAccessControlProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcompute.GalleryInVMAccessControlProfileUpdate](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.BeginUpdate(req.Context(), resourceGroupNameParam, galleryNameParam, inVMAccessControlProfileNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - g.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK}, resp.StatusCode) { - g.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - g.beginUpdate.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleryinvmaccesscontrolprofileversions_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleryinvmaccesscontrolprofileversions_server.go deleted file mode 100644 index e993b7736c1d..000000000000 --- a/sdk/resourcemanager/compute/armcompute/fake/galleryinvmaccesscontrolprofileversions_server.go +++ /dev/null @@ -1,352 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" - "net/http" - "net/url" - "regexp" -) - -// GalleryInVMAccessControlProfileVersionsServer is a fake server for instances of the armcompute.GalleryInVMAccessControlProfileVersionsClient type. -type GalleryInVMAccessControlProfileVersionsServer struct { - // BeginCreateOrUpdate is the fake for method GalleryInVMAccessControlProfileVersionsClient.BeginCreateOrUpdate - // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, galleryInVMAccessControlProfileVersion armcompute.GalleryInVMAccessControlProfileVersion, options *armcompute.GalleryInVMAccessControlProfileVersionsClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) - - // BeginDelete is the fake for method GalleryInVMAccessControlProfileVersionsClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent - BeginDelete func(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, options *armcompute.GalleryInVMAccessControlProfileVersionsClientBeginDeleteOptions) (resp azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method GalleryInVMAccessControlProfileVersionsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, options *armcompute.GalleryInVMAccessControlProfileVersionsClientGetOptions) (resp azfake.Responder[armcompute.GalleryInVMAccessControlProfileVersionsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByGalleryInVMAccessControlProfilePager is the fake for method GalleryInVMAccessControlProfileVersionsClient.NewListByGalleryInVMAccessControlProfilePager - // HTTP status codes to indicate success: http.StatusOK - NewListByGalleryInVMAccessControlProfilePager func(resourceGroupName string, galleryName string, inVMAccessControlProfileName string, options *armcompute.GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileOptions) (resp azfake.PagerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse]) - - // BeginUpdate is the fake for method GalleryInVMAccessControlProfileVersionsClient.BeginUpdate - // HTTP status codes to indicate success: http.StatusOK - BeginUpdate func(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, galleryInVMAccessControlProfileVersion armcompute.GalleryInVMAccessControlProfileVersionUpdate, options *armcompute.GalleryInVMAccessControlProfileVersionsClientBeginUpdateOptions) (resp azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientUpdateResponse], errResp azfake.ErrorResponder) -} - -// NewGalleryInVMAccessControlProfileVersionsServerTransport creates a new instance of GalleryInVMAccessControlProfileVersionsServerTransport with the provided implementation. -// The returned GalleryInVMAccessControlProfileVersionsServerTransport instance is connected to an instance of armcompute.GalleryInVMAccessControlProfileVersionsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewGalleryInVMAccessControlProfileVersionsServerTransport(srv *GalleryInVMAccessControlProfileVersionsServer) *GalleryInVMAccessControlProfileVersionsServerTransport { - return &GalleryInVMAccessControlProfileVersionsServerTransport{ - srv: srv, - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientDeleteResponse]](), - newListByGalleryInVMAccessControlProfilePager: newTracker[azfake.PagerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse]](), - beginUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientUpdateResponse]](), - } -} - -// GalleryInVMAccessControlProfileVersionsServerTransport connects instances of armcompute.GalleryInVMAccessControlProfileVersionsClient to instances of GalleryInVMAccessControlProfileVersionsServer. -// Don't use this type directly, use NewGalleryInVMAccessControlProfileVersionsServerTransport instead. -type GalleryInVMAccessControlProfileVersionsServerTransport struct { - srv *GalleryInVMAccessControlProfileVersionsServer - beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientDeleteResponse]] - newListByGalleryInVMAccessControlProfilePager *tracker[azfake.PagerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse]] - beginUpdate *tracker[azfake.PollerResponder[armcompute.GalleryInVMAccessControlProfileVersionsClientUpdateResponse]] -} - -// Do implements the policy.Transporter interface for GalleryInVMAccessControlProfileVersionsServerTransport. -func (g *GalleryInVMAccessControlProfileVersionsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "GalleryInVMAccessControlProfileVersionsClient.BeginCreateOrUpdate": - resp, err = g.dispatchBeginCreateOrUpdate(req) - case "GalleryInVMAccessControlProfileVersionsClient.BeginDelete": - resp, err = g.dispatchBeginDelete(req) - case "GalleryInVMAccessControlProfileVersionsClient.Get": - resp, err = g.dispatchGet(req) - case "GalleryInVMAccessControlProfileVersionsClient.NewListByGalleryInVMAccessControlProfilePager": - resp, err = g.dispatchNewListByGalleryInVMAccessControlProfilePager(req) - case "GalleryInVMAccessControlProfileVersionsClient.BeginUpdate": - resp, err = g.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (g *GalleryInVMAccessControlProfileVersionsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { - if g.srv.BeginCreateOrUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} - } - beginCreateOrUpdate := g.beginCreateOrUpdate.get(req) - if beginCreateOrUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inVMAccessControlProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcompute.GalleryInVMAccessControlProfileVersion](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileVersionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileVersionName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.BeginCreateOrUpdate(req.Context(), resourceGroupNameParam, galleryNameParam, inVMAccessControlProfileNameParam, inVMAccessControlProfileVersionNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginCreateOrUpdate = &respr - g.beginCreateOrUpdate.add(req, beginCreateOrUpdate) - } - - resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { - g.beginCreateOrUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} - } - if !server.PollerResponderMore(beginCreateOrUpdate) { - g.beginCreateOrUpdate.remove(req) - } - - return resp, nil -} - -func (g *GalleryInVMAccessControlProfileVersionsServerTransport) dispatchBeginDelete(req *http.Request) (*http.Response, error) { - if g.srv.BeginDelete == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} - } - beginDelete := g.beginDelete.get(req) - if beginDelete == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inVMAccessControlProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileVersionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileVersionName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.BeginDelete(req.Context(), resourceGroupNameParam, galleryNameParam, inVMAccessControlProfileNameParam, inVMAccessControlProfileVersionNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginDelete = &respr - g.beginDelete.add(req, beginDelete) - } - - resp, err := server.PollerResponderNext(beginDelete, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { - g.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} - } - if !server.PollerResponderMore(beginDelete) { - g.beginDelete.remove(req) - } - - return resp, nil -} - -func (g *GalleryInVMAccessControlProfileVersionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if g.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inVMAccessControlProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileVersionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileVersionName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.Get(req.Context(), resourceGroupNameParam, galleryNameParam, inVMAccessControlProfileNameParam, inVMAccessControlProfileVersionNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).GalleryInVMAccessControlProfileVersion, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (g *GalleryInVMAccessControlProfileVersionsServerTransport) dispatchNewListByGalleryInVMAccessControlProfilePager(req *http.Request) (*http.Response, error) { - if g.srv.NewListByGalleryInVMAccessControlProfilePager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByGalleryInVMAccessControlProfilePager not implemented")} - } - newListByGalleryInVMAccessControlProfilePager := g.newListByGalleryInVMAccessControlProfilePager.get(req) - if newListByGalleryInVMAccessControlProfilePager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inVMAccessControlProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 4 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileName")]) - if err != nil { - return nil, err - } - resp := g.srv.NewListByGalleryInVMAccessControlProfilePager(resourceGroupNameParam, galleryNameParam, inVMAccessControlProfileNameParam, nil) - newListByGalleryInVMAccessControlProfilePager = &resp - g.newListByGalleryInVMAccessControlProfilePager.add(req, newListByGalleryInVMAccessControlProfilePager) - server.PagerResponderInjectNextLinks(newListByGalleryInVMAccessControlProfilePager, req, func(page *armcompute.GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByGalleryInVMAccessControlProfilePager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - g.newListByGalleryInVMAccessControlProfilePager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByGalleryInVMAccessControlProfilePager) { - g.newListByGalleryInVMAccessControlProfilePager.remove(req) - } - return resp, nil -} - -func (g *GalleryInVMAccessControlProfileVersionsServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Response, error) { - if g.srv.BeginUpdate == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} - } - beginUpdate := g.beginUpdate.get(req) - if beginUpdate == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/inVMAccessControlProfiles/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armcompute.GalleryInVMAccessControlProfileVersionUpdate](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileName")]) - if err != nil { - return nil, err - } - inVMAccessControlProfileVersionNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("inVMAccessControlProfileVersionName")]) - if err != nil { - return nil, err - } - respr, errRespr := g.srv.BeginUpdate(req.Context(), resourceGroupNameParam, galleryNameParam, inVMAccessControlProfileNameParam, inVMAccessControlProfileVersionNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginUpdate = &respr - g.beginUpdate.add(req, beginUpdate) - } - - resp, err := server.PollerResponderNext(beginUpdate, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK}, resp.StatusCode) { - g.beginUpdate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PollerResponderMore(beginUpdate) { - g.beginUpdate.remove(req) - } - - return resp, nil -} diff --git a/sdk/resourcemanager/compute/armcompute/fake/gallerysharingprofile_server.go b/sdk/resourcemanager/compute/armcompute/fake/gallerysharingprofile_server.go index e565bdf79930..d38dac2a511b 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/gallerysharingprofile_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/gallerysharingprofile_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/images_server.go b/sdk/resourcemanager/compute/armcompute/fake/images_server.go index 5c8fe01426e5..fac370f72c72 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/images_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/images_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/loganalytics_server.go b/sdk/resourcemanager/compute/armcompute/fake/loganalytics_server.go index 5147327f8627..33e2602cceb2 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/loganalytics_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/loganalytics_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/operations_server.go b/sdk/resourcemanager/compute/armcompute/fake/operations_server.go index 82f35e86e868..790e7bfe7a93 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/operations_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/operations_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" ) diff --git a/sdk/resourcemanager/compute/armcompute/fake/proximityplacementgroups_server.go b/sdk/resourcemanager/compute/armcompute/fake/proximityplacementgroups_server.go index 8585d5c4caf8..aa0b6ce8bd4b 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/proximityplacementgroups_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/proximityplacementgroups_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/resourceskus_server.go b/sdk/resourcemanager/compute/armcompute/fake/resourceskus_server.go index b6f97e4eb152..55bcd0fb364c 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/resourceskus_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/resourceskus_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/restorepointcollections_server.go b/sdk/resourcemanager/compute/armcompute/fake/restorepointcollections_server.go index b38d24435c73..24d9c3338c89 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/restorepointcollections_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/restorepointcollections_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/restorepoints_server.go b/sdk/resourcemanager/compute/armcompute/fake/restorepoints_server.go index 6f9cccc90780..2cd447ec9015 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/restorepoints_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/restorepoints_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/server_factory.go b/sdk/resourcemanager/compute/armcompute/fake/server_factory.go index 11db91f21d56..4ec55a494807 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/server_factory.go +++ b/sdk/resourcemanager/compute/armcompute/fake/server_factory.go @@ -19,58 +19,55 @@ import ( // ServerFactory is a fake server for instances of the armcompute.ClientFactory type. type ServerFactory struct { - AvailabilitySetsServer AvailabilitySetsServer - CapacityReservationGroupsServer CapacityReservationGroupsServer - CapacityReservationsServer CapacityReservationsServer - CloudServiceOperatingSystemsServer CloudServiceOperatingSystemsServer - CloudServiceRoleInstancesServer CloudServiceRoleInstancesServer - CloudServiceRolesServer CloudServiceRolesServer - CloudServicesServer CloudServicesServer - CloudServicesUpdateDomainServer CloudServicesUpdateDomainServer - CommunityGalleriesServer CommunityGalleriesServer - CommunityGalleryImageVersionsServer CommunityGalleryImageVersionsServer - CommunityGalleryImagesServer CommunityGalleryImagesServer - DedicatedHostGroupsServer DedicatedHostGroupsServer - DedicatedHostsServer DedicatedHostsServer - DiskAccessesServer DiskAccessesServer - DiskEncryptionSetsServer DiskEncryptionSetsServer - DiskRestorePointServer DiskRestorePointServer - DisksServer DisksServer - GalleriesServer GalleriesServer - GalleryApplicationVersionsServer GalleryApplicationVersionsServer - GalleryApplicationsServer GalleryApplicationsServer - GalleryImageVersionsServer GalleryImageVersionsServer - GalleryImagesServer GalleryImagesServer - GalleryInVMAccessControlProfileVersionsServer GalleryInVMAccessControlProfileVersionsServer - GalleryInVMAccessControlProfilesServer GalleryInVMAccessControlProfilesServer - GallerySharingProfileServer GallerySharingProfileServer - ImagesServer ImagesServer - LogAnalyticsServer LogAnalyticsServer - OperationsServer OperationsServer - ProximityPlacementGroupsServer ProximityPlacementGroupsServer - ResourceSKUsServer ResourceSKUsServer - RestorePointCollectionsServer RestorePointCollectionsServer - RestorePointsServer RestorePointsServer - SSHPublicKeysServer SSHPublicKeysServer - SharedGalleriesServer SharedGalleriesServer - SharedGalleryImageVersionsServer SharedGalleryImageVersionsServer - SharedGalleryImagesServer SharedGalleryImagesServer - SnapshotsServer SnapshotsServer - SoftDeletedResourceServer SoftDeletedResourceServer - UsageServer UsageServer - VirtualMachineExtensionImagesServer VirtualMachineExtensionImagesServer - VirtualMachineExtensionsServer VirtualMachineExtensionsServer - VirtualMachineImagesServer VirtualMachineImagesServer - VirtualMachineImagesEdgeZoneServer VirtualMachineImagesEdgeZoneServer - VirtualMachineRunCommandsServer VirtualMachineRunCommandsServer - VirtualMachineScaleSetExtensionsServer VirtualMachineScaleSetExtensionsServer - VirtualMachineScaleSetRollingUpgradesServer VirtualMachineScaleSetRollingUpgradesServer - VirtualMachineScaleSetVMExtensionsServer VirtualMachineScaleSetVMExtensionsServer - VirtualMachineScaleSetVMRunCommandsServer VirtualMachineScaleSetVMRunCommandsServer - VirtualMachineScaleSetVMsServer VirtualMachineScaleSetVMsServer - VirtualMachineScaleSetsServer VirtualMachineScaleSetsServer - VirtualMachineSizesServer VirtualMachineSizesServer - VirtualMachinesServer VirtualMachinesServer + AvailabilitySetsServer AvailabilitySetsServer + CapacityReservationGroupsServer CapacityReservationGroupsServer + CapacityReservationsServer CapacityReservationsServer + CloudServiceOperatingSystemsServer CloudServiceOperatingSystemsServer + CloudServiceRoleInstancesServer CloudServiceRoleInstancesServer + CloudServiceRolesServer CloudServiceRolesServer + CloudServicesServer CloudServicesServer + CloudServicesUpdateDomainServer CloudServicesUpdateDomainServer + CommunityGalleriesServer CommunityGalleriesServer + CommunityGalleryImageVersionsServer CommunityGalleryImageVersionsServer + CommunityGalleryImagesServer CommunityGalleryImagesServer + DedicatedHostGroupsServer DedicatedHostGroupsServer + DedicatedHostsServer DedicatedHostsServer + DiskAccessesServer DiskAccessesServer + DiskEncryptionSetsServer DiskEncryptionSetsServer + DiskRestorePointServer DiskRestorePointServer + DisksServer DisksServer + GalleriesServer GalleriesServer + GalleryApplicationVersionsServer GalleryApplicationVersionsServer + GalleryApplicationsServer GalleryApplicationsServer + GalleryImageVersionsServer GalleryImageVersionsServer + GalleryImagesServer GalleryImagesServer + GallerySharingProfileServer GallerySharingProfileServer + ImagesServer ImagesServer + LogAnalyticsServer LogAnalyticsServer + OperationsServer OperationsServer + ProximityPlacementGroupsServer ProximityPlacementGroupsServer + ResourceSKUsServer ResourceSKUsServer + RestorePointCollectionsServer RestorePointCollectionsServer + RestorePointsServer RestorePointsServer + SSHPublicKeysServer SSHPublicKeysServer + SharedGalleriesServer SharedGalleriesServer + SharedGalleryImageVersionsServer SharedGalleryImageVersionsServer + SharedGalleryImagesServer SharedGalleryImagesServer + SnapshotsServer SnapshotsServer + UsageServer UsageServer + VirtualMachineExtensionImagesServer VirtualMachineExtensionImagesServer + VirtualMachineExtensionsServer VirtualMachineExtensionsServer + VirtualMachineImagesServer VirtualMachineImagesServer + VirtualMachineImagesEdgeZoneServer VirtualMachineImagesEdgeZoneServer + VirtualMachineRunCommandsServer VirtualMachineRunCommandsServer + VirtualMachineScaleSetExtensionsServer VirtualMachineScaleSetExtensionsServer + VirtualMachineScaleSetRollingUpgradesServer VirtualMachineScaleSetRollingUpgradesServer + VirtualMachineScaleSetVMExtensionsServer VirtualMachineScaleSetVMExtensionsServer + VirtualMachineScaleSetVMRunCommandsServer VirtualMachineScaleSetVMRunCommandsServer + VirtualMachineScaleSetVMsServer VirtualMachineScaleSetVMsServer + VirtualMachineScaleSetsServer VirtualMachineScaleSetsServer + VirtualMachineSizesServer VirtualMachineSizesServer + VirtualMachinesServer VirtualMachinesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -85,60 +82,57 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armcompute.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trAvailabilitySetsServer *AvailabilitySetsServerTransport - trCapacityReservationGroupsServer *CapacityReservationGroupsServerTransport - trCapacityReservationsServer *CapacityReservationsServerTransport - trCloudServiceOperatingSystemsServer *CloudServiceOperatingSystemsServerTransport - trCloudServiceRoleInstancesServer *CloudServiceRoleInstancesServerTransport - trCloudServiceRolesServer *CloudServiceRolesServerTransport - trCloudServicesServer *CloudServicesServerTransport - trCloudServicesUpdateDomainServer *CloudServicesUpdateDomainServerTransport - trCommunityGalleriesServer *CommunityGalleriesServerTransport - trCommunityGalleryImageVersionsServer *CommunityGalleryImageVersionsServerTransport - trCommunityGalleryImagesServer *CommunityGalleryImagesServerTransport - trDedicatedHostGroupsServer *DedicatedHostGroupsServerTransport - trDedicatedHostsServer *DedicatedHostsServerTransport - trDiskAccessesServer *DiskAccessesServerTransport - trDiskEncryptionSetsServer *DiskEncryptionSetsServerTransport - trDiskRestorePointServer *DiskRestorePointServerTransport - trDisksServer *DisksServerTransport - trGalleriesServer *GalleriesServerTransport - trGalleryApplicationVersionsServer *GalleryApplicationVersionsServerTransport - trGalleryApplicationsServer *GalleryApplicationsServerTransport - trGalleryImageVersionsServer *GalleryImageVersionsServerTransport - trGalleryImagesServer *GalleryImagesServerTransport - trGalleryInVMAccessControlProfileVersionsServer *GalleryInVMAccessControlProfileVersionsServerTransport - trGalleryInVMAccessControlProfilesServer *GalleryInVMAccessControlProfilesServerTransport - trGallerySharingProfileServer *GallerySharingProfileServerTransport - trImagesServer *ImagesServerTransport - trLogAnalyticsServer *LogAnalyticsServerTransport - trOperationsServer *OperationsServerTransport - trProximityPlacementGroupsServer *ProximityPlacementGroupsServerTransport - trResourceSKUsServer *ResourceSKUsServerTransport - trRestorePointCollectionsServer *RestorePointCollectionsServerTransport - trRestorePointsServer *RestorePointsServerTransport - trSSHPublicKeysServer *SSHPublicKeysServerTransport - trSharedGalleriesServer *SharedGalleriesServerTransport - trSharedGalleryImageVersionsServer *SharedGalleryImageVersionsServerTransport - trSharedGalleryImagesServer *SharedGalleryImagesServerTransport - trSnapshotsServer *SnapshotsServerTransport - trSoftDeletedResourceServer *SoftDeletedResourceServerTransport - trUsageServer *UsageServerTransport - trVirtualMachineExtensionImagesServer *VirtualMachineExtensionImagesServerTransport - trVirtualMachineExtensionsServer *VirtualMachineExtensionsServerTransport - trVirtualMachineImagesServer *VirtualMachineImagesServerTransport - trVirtualMachineImagesEdgeZoneServer *VirtualMachineImagesEdgeZoneServerTransport - trVirtualMachineRunCommandsServer *VirtualMachineRunCommandsServerTransport - trVirtualMachineScaleSetExtensionsServer *VirtualMachineScaleSetExtensionsServerTransport - trVirtualMachineScaleSetRollingUpgradesServer *VirtualMachineScaleSetRollingUpgradesServerTransport - trVirtualMachineScaleSetVMExtensionsServer *VirtualMachineScaleSetVMExtensionsServerTransport - trVirtualMachineScaleSetVMRunCommandsServer *VirtualMachineScaleSetVMRunCommandsServerTransport - trVirtualMachineScaleSetVMsServer *VirtualMachineScaleSetVMsServerTransport - trVirtualMachineScaleSetsServer *VirtualMachineScaleSetsServerTransport - trVirtualMachineSizesServer *VirtualMachineSizesServerTransport - trVirtualMachinesServer *VirtualMachinesServerTransport + srv *ServerFactory + trMu sync.Mutex + trAvailabilitySetsServer *AvailabilitySetsServerTransport + trCapacityReservationGroupsServer *CapacityReservationGroupsServerTransport + trCapacityReservationsServer *CapacityReservationsServerTransport + trCloudServiceOperatingSystemsServer *CloudServiceOperatingSystemsServerTransport + trCloudServiceRoleInstancesServer *CloudServiceRoleInstancesServerTransport + trCloudServiceRolesServer *CloudServiceRolesServerTransport + trCloudServicesServer *CloudServicesServerTransport + trCloudServicesUpdateDomainServer *CloudServicesUpdateDomainServerTransport + trCommunityGalleriesServer *CommunityGalleriesServerTransport + trCommunityGalleryImageVersionsServer *CommunityGalleryImageVersionsServerTransport + trCommunityGalleryImagesServer *CommunityGalleryImagesServerTransport + trDedicatedHostGroupsServer *DedicatedHostGroupsServerTransport + trDedicatedHostsServer *DedicatedHostsServerTransport + trDiskAccessesServer *DiskAccessesServerTransport + trDiskEncryptionSetsServer *DiskEncryptionSetsServerTransport + trDiskRestorePointServer *DiskRestorePointServerTransport + trDisksServer *DisksServerTransport + trGalleriesServer *GalleriesServerTransport + trGalleryApplicationVersionsServer *GalleryApplicationVersionsServerTransport + trGalleryApplicationsServer *GalleryApplicationsServerTransport + trGalleryImageVersionsServer *GalleryImageVersionsServerTransport + trGalleryImagesServer *GalleryImagesServerTransport + trGallerySharingProfileServer *GallerySharingProfileServerTransport + trImagesServer *ImagesServerTransport + trLogAnalyticsServer *LogAnalyticsServerTransport + trOperationsServer *OperationsServerTransport + trProximityPlacementGroupsServer *ProximityPlacementGroupsServerTransport + trResourceSKUsServer *ResourceSKUsServerTransport + trRestorePointCollectionsServer *RestorePointCollectionsServerTransport + trRestorePointsServer *RestorePointsServerTransport + trSSHPublicKeysServer *SSHPublicKeysServerTransport + trSharedGalleriesServer *SharedGalleriesServerTransport + trSharedGalleryImageVersionsServer *SharedGalleryImageVersionsServerTransport + trSharedGalleryImagesServer *SharedGalleryImagesServerTransport + trSnapshotsServer *SnapshotsServerTransport + trUsageServer *UsageServerTransport + trVirtualMachineExtensionImagesServer *VirtualMachineExtensionImagesServerTransport + trVirtualMachineExtensionsServer *VirtualMachineExtensionsServerTransport + trVirtualMachineImagesServer *VirtualMachineImagesServerTransport + trVirtualMachineImagesEdgeZoneServer *VirtualMachineImagesEdgeZoneServerTransport + trVirtualMachineRunCommandsServer *VirtualMachineRunCommandsServerTransport + trVirtualMachineScaleSetExtensionsServer *VirtualMachineScaleSetExtensionsServerTransport + trVirtualMachineScaleSetRollingUpgradesServer *VirtualMachineScaleSetRollingUpgradesServerTransport + trVirtualMachineScaleSetVMExtensionsServer *VirtualMachineScaleSetVMExtensionsServerTransport + trVirtualMachineScaleSetVMRunCommandsServer *VirtualMachineScaleSetVMRunCommandsServerTransport + trVirtualMachineScaleSetVMsServer *VirtualMachineScaleSetVMsServerTransport + trVirtualMachineScaleSetsServer *VirtualMachineScaleSetsServerTransport + trVirtualMachineSizesServer *VirtualMachineSizesServerTransport + trVirtualMachinesServer *VirtualMachinesServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -258,16 +252,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewGalleryImagesServerTransport(&s.srv.GalleryImagesServer) }) resp, err = s.trGalleryImagesServer.Do(req) - case "GalleryInVMAccessControlProfileVersionsClient": - initServer(s, &s.trGalleryInVMAccessControlProfileVersionsServer, func() *GalleryInVMAccessControlProfileVersionsServerTransport { - return NewGalleryInVMAccessControlProfileVersionsServerTransport(&s.srv.GalleryInVMAccessControlProfileVersionsServer) - }) - resp, err = s.trGalleryInVMAccessControlProfileVersionsServer.Do(req) - case "GalleryInVMAccessControlProfilesClient": - initServer(s, &s.trGalleryInVMAccessControlProfilesServer, func() *GalleryInVMAccessControlProfilesServerTransport { - return NewGalleryInVMAccessControlProfilesServerTransport(&s.srv.GalleryInVMAccessControlProfilesServer) - }) - resp, err = s.trGalleryInVMAccessControlProfilesServer.Do(req) case "GallerySharingProfileClient": initServer(s, &s.trGallerySharingProfileServer, func() *GallerySharingProfileServerTransport { return NewGallerySharingProfileServerTransport(&s.srv.GallerySharingProfileServer) @@ -323,11 +307,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "SnapshotsClient": initServer(s, &s.trSnapshotsServer, func() *SnapshotsServerTransport { return NewSnapshotsServerTransport(&s.srv.SnapshotsServer) }) resp, err = s.trSnapshotsServer.Do(req) - case "SoftDeletedResourceClient": - initServer(s, &s.trSoftDeletedResourceServer, func() *SoftDeletedResourceServerTransport { - return NewSoftDeletedResourceServerTransport(&s.srv.SoftDeletedResourceServer) - }) - resp, err = s.trSoftDeletedResourceServer.Do(req) case "UsageClient": initServer(s, &s.trUsageServer, func() *UsageServerTransport { return NewUsageServerTransport(&s.srv.UsageServer) }) resp, err = s.trUsageServer.Do(req) diff --git a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleries_server.go b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleries_server.go index 72ac36f0465a..d2e23bd17f30 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleries_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleries_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimages_server.go b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimages_server.go index 4dba363d3e15..69bc1af2d791 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimages_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimages_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimageversions_server.go b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimageversions_server.go index 02f244a6585c..23525e11a674 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimageversions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimageversions_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/snapshots_server.go b/sdk/resourcemanager/compute/armcompute/fake/snapshots_server.go index bfc74a468abc..6c7237aa83f2 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/snapshots_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/snapshots_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/softdeletedresource_server.go b/sdk/resourcemanager/compute/armcompute/fake/softdeletedresource_server.go deleted file mode 100644 index 8cc05f77a924..000000000000 --- a/sdk/resourcemanager/compute/armcompute/fake/softdeletedresource_server.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" - "net/http" - "net/url" - "regexp" -) - -// SoftDeletedResourceServer is a fake server for instances of the armcompute.SoftDeletedResourceClient type. -type SoftDeletedResourceServer struct { - // NewListByArtifactNamePager is the fake for method SoftDeletedResourceClient.NewListByArtifactNamePager - // HTTP status codes to indicate success: http.StatusOK - NewListByArtifactNamePager func(resourceGroupName string, galleryName string, artifactType string, artifactName string, options *armcompute.SoftDeletedResourceClientListByArtifactNameOptions) (resp azfake.PagerResponder[armcompute.SoftDeletedResourceClientListByArtifactNameResponse]) -} - -// NewSoftDeletedResourceServerTransport creates a new instance of SoftDeletedResourceServerTransport with the provided implementation. -// The returned SoftDeletedResourceServerTransport instance is connected to an instance of armcompute.SoftDeletedResourceClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewSoftDeletedResourceServerTransport(srv *SoftDeletedResourceServer) *SoftDeletedResourceServerTransport { - return &SoftDeletedResourceServerTransport{ - srv: srv, - newListByArtifactNamePager: newTracker[azfake.PagerResponder[armcompute.SoftDeletedResourceClientListByArtifactNameResponse]](), - } -} - -// SoftDeletedResourceServerTransport connects instances of armcompute.SoftDeletedResourceClient to instances of SoftDeletedResourceServer. -// Don't use this type directly, use NewSoftDeletedResourceServerTransport instead. -type SoftDeletedResourceServerTransport struct { - srv *SoftDeletedResourceServer - newListByArtifactNamePager *tracker[azfake.PagerResponder[armcompute.SoftDeletedResourceClientListByArtifactNameResponse]] -} - -// Do implements the policy.Transporter interface for SoftDeletedResourceServerTransport. -func (s *SoftDeletedResourceServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "SoftDeletedResourceClient.NewListByArtifactNamePager": - resp, err = s.dispatchNewListByArtifactNamePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (s *SoftDeletedResourceServerTransport) dispatchNewListByArtifactNamePager(req *http.Request) (*http.Response, error) { - if s.srv.NewListByArtifactNamePager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByArtifactNamePager not implemented")} - } - newListByArtifactNamePager := s.newListByArtifactNamePager.get(req) - if newListByArtifactNamePager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/softDeletedArtifactTypes/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/artifacts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - galleryNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("galleryName")]) - if err != nil { - return nil, err - } - artifactTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("artifactType")]) - if err != nil { - return nil, err - } - artifactNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("artifactName")]) - if err != nil { - return nil, err - } - resp := s.srv.NewListByArtifactNamePager(resourceGroupNameParam, galleryNameParam, artifactTypeParam, artifactNameParam, nil) - newListByArtifactNamePager = &resp - s.newListByArtifactNamePager.add(req, newListByArtifactNamePager) - server.PagerResponderInjectNextLinks(newListByArtifactNamePager, req, func(page *armcompute.SoftDeletedResourceClientListByArtifactNameResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByArtifactNamePager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - s.newListByArtifactNamePager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByArtifactNamePager) { - s.newListByArtifactNamePager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/compute/armcompute/fake/sshpublickeys_server.go b/sdk/resourcemanager/compute/armcompute/fake/sshpublickeys_server.go index 1eec8b1aa2a4..fc0a97b28924 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/sshpublickeys_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/sshpublickeys_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/compute/armcompute/fake/usage_server.go b/sdk/resourcemanager/compute/armcompute/fake/usage_server.go index 03b01cf24c24..5750e74b252c 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/usage_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/usage_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensionimages_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensionimages_server.go index 31e1f1f2eb7d..e0bff4f2d8f8 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensionimages_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensionimages_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensions_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensions_server.go index 05fbe3937ee7..c018650fe3cb 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensions_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimages_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimages_server.go index dfa58f7451d1..a1e82a480c50 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimages_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimages_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimagesedgezone_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimagesedgezone_server.go index 289b35f4edc3..e4af0451f84d 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimagesedgezone_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimagesedgezone_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineruncommands_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineruncommands_server.go index 09812c564c33..591975b82da0 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineruncommands_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineruncommands_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachines_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachines_server.go index fb3fe36f8e6b..3d993a920827 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachines_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachines_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetextensions_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetextensions_server.go index d74732ad743c..95e6db973dd4 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetextensions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetextensions_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetrollingupgrades_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetrollingupgrades_server.go index db42c77a9aac..d93bfe629bac 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetrollingupgrades_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetrollingupgrades_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesets_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesets_server.go index 2e5a1297dc1c..1a18784f361e 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesets_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesets_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmextensions_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmextensions_server.go index a6ec5d21c8f6..4cab8d75b29b 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmextensions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmextensions_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmruncommands_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmruncommands_server.go index 40519aeefa91..7e82bd6777b1 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmruncommands_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmruncommands_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvms_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvms_server.go index 32b3b5806d47..af70860a6cd3 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvms_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvms_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinesizes_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinesizes_server.go index 79a67eb25364..bd31f9c108a4 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinesizes_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinesizes_server.go @@ -14,7 +14,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/compute/armcompute/galleries_client.go b/sdk/resourcemanager/compute/armcompute/galleries_client.go index 17cd0a54fe65..f24e730a63f5 100644 --- a/sdk/resourcemanager/compute/armcompute/galleries_client.go +++ b/sdk/resourcemanager/compute/armcompute/galleries_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -74,7 +74,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery, options *GalleriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "GalleriesClient.BeginCreateOrUpdate" @@ -116,7 +116,7 @@ func (client *GalleriesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, gallery); err != nil { @@ -128,7 +128,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -152,7 +152,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleriesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, options *GalleriesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "GalleriesClient.BeginDelete" @@ -194,7 +194,7 @@ func (client *GalleriesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +203,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -255,7 +255,7 @@ func (client *GalleriesClient) getCreateRequest(ctx context.Context, resourceGro if options != nil && options.Select != nil { reqQP.Set("$select", string(*options.Select)) } - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +272,7 @@ func (client *GalleriesClient) getHandleResponse(resp *http.Response) (Galleries // NewListPager - List galleries under a subscription. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-03 // - options - GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method. func (client *GalleriesClient) NewListPager(options *GalleriesClientListOptions) *runtime.Pager[GalleriesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[GalleriesClientListResponse]{ @@ -309,7 +309,7 @@ func (client *GalleriesClient) listCreateRequest(ctx context.Context, options *G return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,7 +326,7 @@ func (client *GalleriesClient) listHandleResponse(resp *http.Response) (Gallerie // NewListByResourceGroupPager - List galleries under a resource group. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-03 // - resourceGroupName - The name of the resource group. // - options - GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager // method. @@ -369,7 +369,7 @@ func (client *GalleriesClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +387,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -413,7 +413,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleriesClient) update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate, options *GalleriesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "GalleriesClient.BeginUpdate" @@ -455,7 +455,7 @@ func (client *GalleriesClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, gallery); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/galleries_client_example_test.go b/sdk/resourcemanager/compute/armcompute/galleries_client_example_test.go deleted file mode 100644 index 480402936b22..000000000000 --- a/sdk/resourcemanager/compute/armcompute/galleries_client_example_test.go +++ /dev/null @@ -1,630 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/CommunityGallery_Create.json -func ExampleGalleriesClient_BeginCreateOrUpdate_createACommunityGallery() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleriesClient().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: &armcompute.CommunityGalleryInfo{ - Eula: to.Ptr("eula"), - PublicNamePrefix: to.Ptr("PirPublic"), - PublisherContact: to.Ptr("pir@microsoft.com"), - PublisherURI: to.Ptr("uri"), - }, - Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesCommunity), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // SharingProfile: &armcompute.SharingProfile{ - // CommunityGalleryInfo: &armcompute.CommunityGalleryInfo{ - // Eula: to.Ptr("eula"), - // PublicNamePrefix: to.Ptr("PirPublic"), - // PublisherContact: to.Ptr("pir@microsoft.com"), - // PublisherURI: to.Ptr("uri"), - // }, - // Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesCommunity), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_Create_WithSharingProfile.json -func ExampleGalleriesClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryWithSharingProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleriesClient().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{ - Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesGroups), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // SharingProfile: &armcompute.SharingProfile{ - // Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesGroups), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_Create_SoftDeletionEnabled.json -func ExampleGalleriesClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryWithSoftDeletionEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleriesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ - Location: to.Ptr("West US"), - Properties: &armcompute.GalleryProperties{ - Description: to.Ptr("This is the gallery description."), - SoftDeletePolicy: &armcompute.SoftDeletePolicy{ - IsSoftDeleteEnabled: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // SoftDeletePolicy: &armcompute.SoftDeletePolicy{ - // IsSoftDeleteEnabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_Create_WithManagedIdentity.json -func ExampleGalleriesClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryWithSystemAssignedAndUserAssignedManagedIdentities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleriesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ - Location: to.Ptr("West US"), - Identity: &armcompute.GalleryIdentity{ - Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}, - }, - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Identity: &armcompute.GalleryIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": &armcompute.UserAssignedIdentitiesValue{ - // }, - // }, - // }, - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_Create.json -func ExampleGalleriesClient_BeginCreateOrUpdate_createOrUpdateASimpleGallery() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleriesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.Gallery{ - Location: to.Ptr("West US"), - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_Update.json -func ExampleGalleriesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleriesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/CommunityGallery_Get.json -func ExampleGalleriesClient_Get_getACommunityGallery() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil, - Expand: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/communityGalleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // SharingProfile: &armcompute.SharingProfile{ - // CommunityGalleryInfo: &armcompute.CommunityGalleryInfo{ - // CommunityGalleryEnabled: to.Ptr(true), - // Eula: to.Ptr("eula"), - // PublicNames: []*string{ - // to.Ptr("GalleryPublicName")}, - // PublisherContact: to.Ptr("pir@microsoft.com"), - // PublisherURI: to.Ptr("uri"), - // }, - // Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesCommunity), - // }, - // SharingStatus: &armcompute.SharingStatus{ - // AggregatedState: to.Ptr(armcompute.SharingStateSucceeded), - // Summary: []*armcompute.RegionalSharingStatus{ - // { - // Region: to.Ptr("westus"), - // State: to.Ptr(armcompute.SharingStateSucceeded), - // Details: to.Ptr(""), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_Get_WithExpandSharingProfileGroups.json -func ExampleGalleriesClient_Get_getAGalleryWithExpandSharingProfileGroups() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil, - Expand: to.Ptr(armcompute.GalleryExpandParamsSharingProfileGroups), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // SharingProfile: &armcompute.SharingProfile{ - // 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")}, - // }}, - // Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesGroups), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_Get_WithSelectPermissions.json -func ExampleGalleriesClient_Get_getAGalleryWithSelectPermissions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: to.Ptr(armcompute.SelectPermissionsPermissions), - Expand: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // SharingProfile: &armcompute.SharingProfile{ - // 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")}, - // }}, - // Permissions: to.Ptr(armcompute.GallerySharingPermissionTypesGroups), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_Get_WithManagedIdentity.json -func ExampleGalleriesClient_Get_getAGalleryWithSystemAssignedAndUserAssignedManagedIdentities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil, - Expand: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Identity: &armcompute.GalleryIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // TenantID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": &armcompute.UserAssignedIdentitiesValue{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // }, - // }, - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_Get.json -func ExampleGalleriesClient_Get_getAGallery() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleriesClient().Get(ctx, "myResourceGroup", "myGalleryName", &armcompute.GalleriesClientGetOptions{Select: nil, - Expand: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Gallery = armcompute.Gallery{ - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_Delete.json -func ExampleGalleriesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleriesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_ListByResourceGroup.json -func ExampleGalleriesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGalleriesClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GalleryList = armcompute.GalleryList{ - // Value: []*armcompute.Gallery{ - // { - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_ListBySubscription.json -func ExampleGalleriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGalleriesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GalleryList = armcompute.GalleryList{ - // Value: []*armcompute.Gallery{ - // { - // Name: to.Ptr("myGalleryName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryProperties{ - // Description: to.Ptr("This is the gallery description."), - // Identifier: &armcompute.GalleryIdentifier{ - // UniqueName: to.Ptr("{subscription-id}-MYGALLERYNAME"), - // }, - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/gallery_live_test.go b/sdk/resourcemanager/compute/armcompute/gallery_live_test.go index 4631d979b2f9..ebdf95417800 100644 --- a/sdk/resourcemanager/compute/armcompute/gallery_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/gallery_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/galleryapplications_client.go b/sdk/resourcemanager/compute/armcompute/galleryapplications_client.go index 5bd6ea34e198..cd5d6f3ecfe6 100644 --- a/sdk/resourcemanager/compute/armcompute/galleryapplications_client.go +++ b/sdk/resourcemanager/compute/armcompute/galleryapplications_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-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 @@ -76,7 +76,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryApplicationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication, options *GalleryApplicationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "GalleryApplicationsClient.BeginCreateOrUpdate" @@ -122,7 +122,7 @@ func (client *GalleryApplicationsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, galleryApplication); err != nil { @@ -134,7 +134,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -160,7 +160,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryApplicationsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, options *GalleryApplicationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "GalleryApplicationsClient.BeginDelete" @@ -206,7 +206,7 @@ func (client *GalleryApplicationsClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -266,7 +266,7 @@ func (client *GalleryApplicationsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *GalleryApplicationsClient) getHandleResponse(resp *http.Response) // NewListByGalleryPager - List gallery Application Definitions in a gallery. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-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.NewListByGalleryPager @@ -331,7 +331,7 @@ func (client *GalleryApplicationsClient) listByGalleryCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,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 2024-03-03 +// Generated from API version 2023-07-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 @@ -378,7 +378,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryApplicationsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate, options *GalleryApplicationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "GalleryApplicationsClient.BeginUpdate" @@ -424,7 +424,7 @@ func (client *GalleryApplicationsClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, galleryApplication); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/galleryapplications_client_example_test.go b/sdk/resourcemanager/compute/armcompute/galleryapplications_client_example_test.go deleted file mode 100644 index a04d261ce0e7..000000000000 --- a/sdk/resourcemanager/compute/armcompute/galleryapplications_client_example_test.go +++ /dev/null @@ -1,287 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplication_Create.json -func ExampleGalleryApplicationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryApplicationsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", armcompute.GalleryApplication{ - Location: to.Ptr("West US"), - Properties: &armcompute.GalleryApplicationProperties{ - Description: to.Ptr("This is the gallery application description."), - CustomActions: []*armcompute.GalleryApplicationCustomAction{ - { - Name: to.Ptr("myCustomAction"), - Description: to.Ptr("This is the custom action description."), - Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - { - Name: to.Ptr("myCustomActionParameter"), - Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - Description: to.Ptr("This is the description of the parameter"), - DefaultValue: to.Ptr("default value of parameter."), - Required: to.Ptr(false), - }}, - Script: to.Ptr("myCustomActionScript"), - }}, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryApplication = armcompute.GalleryApplication{ - // Name: to.Ptr("myGalleryApplicationName"), - // Type: to.Ptr("Microsoft.Compute/galleries"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryApplicationProperties{ - // Description: to.Ptr("This is the gallery application description."), - // CustomActions: []*armcompute.GalleryApplicationCustomAction{ - // { - // Name: to.Ptr("myCustomAction"), - // Description: to.Ptr("This is the custom action description."), - // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - // { - // Name: to.Ptr("myCustomActionParameter"), - // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - // Description: to.Ptr("This is the description of the parameter"), - // DefaultValue: to.Ptr("default value of parameter."), - // Required: to.Ptr(false), - // }}, - // Script: to.Ptr("myCustomActionScript"), - // }}, - // Eula: to.Ptr("This is the gallery application EULA."), - // PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), - // ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), - // SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplication_Update.json -func ExampleGalleryApplicationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryApplicationsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", armcompute.GalleryApplicationUpdate{ - Properties: &armcompute.GalleryApplicationProperties{ - Description: to.Ptr("This is the gallery application description."), - CustomActions: []*armcompute.GalleryApplicationCustomAction{ - { - Name: to.Ptr("myCustomAction"), - Description: to.Ptr("This is the custom action description."), - Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - { - Name: to.Ptr("myCustomActionParameter"), - Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - Description: to.Ptr("This is the description of the parameter"), - DefaultValue: to.Ptr("default value of parameter."), - Required: to.Ptr(false), - }}, - Script: to.Ptr("myCustomActionScript"), - }}, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryApplication = armcompute.GalleryApplication{ - // Name: to.Ptr("myGalleryApplicationName"), - // Type: to.Ptr("Microsoft.Compute/galleries"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryApplicationProperties{ - // Description: to.Ptr("This is the gallery application description."), - // CustomActions: []*armcompute.GalleryApplicationCustomAction{ - // { - // Name: to.Ptr("myCustomAction"), - // Description: to.Ptr("This is the custom action description."), - // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - // { - // Name: to.Ptr("myCustomActionParameter"), - // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - // Description: to.Ptr("This is the description of the parameter"), - // DefaultValue: to.Ptr("default value of parameter."), - // Required: to.Ptr(false), - // }}, - // Script: to.Ptr("myCustomActionScript"), - // }}, - // Eula: to.Ptr("This is the gallery application EULA."), - // PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), - // ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), - // SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplication_Get.json -func ExampleGalleryApplicationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryApplicationsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryApplication = armcompute.GalleryApplication{ - // Name: to.Ptr("myGalleryApplicationName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryApplicationProperties{ - // Description: to.Ptr("This is the gallery application description."), - // CustomActions: []*armcompute.GalleryApplicationCustomAction{ - // { - // Name: to.Ptr("myCustomAction"), - // Description: to.Ptr("This is the custom action description."), - // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - // { - // Name: to.Ptr("myCustomActionParameter"), - // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - // Description: to.Ptr("This is the description of the parameter"), - // DefaultValue: to.Ptr("default value of parameter."), - // Required: to.Ptr(false), - // }}, - // Script: to.Ptr("myCustomActionScript"), - // }}, - // Eula: to.Ptr("This is the gallery application EULA."), - // PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), - // ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), - // SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplication_Delete.json -func ExampleGalleryApplicationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryApplicationsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplication_ListByGallery.json -func ExampleGalleryApplicationsClient_NewListByGalleryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGalleryApplicationsClient().NewListByGalleryPager("myResourceGroup", "myGalleryName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GalleryApplicationList = armcompute.GalleryApplicationList{ - // Value: []*armcompute.GalleryApplication{ - // { - // Name: to.Ptr("myGalleryApplicationName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryApplicationProperties{ - // Description: to.Ptr("This is the gallery application description."), - // CustomActions: []*armcompute.GalleryApplicationCustomAction{ - // { - // Name: to.Ptr("myCustomAction"), - // Description: to.Ptr("This is the custom action description."), - // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - // { - // Name: to.Ptr("myCustomActionParameter"), - // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - // Description: to.Ptr("This is the description of the parameter"), - // DefaultValue: to.Ptr("default value of parameter."), - // Required: to.Ptr(false), - // }}, - // Script: to.Ptr("myCustomActionScript"), - // }}, - // Eula: to.Ptr("This is the gallery application EULA."), - // PrivacyStatementURI: to.Ptr("myPrivacyStatementUri}"), - // ReleaseNoteURI: to.Ptr("myReleaseNoteUri"), - // SupportedOSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/galleryapplicationversions_client.go b/sdk/resourcemanager/compute/armcompute/galleryapplicationversions_client.go index 4c1caa929568..06571af3d467 100644 --- a/sdk/resourcemanager/compute/armcompute/galleryapplicationversions_client.go +++ b/sdk/resourcemanager/compute/armcompute/galleryapplicationversions_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -77,7 +77,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryApplicationVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion, options *GalleryApplicationVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "GalleryApplicationVersionsClient.BeginCreateOrUpdate" @@ -127,7 +127,7 @@ func (client *GalleryApplicationVersionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, galleryApplicationVersion); err != nil { @@ -139,7 +139,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -166,7 +166,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryApplicationVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, options *GalleryApplicationVersionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "GalleryApplicationVersionsClient.BeginDelete" @@ -216,7 +216,7 @@ func (client *GalleryApplicationVersionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +225,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -285,7 +285,7 @@ func (client *GalleryApplicationVersionsClient) getCreateRequest(ctx context.Con if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,7 +302,7 @@ func (client *GalleryApplicationVersionsClient) getHandleResponse(resp *http.Res // NewListByGalleryApplicationPager - List gallery Application Versions in a gallery Application Definition. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-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 @@ -356,7 +356,7 @@ func (client *GalleryApplicationVersionsClient) listByGalleryApplicationCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -374,7 +374,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -404,7 +404,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryApplicationVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate, options *GalleryApplicationVersionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "GalleryApplicationVersionsClient.BeginUpdate" @@ -454,7 +454,7 @@ func (client *GalleryApplicationVersionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, galleryApplicationVersion); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/galleryapplicationversions_client_example_test.go b/sdk/resourcemanager/compute/armcompute/galleryapplicationversions_client_example_test.go deleted file mode 100644 index 7e8702083b36..000000000000 --- a/sdk/resourcemanager/compute/armcompute/galleryapplicationversions_client_example_test.go +++ /dev/null @@ -1,474 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplicationVersion_Create.json -func ExampleGalleryApplicationVersionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryApplicationVersionsClient().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:00.000Z"); return t }()), - ReplicaCount: to.Ptr[int32](1), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - TargetRegions: []*armcompute.TargetRegion{ - { - Name: to.Ptr("West US"), - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](1), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - }}, - CustomActions: []*armcompute.GalleryApplicationCustomAction{ - { - Name: to.Ptr("myCustomAction"), - Description: to.Ptr("This is the custom action description."), - Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - { - Name: to.Ptr("myCustomActionParameter"), - Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - Description: to.Ptr("This is the description of the parameter"), - DefaultValue: to.Ptr("default value of parameter."), - Required: to.Ptr(false), - }}, - Script: to.Ptr("myCustomActionScript"), - }}, - 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}"), - }, - }, - SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryApplicationVersion = armcompute.GalleryApplicationVersion{ - // Name: to.Ptr("1.0.0"), - // Type: to.Ptr("Microsoft.Compute/galleries/applications/versions"), - // ID: to.Ptr("/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryApplicationVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ - // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t}()), - // ExcludeFromLatest: to.Ptr(false), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.597Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // TargetRegions: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // AdvancedSettings: map[string]*string{ - // "timeout": to.Ptr("300"), - // "user": to.Ptr("root"), - // }, - // CustomActions: []*armcompute.GalleryApplicationCustomAction{ - // { - // Name: to.Ptr("myCustomAction"), - // Description: to.Ptr("This is the custom action description."), - // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - // { - // Name: to.Ptr("myCustomActionParameter"), - // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - // Description: to.Ptr("This is the description of the parameter"), - // DefaultValue: to.Ptr("default value of parameter."), - // Required: to.Ptr(false), - // }}, - // Script: to.Ptr("myCustomActionScript"), - // }}, - // EnableHealthCheck: to.Ptr(false), - // ManageActions: &armcompute.UserArtifactManage{ - // Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), - // Remove: to.Ptr("del C:\\package "), - // }, - // Settings: &armcompute.UserArtifactSettings{ - // ConfigFileName: to.Ptr("configuration.cfg"), - // PackageFileName: to.Ptr("package.zip"), - // }, - // Source: &armcompute.UserArtifactSource{ - // MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), - // }, - // }, - // SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplicationVersion_Update.json -func ExampleGalleryApplicationVersionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryApplicationVersionsClient().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:00.000Z"); return t }()), - ReplicaCount: to.Ptr[int32](1), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - TargetRegions: []*armcompute.TargetRegion{ - { - Name: to.Ptr("West US"), - ExcludeFromLatest: to.Ptr(false), - 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}"), - }, - }, - SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryApplicationVersion = armcompute.GalleryApplicationVersion{ - // Name: to.Ptr("1.0.0"), - // Type: to.Ptr("Microsoft.Compute/galleries/applications/versions"), - // ID: to.Ptr("/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryApplicationVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ - // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t}()), - // ExcludeFromLatest: to.Ptr(false), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.597Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // TargetRegions: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // EnableHealthCheck: to.Ptr(false), - // 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}"), - // }, - // }, - // SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplicationVersion_Get_WithReplicationStatus.json -func ExampleGalleryApplicationVersionsClient_Get_getAGalleryApplicationVersionWithReplicationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryApplicationVersionsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryApplicationVersion = armcompute.GalleryApplicationVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/applications/myGalleryApplicationName/versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryApplicationVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ - // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t}()), - // ExcludeFromLatest: to.Ptr(false), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.597Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // TargetRegions: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // AdvancedSettings: map[string]*string{ - // "timeout": to.Ptr("300"), - // "user": to.Ptr("root"), - // }, - // CustomActions: []*armcompute.GalleryApplicationCustomAction{ - // { - // Name: to.Ptr("myCustomAction"), - // Description: to.Ptr("This is the custom action description."), - // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - // { - // Name: to.Ptr("myCustomActionParameter"), - // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - // Description: to.Ptr("This is the description of the parameter"), - // DefaultValue: to.Ptr("default value of parameter."), - // Required: to.Ptr(false), - // }}, - // Script: to.Ptr("myCustomActionScript"), - // }}, - // EnableHealthCheck: to.Ptr(false), - // ManageActions: &armcompute.UserArtifactManage{ - // Install: to.Ptr("powershell -command \"Expand-Archive -Path package.zip -DestinationPath C:\\package\""), - // Remove: to.Ptr("del C:\\package "), - // }, - // Settings: &armcompute.UserArtifactSettings{ - // ConfigFileName: to.Ptr("configuration.cfg"), - // PackageFileName: to.Ptr("package.zip"), - // }, - // Source: &armcompute.UserArtifactSource{ - // MediaLink: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/package.zip?{sasKey}"), - // }, - // }, - // ReplicationStatus: &armcompute.ReplicationStatus{ - // AggregatedState: to.Ptr(armcompute.AggregatedReplicationStateCompleted), - // Summary: []*armcompute.RegionalReplicationStatus{ - // { - // Progress: to.Ptr[int32](100), - // Region: to.Ptr("West US"), - // State: to.Ptr(armcompute.ReplicationStateCompleted), - // Details: to.Ptr(""), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplicationVersion_Get.json -func ExampleGalleryApplicationVersionsClient_Get_getAGalleryApplicationVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryApplicationVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryApplicationName", "1.0.0", &armcompute.GalleryApplicationVersionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryApplicationVersion = armcompute.GalleryApplicationVersion{ - // Name: to.Ptr("1.0.0"), - // Type: to.Ptr("Microsoft.Compute/galleries/applications/versions"), - // ID: to.Ptr("/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryApplicationVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ - // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t}()), - // ExcludeFromLatest: to.Ptr(false), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.597Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // TargetRegions: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // CustomActions: []*armcompute.GalleryApplicationCustomAction{ - // { - // Name: to.Ptr("myCustomAction"), - // Description: to.Ptr("This is the custom action description."), - // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - // { - // Name: to.Ptr("myCustomActionParameter"), - // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - // Description: to.Ptr("This is the description of the parameter"), - // DefaultValue: to.Ptr("default value of parameter."), - // Required: to.Ptr(false), - // }}, - // Script: to.Ptr("myCustomActionScript"), - // }}, - // EnableHealthCheck: to.Ptr(false), - // 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}"), - // }, - // }, - // SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplicationVersion_Delete.json -func ExampleGalleryApplicationVersionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryApplicationVersionsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryApplicationVersion_ListByGalleryApplication.json -func ExampleGalleryApplicationVersionsClient_NewListByGalleryApplicationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGalleryApplicationVersionsClient().NewListByGalleryApplicationPager("myResourceGroup", "myGalleryName", "myGalleryApplicationName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GalleryApplicationVersionList = armcompute.GalleryApplicationVersionList{ - // Value: []*armcompute.GalleryApplicationVersion{ - // { - // Name: to.Ptr("1.0.0"), - // Type: to.Ptr("Microsoft.Compute/galleries/applications/versions"), - // ID: to.Ptr("/subscriptions/01523d7c-60da-455e-adef-521b547922c4/resourceGroups/galleryPsTestRg98/providers/Microsoft.Compute/galleries/galleryPsTestGallery6165/applications/galleryPsTestGalleryApplication7825/versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryApplicationVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryApplicationVersionPublishingProfile{ - // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-01T07:00:00.000Z"); return t}()), - // ExcludeFromLatest: to.Ptr(false), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-21T17:13:57.597Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // TargetRegions: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // CustomActions: []*armcompute.GalleryApplicationCustomAction{ - // { - // Name: to.Ptr("myCustomAction"), - // Description: to.Ptr("This is the custom action description."), - // Parameters: []*armcompute.GalleryApplicationCustomActionParameter{ - // { - // Name: to.Ptr("myCustomActionParameter"), - // Type: to.Ptr(armcompute.GalleryApplicationCustomActionParameterTypeString), - // Description: to.Ptr("This is the description of the parameter"), - // DefaultValue: to.Ptr("default value of parameter."), - // Required: to.Ptr(false), - // }}, - // Script: to.Ptr("myCustomActionScript"), - // }}, - // EnableHealthCheck: to.Ptr(false), - // 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}"), - // }, - // }, - // SafetyProfile: &armcompute.GalleryApplicationVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/galleryimages_client.go b/sdk/resourcemanager/compute/armcompute/galleryimages_client.go index a827811db54c..8be1a5784a01 100644 --- a/sdk/resourcemanager/compute/armcompute/galleryimages_client.go +++ b/sdk/resourcemanager/compute/armcompute/galleryimages_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-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 @@ -76,7 +76,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage, options *GalleryImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "GalleryImagesClient.BeginCreateOrUpdate" @@ -122,7 +122,7 @@ func (client *GalleryImagesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, galleryImage); err != nil { @@ -134,7 +134,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -160,7 +160,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, options *GalleryImagesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "GalleryImagesClient.BeginDelete" @@ -206,7 +206,7 @@ func (client *GalleryImagesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -215,7 +215,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -266,7 +266,7 @@ func (client *GalleryImagesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *GalleryImagesClient) getHandleResponse(resp *http.Response) (Galle // NewListByGalleryPager - List gallery image definitions in a gallery. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-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.NewListByGalleryPager @@ -331,7 +331,7 @@ func (client *GalleryImagesClient) listByGalleryCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +349,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 2024-03-03 +// Generated from API version 2023-07-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 @@ -377,7 +377,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryImagesClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate, options *GalleryImagesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "GalleryImagesClient.BeginUpdate" @@ -423,7 +423,7 @@ func (client *GalleryImagesClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, galleryImage); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/galleryimages_client_example_test.go b/sdk/resourcemanager/compute/armcompute/galleryimages_client_example_test.go deleted file mode 100644 index 627a354ebf6e..000000000000 --- a/sdk/resourcemanager/compute/armcompute/galleryimages_client_example_test.go +++ /dev/null @@ -1,285 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImage_Create.json -func ExampleGalleryImagesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImagesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImage = armcompute.GalleryImage{ - // Name: to.Ptr("myGalleryImageName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/Images/myGalleryImageName"), - // 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), - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImage_UpdateFeatures.json -func ExampleGalleryImagesClient_BeginUpdate_updateAGalleryImageFeature() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImagesClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", armcompute.GalleryImageUpdate{ - Properties: &armcompute.GalleryImageProperties{ - AllowUpdateImage: to.Ptr(true), - Features: []*armcompute.GalleryImageFeature{ - { - Name: to.Ptr("SecurityType"), - StartsAtVersion: to.Ptr("2.0.0"), - Value: to.Ptr("TrustedLaunch"), - }}, - HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV2), - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImage = armcompute.GalleryImage{ - // Name: to.Ptr("myGalleryImageName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageProperties{ - // Features: []*armcompute.GalleryImageFeature{ - // { - // Name: to.Ptr("SecurityType"), - // StartsAtVersion: to.Ptr("2.0.0"), - // Value: to.Ptr("TrustedLaunch"), - // }}, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV2), - // 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), - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImage_Update.json -func ExampleGalleryImagesClient_BeginUpdate_updateASimpleGalleryImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImagesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImage = armcompute.GalleryImage{ - // Name: to.Ptr("myGalleryImageName"), - // 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), - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImage_Get.json -func ExampleGalleryImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryImagesClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImage = armcompute.GalleryImage{ - // Name: to.Ptr("myGalleryImageName"), - // ID: to.Ptr("/providers/Microsoft.Compute/galleries/myGallery/Images/myGalleryImageName"), - // 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), - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImage_Delete.json -func ExampleGalleryImagesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImagesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImage_ListByGallery.json -func ExampleGalleryImagesClient_NewListByGalleryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGalleryImagesClient().NewListByGalleryPager("myResourceGroup", "myGalleryName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GalleryImageList = armcompute.GalleryImageList{ - // Value: []*armcompute.GalleryImage{ - // { - // Name: to.Ptr("myGalleryImageName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName"), - // 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), - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/galleryimageversions_client.go b/sdk/resourcemanager/compute/armcompute/galleryimageversions_client.go index 3bfb97ea9ae8..b16e42ed74a0 100644 --- a/sdk/resourcemanager/compute/armcompute/galleryimageversions_client.go +++ b/sdk/resourcemanager/compute/armcompute/galleryimageversions_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -77,7 +77,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryImageVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion, options *GalleryImageVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "GalleryImageVersionsClient.BeginCreateOrUpdate" @@ -127,7 +127,7 @@ func (client *GalleryImageVersionsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, galleryImageVersion); err != nil { @@ -139,7 +139,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -166,7 +166,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryImageVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, options *GalleryImageVersionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "GalleryImageVersionsClient.BeginDelete" @@ -216,7 +216,7 @@ func (client *GalleryImageVersionsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +225,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -285,7 +285,7 @@ func (client *GalleryImageVersionsClient) getCreateRequest(ctx context.Context, if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -302,7 +302,7 @@ func (client *GalleryImageVersionsClient) getHandleResponse(resp *http.Response) // NewListByGalleryImagePager - List gallery image versions in a gallery image definition. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-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. @@ -355,7 +355,7 @@ func (client *GalleryImageVersionsClient) listByGalleryImageCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,7 +373,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -403,7 +403,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GalleryImageVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate, options *GalleryImageVersionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "GalleryImageVersionsClient.BeginUpdate" @@ -453,7 +453,7 @@ func (client *GalleryImageVersionsClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, galleryImageVersion); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/galleryimageversions_client_example_test.go b/sdk/resourcemanager/compute/armcompute/galleryimageversions_client_example_test.go deleted file mode 100644 index 98a4009082b2..000000000000 --- a/sdk/resourcemanager/compute/armcompute/galleryimageversions_client_example_test.go +++ /dev/null @@ -1,2561 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVmAsSource.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryImageVersionUsingVmAsSource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](2), - }, - { - 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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - BlockDeletionBeforeEndOfLife: to.Ptr(false), - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - Source: &armcompute.GalleryArtifactVersionFullSource{ - VirtualMachineID: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // VirtualMachineID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{vmName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithCommunityImageVersionAsSource.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryImageVersionUsingCommunityGalleryImageAsSource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - 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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - BlockDeletionBeforeEndOfLife: to.Ptr(false), - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - Source: &armcompute.GalleryArtifactVersionFullSource{ - CommunityGalleryImageID: to.Ptr("/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // CommunityGalleryImageID: to.Ptr("/communityGalleries/{communityGalleryName}/images/{communityGalleryImageName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Create.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryImageVersionUsingManagedImageAsSource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - 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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - BlockDeletionBeforeEndOfLife: to.Ptr(false), - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - Source: &armcompute.GalleryArtifactVersionFullSource{ - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithSnapshotsAsSource.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryImageVersionUsingMixOfDisksAndSnapshotsAsASource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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/myWestUSDiskEncryptionSet"), - Lun: to.Ptr[int32](1), - }}, - OSDiskImage: &armcompute.OSDiskImageEncryption{ - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - 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/myEastUSDiskEncryptionSet"), - Lun: to.Ptr[int32](1), - }}, - OSDiskImage: &armcompute.OSDiskImageEncryption{ - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - BlockDeletionBeforeEndOfLife: to.Ptr(false), - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - DataDiskImages: []*armcompute.GalleryDataDiskImage{ - { - HostCaching: to.Ptr(armcompute.HostCachingNone), - Source: &armcompute.GalleryDiskImageSource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}"), - }, - Lun: to.Ptr[int32](1), - }}, - OSDiskImage: &armcompute.GalleryOSDiskImage{ - HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - Source: &armcompute.GalleryDiskImageSource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"), - }, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myWestUSDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // Encryption: &armcompute.EncryptionImages{ - // DataDiskImages: []*armcompute.DataDiskImageEncryption{ - // { - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Source: &armcompute.GalleryDiskImageSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/disks/{dataDiskName}"), - // }, - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // Source: &armcompute.GalleryDiskImageSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{osSnapshotName}"), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithShallowReplicationMode.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryImageVersionUsingShallowReplicationMode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersion{ - Location: to.Ptr("West US"), - Properties: &armcompute.GalleryImageVersionProperties{ - PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - ReplicationMode: to.Ptr(armcompute.ReplicationModeShallow), - TargetRegions: []*armcompute.TargetRegion{ - { - Name: to.Ptr("West US"), - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](1), - }}, - }, - SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - BlockDeletionBeforeEndOfLife: to.Ptr(false), - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - Source: &armcompute.GalleryArtifactVersionFullSource{ - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // ReplicationMode: to.Ptr(armcompute.ReplicationModeShallow), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // TargetRegions: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithImageVersionAsSource.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryImageVersionUsingSharedImageAsSource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - 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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - BlockDeletionBeforeEndOfLife: to.Ptr(false), - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - Source: &armcompute.GalleryArtifactVersionFullSource{ - ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD_UefiSettings.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryImageVersionUsingVhdAsASourceWithCustomUefiKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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/myOtherDiskEncryptionSet"), - Lun: to.Ptr[int32](1), - }}, - OSDiskImage: &armcompute.OSDiskImageEncryption{ - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](1), - }, - { - Name: to.Ptr("East US"), - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - BlockDeletionBeforeEndOfLife: to.Ptr(false), - }, - SecurityProfile: &armcompute.ImageVersionSecurityProfile{ - UefiSettings: &armcompute.GalleryImageVersionUefiSettings{ - AdditionalSignatures: &armcompute.UefiKeySignatures{ - Db: []*armcompute.UefiKey{ - { - Type: to.Ptr(armcompute.UefiKeyTypeX509), - Value: []*string{ - to.Ptr("")}, - }}, - Dbx: []*armcompute.UefiKey{ - { - Type: to.Ptr(armcompute.UefiKeyTypeX509), - Value: []*string{ - to.Ptr("")}, - }}, - Kek: []*armcompute.UefiKey{ - { - Type: to.Ptr(armcompute.UefiKeyTypeSHA256), - Value: []*string{ - to.Ptr("")}, - }}, - }, - SignatureTemplateNames: []*armcompute.UefiSignatureTemplateName{ - to.Ptr(armcompute.UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate)}, - }, - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - DataDiskImages: []*armcompute.GalleryDataDiskImage{ - { - HostCaching: to.Ptr(armcompute.HostCachingNone), - Source: &armcompute.GalleryDiskImageSource{ - StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), - URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), - }, - Lun: to.Ptr[int32](1), - }}, - OSDiskImage: &armcompute.GalleryOSDiskImage{ - HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - Source: &armcompute.GalleryDiskImageSource{ - StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), - URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), - }, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myOtherDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // SecurityProfile: &armcompute.ImageVersionSecurityProfile{ - // UefiSettings: &armcompute.GalleryImageVersionUefiSettings{ - // AdditionalSignatures: &armcompute.UefiKeySignatures{ - // Db: []*armcompute.UefiKey{ - // { - // Type: to.Ptr(armcompute.UefiKeyTypeX509), - // Value: []*string{ - // to.Ptr("")}, - // }}, - // Dbx: []*armcompute.UefiKey{ - // { - // Type: to.Ptr(armcompute.UefiKeyTypeX509), - // Value: []*string{ - // to.Ptr("")}, - // }}, - // Kek: []*armcompute.UefiKey{ - // { - // Type: to.Ptr(armcompute.UefiKeyTypeSHA256), - // Value: []*string{ - // to.Ptr("")}, - // }}, - // }, - // SignatureTemplateNames: []*armcompute.UefiSignatureTemplateName{ - // to.Ptr(armcompute.UefiSignatureTemplateNameMicrosoftUefiCertificateAuthorityTemplate)}, - // }, - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // Source: &armcompute.GalleryDiskImageSource{ - // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), - // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), - // }, - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // Source: &armcompute.GalleryDiskImageSource{ - // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), - // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithVHD.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryImageVersionUsingVhdAsASource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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/myOtherDiskEncryptionSet"), - Lun: to.Ptr[int32](1), - }}, - OSDiskImage: &armcompute.OSDiskImageEncryption{ - DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](1), - }, - { - Name: to.Ptr("East US"), - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - BlockDeletionBeforeEndOfLife: to.Ptr(false), - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - DataDiskImages: []*armcompute.GalleryDataDiskImage{ - { - HostCaching: to.Ptr(armcompute.HostCachingNone), - Source: &armcompute.GalleryDiskImageSource{ - StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), - URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), - }, - Lun: to.Ptr[int32](1), - }}, - OSDiskImage: &armcompute.GalleryOSDiskImage{ - HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - Source: &armcompute.GalleryDiskImageSource{ - StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), - URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), - }, - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myOtherDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // Source: &armcompute.GalleryDiskImageSource{ - // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), - // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), - // }, - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // Source: &armcompute.GalleryDiskImageSource{ - // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), - // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithAdditionalReplicaSets.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryImageVersionWithDirectDriveReplicas() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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"), - AdditionalReplicaSets: []*armcompute.AdditionalReplicaSet{ - { - RegionalReplicaCount: to.Ptr[int32](1), - StorageAccountType: to.Ptr(armcompute.StorageAccountType("PreviumV2_LRS")), - }}, - 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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - 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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - Source: &armcompute.GalleryArtifactVersionFullSource{ - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // TargetRegions: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // AdditionalReplicaSets: []*armcompute.AdditionalReplicaSet{ - // { - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountType("PreviumV2_LRS")), - // }}, - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Create_WithTargetExtendedLocations.json -func ExampleGalleryImageVersionsClient_BeginCreateOrUpdate_createOrUpdateASimpleGalleryImageVersionWithTargetExtendedLocationsSpecified() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - 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"), - }, - }, - ExcludeFromLatest: to.Ptr(false), - RegionalReplicaCount: to.Ptr[int32](2), - StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - }}, - }, - SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - AllowDeletionOfReplicatedLocations: to.Ptr(false), - BlockDeletionBeforeEndOfLife: to.Ptr(false), - }, - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - Source: &armcompute.GalleryArtifactVersionFullSource{ - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // TargetExtendedLocations: []*armcompute.GalleryTargetExtendedLocation{ - // { - // Name: to.Ptr("West US"), - // Encryption: &armcompute.EncryptionImages{ - // DataDiskImages: []*armcompute.DataDiskImageEncryption{ - // { - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), - // Lun: to.Ptr[int32](0), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myWestUSDiskEncryptionSet"), - // }, - // }, - // ExtendedLocation: &armcompute.GalleryExtendedLocation{ - // Name: to.Ptr("microsoftlosangeles1"), - // Type: to.Ptr(armcompute.GalleryExtendedLocationTypeEdgeZone), - // }, - // ExtendedLocationReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.EdgeZoneStorageAccountType("StandardSSD_LRS(default)")), - // }, - // { - // Name: to.Ptr("East US"), - // Encryption: &armcompute.EncryptionImages{ - // DataDiskImages: []*armcompute.DataDiskImageEncryption{ - // { - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), - // Lun: to.Ptr[int32](0), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myEastUSDiskEncryptionSet"), - // }, - // }, - // ExtendedLocation: &armcompute.GalleryExtendedLocation{ - // Name: to.Ptr("microsoftnewyork1"), - // Type: to.Ptr(armcompute.GalleryExtendedLocationTypeEdgeZone), - // }, - // ExtendedLocationReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.EdgeZoneStorageAccountType("StandardSSD_LRS(default)")), - // }}, - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // 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"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Update_RestoreSoftDeleted.json -func ExampleGalleryImageVersionsClient_BeginUpdate_restoreASoftDeletedGalleryImageVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", armcompute.GalleryImageVersionUpdate{ - Properties: &armcompute.GalleryImageVersionProperties{ - Restore: to.Ptr(true), - StorageProfile: &armcompute.GalleryImageVersionStorageProfile{}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // TargetRegions: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Update.json -func ExampleGalleryImageVersionsClient_BeginUpdate_updateASimpleGalleryImageVersionManagedImageAsSource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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.GalleryArtifactVersionFullSource{ - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Update_WithoutSourceId.json -func ExampleGalleryImageVersionsClient_BeginUpdate_updateASimpleGalleryImageVersionWithoutSourceId() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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{}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardZRS), - // }}, - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithReplicationStatus.json -func ExampleGalleryImageVersionsClient_Get_getAGalleryImageVersionWithReplicationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryImageVersionsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myOtherDiskEncryptionSet"), - // Lun: to.Ptr[int32](0), - // }, - // { - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // }, - // ReplicationStatus: &armcompute.ReplicationStatus{ - // AggregatedState: to.Ptr(armcompute.AggregatedReplicationStateCompleted), - // Summary: []*armcompute.RegionalReplicationStatus{ - // { - // Progress: to.Ptr[int32](100), - // Region: to.Ptr("West US"), - // State: to.Ptr(armcompute.ReplicationStateCompleted), - // Details: to.Ptr(""), - // }, - // { - // Progress: to.Ptr[int32](100), - // Region: to.Ptr("East US"), - // State: to.Ptr(armcompute.ReplicationStateCompleted), - // Details: to.Ptr(""), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithSnapshotsAsSource.json -func ExampleGalleryImageVersionsClient_Get_getAGalleryImageVersionWithSnapshotsAsASource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Source: &armcompute.GalleryDiskImageSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{diskSnapshotName}"), - // }, - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // Source: &armcompute.GalleryDiskImageSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/snapshots/{snapshotName}"), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithValidationProfileAndReplicationStatus.json -func ExampleGalleryImageVersionsClient_Get_getAGalleryImageVersionWithValidationProfileAndReplicationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypes("ValidationProfile,ReplicationStatus"))}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myOtherDiskEncryptionSet"), - // Lun: to.Ptr[int32](0), - // }, - // { - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // }, - // ReplicationStatus: &armcompute.ReplicationStatus{ - // AggregatedState: to.Ptr(armcompute.AggregatedReplicationStateCompleted), - // Summary: []*armcompute.RegionalReplicationStatus{ - // { - // Progress: to.Ptr[int32](100), - // Region: to.Ptr("West US"), - // State: to.Ptr(armcompute.ReplicationStateCompleted), - // Details: to.Ptr(""), - // }, - // { - // Progress: to.Ptr[int32](100), - // Region: to.Ptr("East US"), - // State: to.Ptr(armcompute.ReplicationStateCompleted), - // Details: to.Ptr(""), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // ValidationsProfile: &armcompute.ValidationsProfile{ - // ExecutedValidations: []*armcompute.ExecutedValidation{ - // { - // Type: to.Ptr("LinuxSecurityBaseline"), - // ExecutionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // Status: to.Ptr(armcompute.ValidationStatusFailed), - // Version: to.Ptr("beta"), - // }, - // { - // Type: to.Ptr("AzCertify"), - // ExecutionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // Status: to.Ptr(armcompute.ValidationStatusSucceeded), - // Version: to.Ptr("10.0.4"), - // }}, - // PlatformAttributes: []*armcompute.PlatformAttribute{ - // { - // Name: to.Ptr("source_image_publisher"), - // Value: to.Ptr("publishValue"), - // }, - // { - // Name: to.Ptr("source_image_offer"), - // Value: to.Ptr("OfferValue"), - // }, - // { - // Name: to.Ptr("source_image_sku"), - // Value: to.Ptr("SkuValue"), - // }, - // { - // Name: to.Ptr("source_image_version"), - // Value: to.Ptr("1.0.0"), - // }}, - // ValidationEtag: to.Ptr("2018-01-01T00:00:00Z"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithValidationProfile.json -func ExampleGalleryImageVersionsClient_Get_getAGalleryImageVersionWithValidationProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: to.Ptr(armcompute.ReplicationStatusTypes("ValidationProfile"))}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myOtherDiskEncryptionSet"), - // Lun: to.Ptr[int32](0), - // }, - // { - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // ValidationsProfile: &armcompute.ValidationsProfile{ - // ExecutedValidations: []*armcompute.ExecutedValidation{ - // { - // Type: to.Ptr("LinuxSecurityBaseline"), - // ExecutionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // Status: to.Ptr(armcompute.ValidationStatusFailed), - // Version: to.Ptr("beta"), - // }, - // { - // Type: to.Ptr("AzCertify"), - // ExecutionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // Status: to.Ptr(armcompute.ValidationStatusSucceeded), - // Version: to.Ptr("10.0.4"), - // }}, - // PlatformAttributes: []*armcompute.PlatformAttribute{ - // { - // Name: to.Ptr("source_image_publisher"), - // Value: to.Ptr("publishValue"), - // }, - // { - // Name: to.Ptr("source_image_offer"), - // Value: to.Ptr("OfferValue"), - // }, - // { - // Name: to.Ptr("source_image_sku"), - // Value: to.Ptr("SkuValue"), - // }, - // { - // Name: to.Ptr("source_image_version"), - // Value: to.Ptr("1.0.0"), - // }}, - // ValidationEtag: to.Ptr("2018-01-01T00:00:00Z"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Get_WithVhdAsSource.json -func ExampleGalleryImageVersionsClient_Get_getAGalleryImageVersionWithVhdAsASource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // Source: &armcompute.GalleryDiskImageSource{ - // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), - // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), - // }, - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // Source: &armcompute.GalleryDiskImageSource{ - // StorageAccountID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/{storageAccount}"), - // URI: to.Ptr("https://gallerysourcencus.blob.core.windows.net/myvhds/Windows-Server-2012-R2-20171216-en.us-128GB.vhd"), - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Get.json -func ExampleGalleryImageVersionsClient_Get_getAGalleryImageVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryImageVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myGalleryImageName", "1.0.0", &armcompute.GalleryImageVersionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImageVersion = armcompute.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myOtherDiskEncryptionSet"), - // Lun: to.Ptr[int32](0), - // }, - // { - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_Delete.json -func ExampleGalleryImageVersionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImageVersionsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GalleryImageVersion_ListByGalleryImage.json -func ExampleGalleryImageVersionsClient_NewListByGalleryImagePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGalleryImageVersionsClient().NewListByGalleryImagePager("myResourceGroup", "myGalleryName", "myGalleryImageName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GalleryImageVersionList = armcompute.GalleryImageVersionList{ - // Value: []*armcompute.GalleryImageVersion{ - // { - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/locations/westus/Galleries/myGalleryName/Images/myGalleryImageName/Versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryImageVersionProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishingProfile: &armcompute.GalleryImageVersionPublishingProfile{ - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // 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/myOtherDiskEncryptionSet"), - // Lun: to.Ptr[int32](0), - // }, - // { - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.OSDiskImageEncryption{ - // DiskEncryptionSetID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSet/myDiskEncryptionSet"), - // }, - // }, - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](1), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }, - // { - // Name: to.Ptr("East US"), - // ExcludeFromLatest: to.Ptr(false), - // RegionalReplicaCount: to.Ptr[int32](2), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypeStandardLRS), - // }}, - // }, - // SafetyProfile: &armcompute.GalleryImageVersionSafetyProfile{ - // AllowDeletionOfReplicatedLocations: to.Ptr(false), - // BlockDeletionBeforeEndOfLife: to.Ptr(false), - // PolicyViolations: []*armcompute.PolicyViolation{ - // { - // Category: to.Ptr(armcompute.PolicyViolationCategoryImageFlaggedUnsafe), - // Details: to.Ptr("This is the policy violation details."), - // }}, - // ReportedForPolicyViolation: to.Ptr(true), - // }, - // StorageProfile: &armcompute.GalleryImageVersionStorageProfile{ - // DataDiskImages: []*armcompute.GalleryDataDiskImage{ - // { - // HostCaching: to.Ptr(armcompute.HostCachingNone), - // SizeInGB: to.Ptr[int32](10), - // Lun: to.Ptr[int32](1), - // }}, - // OSDiskImage: &armcompute.GalleryOSDiskImage{ - // HostCaching: to.Ptr(armcompute.HostCachingReadOnly), - // SizeInGB: to.Ptr[int32](10), - // }, - // Source: &armcompute.GalleryArtifactVersionFullSource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}"), - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofiles_client.go b/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofiles_client.go deleted file mode 100644 index 240719d97b0d..000000000000 --- a/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofiles_client.go +++ /dev/null @@ -1,435 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryInVMAccessControlProfilesClient contains the methods for the GalleryInVMAccessControlProfiles group. -// Don't use this type directly, use NewGalleryInVMAccessControlProfilesClient() instead. -type GalleryInVMAccessControlProfilesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleryInVMAccessControlProfilesClient creates a new instance of GalleryInVMAccessControlProfilesClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleryInVMAccessControlProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryInVMAccessControlProfilesClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleryInVMAccessControlProfilesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery inVMAccessControlProfile. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the InVMAccessControlProfile is to be created. -// - inVMAccessControlProfileName - The name of the gallery inVMAccessControlProfile to be created or updated. The allowed characters -// are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is -// 80 characters. -// - galleryInVMAccessControlProfile - Parameters supplied to the create or update gallery inVMAccessControlProfile operation. -// - options - GalleryInVMAccessControlProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryInVMAccessControlProfilesClient.BeginCreateOrUpdate -// method. -func (client *GalleryInVMAccessControlProfilesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, galleryInVMAccessControlProfile GalleryInVMAccessControlProfile, options *GalleryInVMAccessControlProfilesClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryInVMAccessControlProfilesClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryInVMAccessControlProfilesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryInVMAccessControlProfilesClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a gallery inVMAccessControlProfile. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -func (client *GalleryInVMAccessControlProfilesClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, galleryInVMAccessControlProfile GalleryInVMAccessControlProfile, options *GalleryInVMAccessControlProfilesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryInVMAccessControlProfilesClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryInVMAccessControlProfilesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, galleryInVMAccessControlProfile GalleryInVMAccessControlProfile, options *GalleryInVMAccessControlProfilesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if inVMAccessControlProfileName == "" { - return nil, errors.New("parameter inVMAccessControlProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileName}", url.PathEscape(inVMAccessControlProfileName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryInVMAccessControlProfile); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a gallery inVMAccessControlProfile. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - he name of the Shared Image Gallery in which the InVMAccessControlProfile resides. -// - inVMAccessControlProfileName - The name of the gallery inVMAccessControlProfile to be deleted. -// - options - GalleryInVMAccessControlProfilesClientBeginDeleteOptions contains the optional parameters for the GalleryInVMAccessControlProfilesClient.BeginDelete -// method. -func (client *GalleryInVMAccessControlProfilesClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, options *GalleryInVMAccessControlProfilesClientBeginDeleteOptions) (*runtime.Poller[GalleryInVMAccessControlProfilesClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryInVMAccessControlProfilesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryInVMAccessControlProfilesClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a gallery inVMAccessControlProfile. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -func (client *GalleryInVMAccessControlProfilesClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, options *GalleryInVMAccessControlProfilesClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleryInVMAccessControlProfilesClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryInVMAccessControlProfilesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, options *GalleryInVMAccessControlProfilesClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if inVMAccessControlProfileName == "" { - return nil, errors.New("parameter inVMAccessControlProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileName}", url.PathEscape(inVMAccessControlProfileName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery inVMAccessControlProfile. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery from which the InVMAccessControlProfiles are to be retrieved. -// - inVMAccessControlProfileName - The name of the gallery inVMAccessControlProfile to be retrieved. -// - options - GalleryInVMAccessControlProfilesClientGetOptions contains the optional parameters for the GalleryInVMAccessControlProfilesClient.Get -// method. -func (client *GalleryInVMAccessControlProfilesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, options *GalleryInVMAccessControlProfilesClientGetOptions) (GalleryInVMAccessControlProfilesClientGetResponse, error) { - var err error - const operationName = "GalleryInVMAccessControlProfilesClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, options) - if err != nil { - return GalleryInVMAccessControlProfilesClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleryInVMAccessControlProfilesClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleryInVMAccessControlProfilesClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleryInVMAccessControlProfilesClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, options *GalleryInVMAccessControlProfilesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if inVMAccessControlProfileName == "" { - return nil, errors.New("parameter inVMAccessControlProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileName}", url.PathEscape(inVMAccessControlProfileName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryInVMAccessControlProfilesClient) getHandleResponse(resp *http.Response) (GalleryInVMAccessControlProfilesClientGetResponse, error) { - result := GalleryInVMAccessControlProfilesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryInVMAccessControlProfile); err != nil { - return GalleryInVMAccessControlProfilesClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryPager - List gallery inVMAccessControlProfiles in a gallery. -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery from which the InVMAccessControlProfiles are to be listed. -// - options - GalleryInVMAccessControlProfilesClientListByGalleryOptions contains the optional parameters for the GalleryInVMAccessControlProfilesClient.NewListByGalleryPager -// method. -func (client *GalleryInVMAccessControlProfilesClient) NewListByGalleryPager(resourceGroupName string, galleryName string, options *GalleryInVMAccessControlProfilesClientListByGalleryOptions) *runtime.Pager[GalleryInVMAccessControlProfilesClientListByGalleryResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryInVMAccessControlProfilesClientListByGalleryResponse]{ - More: func(page GalleryInVMAccessControlProfilesClientListByGalleryResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryInVMAccessControlProfilesClientListByGalleryResponse) (GalleryInVMAccessControlProfilesClientListByGalleryResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryInVMAccessControlProfilesClient.NewListByGalleryPager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByGalleryCreateRequest(ctx, resourceGroupName, galleryName, options) - }, nil) - if err != nil { - return GalleryInVMAccessControlProfilesClientListByGalleryResponse{}, err - } - return client.listByGalleryHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByGalleryCreateRequest creates the ListByGallery request. -func (client *GalleryInVMAccessControlProfilesClient) listByGalleryCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, options *GalleryInVMAccessControlProfilesClientListByGalleryOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryHandleResponse handles the ListByGallery response. -func (client *GalleryInVMAccessControlProfilesClient) listByGalleryHandleResponse(resp *http.Response) (GalleryInVMAccessControlProfilesClientListByGalleryResponse, error) { - result := GalleryInVMAccessControlProfilesClientListByGalleryResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryInVMAccessControlProfileList); err != nil { - return GalleryInVMAccessControlProfilesClientListByGalleryResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery inVMAccessControlProfile. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the InVMAccessControlProfile is to be updated. -// - inVMAccessControlProfileName - The name of the gallery inVMAccessControlProfile to be updated. The allowed characters are -// alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// - galleryInVMAccessControlProfile - Parameters supplied to the update gallery inVMAccessControlProfile operation. -// - options - GalleryInVMAccessControlProfilesClientBeginUpdateOptions contains the optional parameters for the GalleryInVMAccessControlProfilesClient.BeginUpdate -// method. -func (client *GalleryInVMAccessControlProfilesClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, galleryInVMAccessControlProfile GalleryInVMAccessControlProfileUpdate, options *GalleryInVMAccessControlProfilesClientBeginUpdateOptions) (*runtime.Poller[GalleryInVMAccessControlProfilesClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryInVMAccessControlProfilesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryInVMAccessControlProfilesClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a gallery inVMAccessControlProfile. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -func (client *GalleryInVMAccessControlProfilesClient) update(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, galleryInVMAccessControlProfile GalleryInVMAccessControlProfileUpdate, options *GalleryInVMAccessControlProfilesClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryInVMAccessControlProfilesClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, galleryInVMAccessControlProfile, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryInVMAccessControlProfilesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, galleryInVMAccessControlProfile GalleryInVMAccessControlProfileUpdate, options *GalleryInVMAccessControlProfilesClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if inVMAccessControlProfileName == "" { - return nil, errors.New("parameter inVMAccessControlProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileName}", url.PathEscape(inVMAccessControlProfileName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryInVMAccessControlProfile); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofiles_client_example_test.go b/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofiles_client_example_test.go deleted file mode 100644 index 310b0c6faeba..000000000000 --- a/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofiles_client_example_test.go +++ /dev/null @@ -1,187 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Create.json -func ExampleGalleryInVMAccessControlProfilesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryInVMAccessControlProfilesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myInVMAccessControlProfileName", armcompute.GalleryInVMAccessControlProfile{ - Location: to.Ptr("West US"), - Properties: &armcompute.GalleryInVMAccessControlProfileProperties{ - ApplicableHostEndpoint: to.Ptr(armcompute.EndpointTypesWireServer), - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryInVMAccessControlProfile = armcompute.GalleryInVMAccessControlProfile{ - // Name: to.Ptr("myInVMAccessControlProfileName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/inVMAccessControlProfiles/myInVMAccessControlProfileName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryInVMAccessControlProfileProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // ApplicableHostEndpoint: to.Ptr(armcompute.EndpointTypesWireServer), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Update.json -func ExampleGalleryInVMAccessControlProfilesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryInVMAccessControlProfilesClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myInVMAccessControlProfileName", armcompute.GalleryInVMAccessControlProfileUpdate{ - Properties: &armcompute.GalleryInVMAccessControlProfileProperties{ - ApplicableHostEndpoint: to.Ptr(armcompute.EndpointTypesWireServer), - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryInVMAccessControlProfile = armcompute.GalleryInVMAccessControlProfile{ - // Name: to.Ptr("myInVMAccessControlProfileName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/inVMAccessControlProfiles/myInVMAccessControlProfileName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryInVMAccessControlProfileProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // ApplicableHostEndpoint: to.Ptr(armcompute.EndpointTypesWireServer), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Get.json -func ExampleGalleryInVMAccessControlProfilesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryInVMAccessControlProfilesClient().Get(ctx, "myResourceGroup", "myGalleryName", "myInVMAccessControlProfileName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryInVMAccessControlProfile = armcompute.GalleryInVMAccessControlProfile{ - // Name: to.Ptr("myInVMAccessControlProfileName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/inVMAccessControlProfiles/myInVMAccessControlProfileName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryInVMAccessControlProfileProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // ApplicableHostEndpoint: to.Ptr(armcompute.EndpointTypesWireServer), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_Delete.json -func ExampleGalleryInVMAccessControlProfilesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryInVMAccessControlProfilesClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myInVMAccessControlProfileName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfile_ListByGallery.json -func ExampleGalleryInVMAccessControlProfilesClient_NewListByGalleryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGalleryInVMAccessControlProfilesClient().NewListByGalleryPager("myResourceGroup", "myGalleryName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GalleryInVMAccessControlProfileList = armcompute.GalleryInVMAccessControlProfileList{ - // Value: []*armcompute.GalleryInVMAccessControlProfile{ - // { - // Name: to.Ptr("myInVMAccessControlProfileName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/inVMAccessControlProfiles/myInVMAccessControlProfileName"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryInVMAccessControlProfileProperties{ - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // ApplicableHostEndpoint: to.Ptr(armcompute.EndpointTypesWireServer), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofileversions_client.go b/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofileversions_client.go deleted file mode 100644 index ae9c06064234..000000000000 --- a/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofileversions_client.go +++ /dev/null @@ -1,466 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GalleryInVMAccessControlProfileVersionsClient contains the methods for the GalleryInVMAccessControlProfileVersions group. -// Don't use this type directly, use NewGalleryInVMAccessControlProfileVersionsClient() instead. -type GalleryInVMAccessControlProfileVersionsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGalleryInVMAccessControlProfileVersionsClient creates a new instance of GalleryInVMAccessControlProfileVersionsClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGalleryInVMAccessControlProfileVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GalleryInVMAccessControlProfileVersionsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GalleryInVMAccessControlProfileVersionsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginCreateOrUpdate - Create or update a gallery inVMAccessControlProfile version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the inVMAccessControlProfile resides. -// - inVMAccessControlProfileName - The name of the gallery inVMAccessControlProfile in which the inVMAccessControlProfile version -// is to be created. -// - inVMAccessControlProfileVersionName - The name of the gallery inVMAccessControlProfile version to be created. Needs to -// follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a -// 32-bit integer. Format: .. -// - galleryInVMAccessControlProfileVersion - Parameters supplied to the create or update gallery inVMAccessControlProfile version -// operation. -// - options - GalleryInVMAccessControlProfileVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for -// the GalleryInVMAccessControlProfileVersionsClient.BeginCreateOrUpdate method. -func (client *GalleryInVMAccessControlProfileVersionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, galleryInVMAccessControlProfileVersion GalleryInVMAccessControlProfileVersion, options *GalleryInVMAccessControlProfileVersionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GalleryInVMAccessControlProfileVersionsClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryInVMAccessControlProfileVersionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryInVMAccessControlProfileVersionsClientCreateOrUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// CreateOrUpdate - Create or update a gallery inVMAccessControlProfile version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -func (client *GalleryInVMAccessControlProfileVersionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, galleryInVMAccessControlProfileVersion GalleryInVMAccessControlProfileVersion, options *GalleryInVMAccessControlProfileVersionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryInVMAccessControlProfileVersionsClient.BeginCreateOrUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GalleryInVMAccessControlProfileVersionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, galleryInVMAccessControlProfileVersion GalleryInVMAccessControlProfileVersion, options *GalleryInVMAccessControlProfileVersionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if inVMAccessControlProfileName == "" { - return nil, errors.New("parameter inVMAccessControlProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileName}", url.PathEscape(inVMAccessControlProfileName)) - if inVMAccessControlProfileVersionName == "" { - return nil, errors.New("parameter inVMAccessControlProfileVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileVersionName}", url.PathEscape(inVMAccessControlProfileVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryInVMAccessControlProfileVersion); err != nil { - return nil, err - } - return req, nil -} - -// BeginDelete - Delete a gallery inVMAccessControlProfile version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the inVMAccessControlProfile resides. -// - inVMAccessControlProfileName - The name of the gallery inVMAccessControlProfile in which the inVMAccessControlProfile version -// resides. -// - inVMAccessControlProfileVersionName - The name of the gallery inVMAccessControlProfile version to be deleted. -// - options - GalleryInVMAccessControlProfileVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryInVMAccessControlProfileVersionsClient.BeginDelete -// method. -func (client *GalleryInVMAccessControlProfileVersionsClient) BeginDelete(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, options *GalleryInVMAccessControlProfileVersionsClientBeginDeleteOptions) (*runtime.Poller[GalleryInVMAccessControlProfileVersionsClientDeleteResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.deleteOperation(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryInVMAccessControlProfileVersionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryInVMAccessControlProfileVersionsClientDeleteResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Delete - Delete a gallery inVMAccessControlProfile version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -func (client *GalleryInVMAccessControlProfileVersionsClient) deleteOperation(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, options *GalleryInVMAccessControlProfileVersionsClientBeginDeleteOptions) (*http.Response, error) { - var err error - const operationName = "GalleryInVMAccessControlProfileVersionsClient.BeginDelete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *GalleryInVMAccessControlProfileVersionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, options *GalleryInVMAccessControlProfileVersionsClientBeginDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if inVMAccessControlProfileName == "" { - return nil, errors.New("parameter inVMAccessControlProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileName}", url.PathEscape(inVMAccessControlProfileName)) - if inVMAccessControlProfileVersionName == "" { - return nil, errors.New("parameter inVMAccessControlProfileVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileVersionName}", url.PathEscape(inVMAccessControlProfileVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Retrieves information about a gallery inVMAccessControlProfile version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the inVMAccessControlProfile resides. -// - inVMAccessControlProfileName - The name of the gallery inVMAccessControlProfile in which the inVMAccessControlProfile version -// resides. -// - inVMAccessControlProfileVersionName - The name of the gallery inVMAccessControlProfile version to be retrieved. -// - options - GalleryInVMAccessControlProfileVersionsClientGetOptions contains the optional parameters for the GalleryInVMAccessControlProfileVersionsClient.Get -// method. -func (client *GalleryInVMAccessControlProfileVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, options *GalleryInVMAccessControlProfileVersionsClientGetOptions) (GalleryInVMAccessControlProfileVersionsClientGetResponse, error) { - var err error - const operationName = "GalleryInVMAccessControlProfileVersionsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, options) - if err != nil { - return GalleryInVMAccessControlProfileVersionsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GalleryInVMAccessControlProfileVersionsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return GalleryInVMAccessControlProfileVersionsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *GalleryInVMAccessControlProfileVersionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, options *GalleryInVMAccessControlProfileVersionsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if inVMAccessControlProfileName == "" { - return nil, errors.New("parameter inVMAccessControlProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileName}", url.PathEscape(inVMAccessControlProfileName)) - if inVMAccessControlProfileVersionName == "" { - return nil, errors.New("parameter inVMAccessControlProfileVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileVersionName}", url.PathEscape(inVMAccessControlProfileVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *GalleryInVMAccessControlProfileVersionsClient) getHandleResponse(resp *http.Response) (GalleryInVMAccessControlProfileVersionsClientGetResponse, error) { - result := GalleryInVMAccessControlProfileVersionsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryInVMAccessControlProfileVersion); err != nil { - return GalleryInVMAccessControlProfileVersionsClientGetResponse{}, err - } - return result, nil -} - -// NewListByGalleryInVMAccessControlProfilePager - List gallery inVMAccessControlProfile versions in a gallery inVMAccessControlProfile -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the inVMAccessControlProfile resides. -// - inVMAccessControlProfileName - The name of the gallery inVMAccessControlProfile from which the inVMAccessControlProfile -// versions are to be listed. -// - options - GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileOptions contains the optional -// parameters for the GalleryInVMAccessControlProfileVersionsClient.NewListByGalleryInVMAccessControlProfilePager method. -func (client *GalleryInVMAccessControlProfileVersionsClient) NewListByGalleryInVMAccessControlProfilePager(resourceGroupName string, galleryName string, inVMAccessControlProfileName string, options *GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileOptions) *runtime.Pager[GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse] { - return runtime.NewPager(runtime.PagingHandler[GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse]{ - More: func(page GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse) (GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "GalleryInVMAccessControlProfileVersionsClient.NewListByGalleryInVMAccessControlProfilePager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByGalleryInVMAccessControlProfileCreateRequest(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, options) - }, nil) - if err != nil { - return GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse{}, err - } - return client.listByGalleryInVMAccessControlProfileHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByGalleryInVMAccessControlProfileCreateRequest creates the ListByGalleryInVMAccessControlProfile request. -func (client *GalleryInVMAccessControlProfileVersionsClient) listByGalleryInVMAccessControlProfileCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, options *GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if inVMAccessControlProfileName == "" { - return nil, errors.New("parameter inVMAccessControlProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileName}", url.PathEscape(inVMAccessControlProfileName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByGalleryInVMAccessControlProfileHandleResponse handles the ListByGalleryInVMAccessControlProfile response. -func (client *GalleryInVMAccessControlProfileVersionsClient) listByGalleryInVMAccessControlProfileHandleResponse(resp *http.Response) (GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse, error) { - result := GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GalleryInVMAccessControlProfileVersionList); err != nil { - return GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse{}, err - } - return result, nil -} - -// BeginUpdate - Update a gallery inVMAccessControlProfile version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Shared Image Gallery in which the inVMAccessControlProfile resides. -// - inVMAccessControlProfileName - The name of the gallery inVMAccessControlProfile in which the inVMAccessControlProfile version -// is to be updated. -// - inVMAccessControlProfileVersionName - The name of the gallery inVMAccessControlProfile version to be updated. Needs to -// follow semantic version name pattern: The allowed characters are digit and period. Digits must be within the range of a -// 32-bit integer. Format: .. -// - galleryInVMAccessControlProfileVersion - Parameters supplied to the update gallery inVMAccessControlProfile version operation. -// - options - GalleryInVMAccessControlProfileVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryInVMAccessControlProfileVersionsClient.BeginUpdate -// method. -func (client *GalleryInVMAccessControlProfileVersionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, galleryInVMAccessControlProfileVersion GalleryInVMAccessControlProfileVersionUpdate, options *GalleryInVMAccessControlProfileVersionsClientBeginUpdateOptions) (*runtime.Poller[GalleryInVMAccessControlProfileVersionsClientUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GalleryInVMAccessControlProfileVersionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[GalleryInVMAccessControlProfileVersionsClientUpdateResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Update - Update a gallery inVMAccessControlProfile version. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2024-03-03 -func (client *GalleryInVMAccessControlProfileVersionsClient) update(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, galleryInVMAccessControlProfileVersion GalleryInVMAccessControlProfileVersionUpdate, options *GalleryInVMAccessControlProfileVersionsClientBeginUpdateOptions) (*http.Response, error) { - var err error - const operationName = "GalleryInVMAccessControlProfileVersionsClient.BeginUpdate" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.updateCreateRequest(ctx, resourceGroupName, galleryName, inVMAccessControlProfileName, inVMAccessControlProfileVersionName, galleryInVMAccessControlProfileVersion, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// updateCreateRequest creates the Update request. -func (client *GalleryInVMAccessControlProfileVersionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, inVMAccessControlProfileName string, inVMAccessControlProfileVersionName string, galleryInVMAccessControlProfileVersion GalleryInVMAccessControlProfileVersionUpdate, options *GalleryInVMAccessControlProfileVersionsClientBeginUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/inVMAccessControlProfiles/{inVMAccessControlProfileName}/versions/{inVMAccessControlProfileVersionName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if inVMAccessControlProfileName == "" { - return nil, errors.New("parameter inVMAccessControlProfileName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileName}", url.PathEscape(inVMAccessControlProfileName)) - if inVMAccessControlProfileVersionName == "" { - return nil, errors.New("parameter inVMAccessControlProfileVersionName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{inVMAccessControlProfileVersionName}", url.PathEscape(inVMAccessControlProfileVersionName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, galleryInVMAccessControlProfileVersion); err != nil { - return nil, err - } - return req, nil -} diff --git a/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofileversions_client_example_test.go b/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofileversions_client_example_test.go deleted file mode 100644 index c62ab6557105..000000000000 --- a/sdk/resourcemanager/compute/armcompute/galleryinvmaccesscontrolprofileversions_client_example_test.go +++ /dev/null @@ -1,401 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Create.json -func ExampleGalleryInVMAccessControlProfileVersionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryInVMAccessControlProfileVersionsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myGalleryName", "myInVMAccessControlProfileName", "1.0.0", armcompute.GalleryInVMAccessControlProfileVersion{ - Location: to.Ptr("West US"), - Properties: &armcompute.GalleryInVMAccessControlProfileVersionProperties{ - ExcludeFromLatest: to.Ptr(false), - TargetLocations: []*armcompute.TargetRegion{ - { - Name: to.Ptr("West US"), - }, - { - Name: to.Ptr("South Central US"), - }}, - DefaultAccess: to.Ptr(armcompute.EndpointAccessAllow), - Mode: to.Ptr(armcompute.AccessControlRulesModeAudit), - Rules: &armcompute.AccessControlRules{ - Identities: []*armcompute.AccessControlRulesIdentity{ - { - Name: to.Ptr("WinPA"), - ExePath: to.Ptr("C:\\Windows\\System32\\cscript.exe"), - GroupName: to.Ptr("Administrators"), - ProcessName: to.Ptr("cscript"), - UserName: to.Ptr("SYSTEM"), - }}, - Privileges: []*armcompute.AccessControlRulesPrivilege{ - { - Name: to.Ptr("GoalState"), - Path: to.Ptr("/machine"), - QueryParameters: map[string]*string{ - "comp": to.Ptr("goalstate"), - }, - }}, - RoleAssignments: []*armcompute.AccessControlRulesRoleAssignment{ - { - Identities: []*string{ - to.Ptr("WinPA")}, - Role: to.Ptr("Provisioning"), - }}, - Roles: []*armcompute.AccessControlRulesRole{ - { - Name: to.Ptr("Provisioning"), - Privileges: []*string{ - to.Ptr("GoalState")}, - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryInVMAccessControlProfileVersion = armcompute.GalleryInVMAccessControlProfileVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/inVMAccessControlProfiles/myInVMAccessControlProfileName/versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryInVMAccessControlProfileVersionProperties{ - // ExcludeFromLatest: to.Ptr(false), - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), - // TargetLocations: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // }, - // { - // Name: to.Ptr("South Central US"), - // }}, - // DefaultAccess: to.Ptr(armcompute.EndpointAccessAllow), - // Mode: to.Ptr(armcompute.AccessControlRulesModeAudit), - // Rules: &armcompute.AccessControlRules{ - // Identities: []*armcompute.AccessControlRulesIdentity{ - // { - // Name: to.Ptr("WinPA"), - // ExePath: to.Ptr("C:\\Windows\\System32\\cscript.exe"), - // GroupName: to.Ptr("Administrators"), - // ProcessName: to.Ptr("cscript"), - // UserName: to.Ptr("SYSTEM"), - // }}, - // Privileges: []*armcompute.AccessControlRulesPrivilege{ - // { - // Name: to.Ptr("GoalState"), - // Path: to.Ptr("/machine"), - // QueryParameters: map[string]*string{ - // "comp": to.Ptr("goalstate"), - // }, - // }}, - // RoleAssignments: []*armcompute.AccessControlRulesRoleAssignment{ - // { - // Identities: []*string{ - // to.Ptr("WinPA")}, - // Role: to.Ptr("Provisioning"), - // }}, - // Roles: []*armcompute.AccessControlRulesRole{ - // { - // Name: to.Ptr("Provisioning"), - // Privileges: []*string{ - // to.Ptr("GoalState")}, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Update.json -func ExampleGalleryInVMAccessControlProfileVersionsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryInVMAccessControlProfileVersionsClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", "myInVMAccessControlProfileName", "1.0.0", armcompute.GalleryInVMAccessControlProfileVersionUpdate{ - Properties: &armcompute.GalleryInVMAccessControlProfileVersionProperties{ - ExcludeFromLatest: to.Ptr(false), - TargetLocations: []*armcompute.TargetRegion{ - { - Name: to.Ptr("West US"), - }, - { - Name: to.Ptr("South Central US"), - }, - { - Name: to.Ptr("East US"), - }}, - DefaultAccess: to.Ptr(armcompute.EndpointAccessAllow), - Mode: to.Ptr(armcompute.AccessControlRulesModeAudit), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryInVMAccessControlProfileVersion = armcompute.GalleryInVMAccessControlProfileVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/inVMAccessControlProfiles/myInVMAccessControlProfileName/versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryInVMAccessControlProfileVersionProperties{ - // ExcludeFromLatest: to.Ptr(false), - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), - // TargetLocations: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // }, - // { - // Name: to.Ptr("South Central US"), - // }, - // { - // Name: to.Ptr("East US"), - // }}, - // DefaultAccess: to.Ptr(armcompute.EndpointAccessAllow), - // Mode: to.Ptr(armcompute.AccessControlRulesModeAudit), - // Rules: &armcompute.AccessControlRules{ - // Identities: []*armcompute.AccessControlRulesIdentity{ - // { - // Name: to.Ptr("WinPA"), - // ExePath: to.Ptr("C:\\Windows\\System32\\cscript.exe"), - // GroupName: to.Ptr("Administrators"), - // ProcessName: to.Ptr("cscript"), - // UserName: to.Ptr("SYSTEM"), - // }}, - // Privileges: []*armcompute.AccessControlRulesPrivilege{ - // { - // Name: to.Ptr("GoalState"), - // Path: to.Ptr("/machine"), - // QueryParameters: map[string]*string{ - // "comp": to.Ptr("goalstate"), - // }, - // }}, - // RoleAssignments: []*armcompute.AccessControlRulesRoleAssignment{ - // { - // Identities: []*string{ - // to.Ptr("WinPA")}, - // Role: to.Ptr("Provisioning"), - // }}, - // Roles: []*armcompute.AccessControlRulesRole{ - // { - // Name: to.Ptr("Provisioning"), - // Privileges: []*string{ - // to.Ptr("GoalState")}, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Get.json -func ExampleGalleryInVMAccessControlProfileVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryInVMAccessControlProfileVersionsClient().Get(ctx, "myResourceGroup", "myGalleryName", "myInVMAccessControlProfileName", "1.0.0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryInVMAccessControlProfileVersion = armcompute.GalleryInVMAccessControlProfileVersion{ - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/inVMAccessControlProfiles/myInVMAccessControlProfileName/versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryInVMAccessControlProfileVersionProperties{ - // ExcludeFromLatest: to.Ptr(false), - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), - // TargetLocations: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // }, - // { - // Name: to.Ptr("South Central US"), - // }, - // { - // Name: to.Ptr("East US"), - // }}, - // DefaultAccess: to.Ptr(armcompute.EndpointAccessAllow), - // Mode: to.Ptr(armcompute.AccessControlRulesModeAudit), - // Rules: &armcompute.AccessControlRules{ - // Identities: []*armcompute.AccessControlRulesIdentity{ - // { - // Name: to.Ptr("WinPA"), - // ExePath: to.Ptr("C:\\Windows\\System32\\cscript.exe"), - // GroupName: to.Ptr("Administrators"), - // ProcessName: to.Ptr("cscript"), - // UserName: to.Ptr("SYSTEM"), - // }}, - // Privileges: []*armcompute.AccessControlRulesPrivilege{ - // { - // Name: to.Ptr("GoalState"), - // Path: to.Ptr("/machine"), - // QueryParameters: map[string]*string{ - // "comp": to.Ptr("goalstate"), - // }, - // }}, - // RoleAssignments: []*armcompute.AccessControlRulesRoleAssignment{ - // { - // Identities: []*string{ - // to.Ptr("WinPA")}, - // Role: to.Ptr("Provisioning"), - // }}, - // Roles: []*armcompute.AccessControlRulesRole{ - // { - // Name: to.Ptr("Provisioning"), - // Privileges: []*string{ - // to.Ptr("GoalState")}, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_Delete.json -func ExampleGalleryInVMAccessControlProfileVersionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryInVMAccessControlProfileVersionsClient().BeginDelete(ctx, "myResourceGroup", "myGalleryName", "myInVMAccessControlProfileName", "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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryResourceProfileExamples/GalleryInVMAccessControlProfileVersion_ListByGalleryInVMAccessControlProfile.json -func ExampleGalleryInVMAccessControlProfileVersionsClient_NewListByGalleryInVMAccessControlProfilePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGalleryInVMAccessControlProfileVersionsClient().NewListByGalleryInVMAccessControlProfilePager("myResourceGroup", "myGalleryName", "myInVMAccessControlProfileName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GalleryInVMAccessControlProfileVersionList = armcompute.GalleryInVMAccessControlProfileVersionList{ - // Value: []*armcompute.GalleryInVMAccessControlProfileVersion{ - // { - // Name: to.Ptr("1.0.0"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGallery/inVMAccessControlProfiles/myInVMAccessControlProfileName/versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GalleryInVMAccessControlProfileVersionProperties{ - // ExcludeFromLatest: to.Ptr(false), - // ProvisioningState: to.Ptr(armcompute.GalleryProvisioningStateSucceeded), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), - // TargetLocations: []*armcompute.TargetRegion{ - // { - // Name: to.Ptr("West US"), - // }, - // { - // Name: to.Ptr("South Central US"), - // }, - // { - // Name: to.Ptr("East US"), - // }}, - // DefaultAccess: to.Ptr(armcompute.EndpointAccessAllow), - // Mode: to.Ptr(armcompute.AccessControlRulesModeAudit), - // Rules: &armcompute.AccessControlRules{ - // Identities: []*armcompute.AccessControlRulesIdentity{ - // { - // Name: to.Ptr("WinPA"), - // ExePath: to.Ptr("C:\\Windows\\System32\\cscript.exe"), - // GroupName: to.Ptr("Administrators"), - // ProcessName: to.Ptr("cscript"), - // UserName: to.Ptr("SYSTEM"), - // }}, - // Privileges: []*armcompute.AccessControlRulesPrivilege{ - // { - // Name: to.Ptr("GoalState"), - // Path: to.Ptr("/machine"), - // QueryParameters: map[string]*string{ - // "comp": to.Ptr("goalstate"), - // }, - // }}, - // RoleAssignments: []*armcompute.AccessControlRulesRoleAssignment{ - // { - // Identities: []*string{ - // to.Ptr("WinPA")}, - // Role: to.Ptr("Provisioning"), - // }}, - // Roles: []*armcompute.AccessControlRulesRole{ - // { - // Name: to.Ptr("Provisioning"), - // Privileges: []*string{ - // to.Ptr("GoalState")}, - // }}, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/gallerysharingprofile_client.go b/sdk/resourcemanager/compute/armcompute/gallerysharingprofile_client.go index 8b0925b1dd18..0ccc5ce9fd60 100644 --- a/sdk/resourcemanager/compute/armcompute/gallerysharingprofile_client.go +++ b/sdk/resourcemanager/compute/armcompute/gallerysharingprofile_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -73,7 +73,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 2024-03-03 +// Generated from API version 2023-07-03 func (client *GallerySharingProfileClient) update(ctx context.Context, resourceGroupName string, galleryName string, sharingUpdate SharingUpdate, options *GallerySharingProfileClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "GallerySharingProfileClient.BeginUpdate" @@ -115,7 +115,7 @@ func (client *GallerySharingProfileClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, sharingUpdate); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/gallerysharingprofile_client_example_test.go b/sdk/resourcemanager/compute/armcompute/gallerysharingprofile_client_example_test.go deleted file mode 100644 index 3a6e83c4dc57..000000000000 --- a/sdk/resourcemanager/compute/armcompute/gallerysharingprofile_client_example_test.go +++ /dev/null @@ -1,130 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_AddToSharingProfile.json -func ExampleGallerySharingProfileClient_BeginUpdate_addSharingIdToTheSharingProfileOfAGallery() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGallerySharingProfileClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharingUpdate = 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), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_ResetSharingProfile.json -func ExampleGallerySharingProfileClient_BeginUpdate_resetSharingProfileOfAGallery() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGallerySharingProfileClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.SharingUpdate{ - OperationType: to.Ptr(armcompute.SharingUpdateOperationTypesReset), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharingUpdate = armcompute.SharingUpdate{ - // OperationType: to.Ptr(armcompute.SharingUpdateOperationTypesReset), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/Gallery_EnableCommunityGallery.json -func ExampleGallerySharingProfileClient_BeginUpdate_shareAGalleryToCommunity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGallerySharingProfileClient().BeginUpdate(ctx, "myResourceGroup", "myGalleryName", armcompute.SharingUpdate{ - OperationType: to.Ptr(armcompute.SharingUpdateOperationTypesEnableCommunity), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharingUpdate = armcompute.SharingUpdate{ - // OperationType: to.Ptr(armcompute.SharingUpdateOperationTypesEnableCommunity), - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/go.mod b/sdk/resourcemanager/compute/armcompute/go.mod index 6c1ec1bd1d67..49448e013a5a 100644 --- a/sdk/resourcemanager/compute/armcompute/go.mod +++ b/sdk/resourcemanager/compute/armcompute/go.mod @@ -1,10 +1,9 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7 go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/sdk/resourcemanager/compute/armcompute/images_client.go b/sdk/resourcemanager/compute/armcompute/images_client.go index 193bbd4993ac..d9a45ca67d1d 100644 --- a/sdk/resourcemanager/compute/armcompute/images_client.go +++ b/sdk/resourcemanager/compute/armcompute/images_client.go @@ -47,7 +47,7 @@ func NewImagesClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Create or update an image. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - imageName - The name of the image. // - parameters - Parameters supplied to the Create Image operation. @@ -73,7 +73,7 @@ func (client *ImagesClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Create or update an image. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *ImagesClient) createOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image, options *ImagesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ImagesClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *ImagesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -127,7 +127,7 @@ func (client *ImagesClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Deletes an Image. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - imageName - The name of the image. // - options - ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method. @@ -151,7 +151,7 @@ func (client *ImagesClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deletes an Image. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *ImagesClient) deleteOperation(ctx context.Context, resourceGroupName string, imageName string, options *ImagesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "ImagesClient.BeginDelete" @@ -193,7 +193,7 @@ func (client *ImagesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *ImagesClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets an image. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - imageName - The name of the image. // - options - ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method. @@ -251,7 +251,7 @@ func (client *ImagesClient) getCreateRequest(ctx context.Context, resourceGroupN if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *ImagesClient) getHandleResponse(resp *http.Response) (ImagesClient // NewListPager - Gets the list of Images in the subscription. Use nextLink property in the response to get the next page // of Images. Do this till nextLink is null to fetch all the Images. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - options - ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method. func (client *ImagesClient) NewListPager(options *ImagesClientListOptions) *runtime.Pager[ImagesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ImagesClientListResponse]{ @@ -306,7 +306,7 @@ func (client *ImagesClient) listCreateRequest(ctx context.Context, options *Imag return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *ImagesClient) listHandleResponse(resp *http.Response) (ImagesClien // NewListByResourceGroupPager - Gets the list of images under a resource group. Use nextLink property in the response to // get the next page of Images. Do this till nextLink is null to fetch all the Images. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - options - ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager // method. @@ -367,7 +367,7 @@ func (client *ImagesClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,7 @@ func (client *ImagesClient) listByResourceGroupHandleResponse(resp *http.Respons // BeginUpdate - Update an image. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - imageName - The name of the image. // - parameters - Parameters supplied to the Update Image operation. @@ -410,7 +410,7 @@ func (client *ImagesClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Update an image. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *ImagesClient) update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate, options *ImagesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "ImagesClient.BeginUpdate" @@ -452,7 +452,7 @@ func (client *ImagesClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/images_client_example_test.go b/sdk/resourcemanager/compute/armcompute/images_client_example_test.go deleted file mode 100644 index d64c08f94f6f..000000000000 --- a/sdk/resourcemanager/compute/armcompute/images_client_example_test.go +++ /dev/null @@ -1,946 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromABlobWithDiskEncryptionSet.json -func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromABlobWithDiskEncryptionSetResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // }, - // OSDisk: &armcompute.ImageOSDisk{ - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // 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), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromABlob.json -func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromABlob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().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"), - OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - }, - ZoneResilient: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // }, - // OSDisk: &armcompute.ImageOSDisk{ - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // ZoneResilient: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromAManagedDiskWithDiskEncryptionSet.json -func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromAManagedDiskWithDiskEncryptionSetResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ - Location: to.Ptr("West US"), - Properties: &armcompute.ImageProperties{ - StorageProfile: &armcompute.ImageStorageProfile{ - OSDisk: &armcompute.ImageOSDisk{ - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - Snapshot: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // }, - // OSDisk: &armcompute.ImageOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // }, - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromAManagedDisk.json -func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromAManagedDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ - Location: to.Ptr("West US"), - Properties: &armcompute.ImageProperties{ - StorageProfile: &armcompute.ImageStorageProfile{ - OSDisk: &armcompute.ImageOSDisk{ - ManagedDisk: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - }, - OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - }, - ZoneResilient: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // }, - // OSDisk: &armcompute.ImageOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - // }, - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // ZoneResilient: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromASnapshotWithDiskEncryptionSet.json -func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromASnapshotWithDiskEncryptionSetResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ - Location: to.Ptr("West US"), - Properties: &armcompute.ImageProperties{ - StorageProfile: &armcompute.ImageStorageProfile{ - OSDisk: &armcompute.ImageOSDisk{ - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - ManagedDisk: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // }, - // OSDisk: &armcompute.ImageOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - // }, - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromASnapshot.json -func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromASnapshot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ - Location: to.Ptr("West US"), - Properties: &armcompute.ImageProperties{ - StorageProfile: &armcompute.ImageStorageProfile{ - OSDisk: &armcompute.ImageOSDisk{ - Snapshot: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - }, - OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - }, - ZoneResilient: to.Ptr(false), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // }, - // OSDisk: &armcompute.ImageOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // }, - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // ZoneResilient: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_CreateFromAVM.json -func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageFromAnExistingVirtualMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ - Location: to.Ptr("West US"), - Properties: &armcompute.ImageProperties{ - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // SourceVirtualMachine: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // }, - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // }, - // OSDisk: &armcompute.ImageOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myVM_OsDisk_1_6dc293b7d811433196903acf92665022"), - // }, - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // ZoneResilient: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Create_DataDiskFromABlobIncluded.json -func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageThatIncludesADataDiskFromABlob() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ - Location: to.Ptr("West US"), - Properties: &armcompute.ImageProperties{ - StorageProfile: &armcompute.ImageStorageProfile{ - DataDisks: []*armcompute.ImageDataDisk{ - { - BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), - Lun: to.Ptr[int32](1), - }}, - OSDisk: &armcompute.ImageOSDisk{ - BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - }, - ZoneResilient: to.Ptr(false), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // { - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), - // Lun: to.Ptr[int32](1), - // }}, - // OSDisk: &armcompute.ImageOSDisk{ - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // ZoneResilient: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Create_DataDiskFromAManagedDiskIncluded.json -func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageThatIncludesADataDiskFromAManagedDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ - Location: to.Ptr("West US"), - Properties: &armcompute.ImageProperties{ - StorageProfile: &armcompute.ImageStorageProfile{ - DataDisks: []*armcompute.ImageDataDisk{ - { - ManagedDisk: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), - }, - Lun: to.Ptr[int32](1), - }}, - OSDisk: &armcompute.ImageOSDisk{ - ManagedDisk: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - }, - OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - }, - ZoneResilient: to.Ptr(false), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // { - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), - // }, - // Lun: to.Ptr[int32](1), - // }}, - // OSDisk: &armcompute.ImageOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk"), - // }, - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // ZoneResilient: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Image_Create_DataDiskFromASnapshotIncluded.json -func ExampleImagesClient_BeginCreateOrUpdate_createAVirtualMachineImageThatIncludesADataDiskFromASnapshot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myImage", armcompute.Image{ - Location: to.Ptr("West US"), - Properties: &armcompute.ImageProperties{ - StorageProfile: &armcompute.ImageStorageProfile{ - DataDisks: []*armcompute.ImageDataDisk{ - { - Snapshot: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), - }, - Lun: to.Ptr[int32](1), - }}, - OSDisk: &armcompute.ImageOSDisk{ - Snapshot: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - }, - OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - }, - ZoneResilient: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/disk/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // { - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), - // }, - // Lun: to.Ptr[int32](1), - // }}, - // OSDisk: &armcompute.ImageOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // }, - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // ZoneResilient: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "department": to.Ptr("HR"), - // }, - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // { - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), - // }, - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // Lun: to.Ptr[int32](1), - // }}, - // OSDisk: &armcompute.ImageOSDisk{ - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // DiskSizeGB: to.Ptr[int32](20), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), - // }, - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // ZoneResilient: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Images_Delete_MaximumSet_Gen.json -func ExampleImagesClient_BeginDelete_imageDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/imageExamples/Images_Delete_MinimumSet_Gen.json -func ExampleImagesClient_BeginDelete_imageDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewImagesClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewImagesClient().Get(ctx, "myResourceGroup", "myImage", &armcompute.ImagesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Image = armcompute.Image{ - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // { - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), - // }, - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // Lun: to.Ptr[int32](1), - // }}, - // OSDisk: &armcompute.ImageOSDisk{ - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // DiskSizeGB: to.Ptr[int32](20), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), - // }, - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // ZoneResilient: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewImagesClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ImageListResult = armcompute.ImageListResult{ - // Value: []*armcompute.Image{ - // { - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // { - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), - // }, - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // Lun: to.Ptr[int32](1), - // }}, - // OSDisk: &armcompute.ImageOSDisk{ - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), - // }, - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewImagesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ImageListResult = armcompute.ImageListResult{ - // Value: []*armcompute.Image{ - // { - // Name: to.Ptr("myImage"), - // Type: to.Ptr("Microsoft.Compute/images"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/myImage"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.ImageProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.ImageStorageProfile{ - // DataDisks: []*armcompute.ImageDataDisk{ - // { - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/dataimages/dataimage.vhd"), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk2"), - // }, - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // Lun: to.Ptr[int32](1), - // }}, - // OSDisk: &armcompute.ImageOSDisk{ - // BlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/osimages/osimage.vhd"), - // ManagedDisk: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myManagedDisk1"), - // }, - // Snapshot: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // OSState: to.Ptr(armcompute.OperatingSystemStateTypesGeneralized), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/loganalytics_client.go b/sdk/resourcemanager/compute/armcompute/loganalytics_client.go index f8a9cc54d92c..2069990a4ce1 100644 --- a/sdk/resourcemanager/compute/armcompute/loganalytics_client.go +++ b/sdk/resourcemanager/compute/armcompute/loganalytics_client.go @@ -48,7 +48,7 @@ func NewLogAnalyticsClient(subscriptionID string, credential azcore.TokenCredent // to show throttling activities. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The location upon which virtual-machine-sizes is queried. // - parameters - Parameters supplied to the LogAnalytics getRequestRateByInterval Api. // - options - LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval @@ -75,7 +75,7 @@ func (client *LogAnalyticsClient) BeginExportRequestRateByInterval(ctx context.C // show throttling activities. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *LogAnalyticsClient) exportRequestRateByInterval(ctx context.Context, location string, parameters RequestRateByIntervalInput, options *LogAnalyticsClientBeginExportRequestRateByIntervalOptions) (*http.Response, error) { var err error const operationName = "LogAnalyticsClient.BeginExportRequestRateByInterval" @@ -113,7 +113,7 @@ func (client *LogAnalyticsClient) exportRequestRateByIntervalCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -126,7 +126,7 @@ func (client *LogAnalyticsClient) exportRequestRateByIntervalCreateRequest(ctx c // window. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The location upon which virtual-machine-sizes is queried. // - parameters - Parameters supplied to the LogAnalytics getThrottledRequests Api. // - options - LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests @@ -152,7 +152,7 @@ func (client *LogAnalyticsClient) BeginExportThrottledRequests(ctx context.Conte // ExportThrottledRequests - Export logs that show total throttled Api requests for this subscription in the given time window. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *LogAnalyticsClient) exportThrottledRequests(ctx context.Context, location string, parameters ThrottledRequestsInput, options *LogAnalyticsClientBeginExportThrottledRequestsOptions) (*http.Response, error) { var err error const operationName = "LogAnalyticsClient.BeginExportThrottledRequests" @@ -190,7 +190,7 @@ func (client *LogAnalyticsClient) exportThrottledRequestsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/loganalytics_client_example_test.go b/sdk/resourcemanager/compute/armcompute/loganalytics_client_example_test.go deleted file mode 100644 index 44210e3494f5..000000000000 --- a/sdk/resourcemanager/compute/armcompute/loganalytics_client_example_test.go +++ /dev/null @@ -1,93 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLogAnalyticsClient().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.862Z"); return t }()), - GroupByResourceName: to.Ptr(true), - ToTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-23T01:54:06.862Z"); 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogAnalyticsOperationResult = armcompute.LogAnalyticsOperationResult{ - // Properties: &armcompute.LogAnalyticsOutput{ - // Output: to.Ptr("https://crptestar4227.blob.core.windows.net:443/sascontainer/RequestRateByInterval_20180121-0154_20180123-0154.csv"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLogAnalyticsClient().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.862Z"); 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.862Z"); 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogAnalyticsOperationResult = armcompute.LogAnalyticsOperationResult{ - // Properties: &armcompute.LogAnalyticsOutput{ - // Output: to.Ptr("https://crptestar4227.blob.core.windows.net:443/sascontainer/ThrottledRequests_20180121-0154_20180123-0154.csv"), - // }, - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/models.go b/sdk/resourcemanager/compute/armcompute/models.go index 39265c125a8d..206f0a843e81 100644 --- a/sdk/resourcemanager/compute/armcompute/models.go +++ b/sdk/resourcemanager/compute/armcompute/models.go @@ -46,69 +46,6 @@ type APIErrorBase struct { Target *string } -// AccessControlRules - This is the Access Control Rules specification for an inVMAccessControlProfile version. -type AccessControlRules struct { - // A list of identities. - Identities []*AccessControlRulesIdentity - - // A list of privileges. - Privileges []*AccessControlRulesPrivilege - - // A list of role assignments. - RoleAssignments []*AccessControlRulesRoleAssignment - - // A list of roles. - Roles []*AccessControlRulesRole -} - -// AccessControlRulesIdentity - The properties of an Access Control Rule Identity. -type AccessControlRulesIdentity struct { - // REQUIRED; The name of the identity. - Name *string - - // The path to the executable. - ExePath *string - - // The groupName corresponding to this identity. - GroupName *string - - // The process name of the executable. - ProcessName *string - - // The username corresponding to this identity. - UserName *string -} - -// AccessControlRulesPrivilege - The properties of an Access Control Rule Privilege. -type AccessControlRulesPrivilege struct { - // REQUIRED; The name of the privilege. - Name *string - - // REQUIRED; The HTTP path corresponding to the privilege. - Path *string - - // The query parameters to match in the path. - QueryParameters map[string]*string -} - -// AccessControlRulesRole - The properties of an Access Control Rule Role. -type AccessControlRulesRole struct { - // REQUIRED; The name of the role. - Name *string - - // REQUIRED; A list of privileges needed by this role. - Privileges []*string -} - -// AccessControlRulesRoleAssignment - The properties of an Access Control Rule RoleAssignment. -type AccessControlRulesRoleAssignment struct { - // REQUIRED; A list of identities that can access the privileges defined by the role. - Identities []*string - - // REQUIRED; The name of the role. - Role *string -} - // AccessURI - A disk access SAS uri. type AccessURI struct { // READ-ONLY; A SAS uri for accessing a disk. @@ -129,15 +66,6 @@ type AdditionalCapabilities struct { UltraSSDEnabled *bool } -// AdditionalReplicaSet - Describes the additional replica set information. -type AdditionalReplicaSet struct { - // The number of direct drive replicas of the Image Version to be created.This Property is updatable - RegionalReplicaCount *int32 - - // Specifies the storage account type to be used to create the direct drive replicas - StorageAccountType *StorageAccountType -} - // AdditionalUnattendContent - Specifies additional XML formatted information that can be included in the Unattend.xml file, // which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in // which the content is applied. @@ -854,10 +782,6 @@ type CloudServiceVaultAndSecretReference struct { type CloudServiceVaultCertificate struct { // This is the URL of a certificate that has been uploaded to Key Vault as a secret. CertificateURL *string - - // Flag indicating if the certificate provided is a bootstrap certificate to be used by the Key Vault Extension to fetch the - // remaining certificates. - IsBootstrapCertificate *bool } // CloudServiceVaultSecretGroup - Describes a set of certificates which are all in the same Key Vault. @@ -946,7 +870,7 @@ type CommunityGalleryImageProperties struct { // managed image. Possible values are: Windows, Linux. OSType *OperatingSystemTypes - // CPU architecture supported by an OS disk. + // The architecture of the image. Applicable to OS disks only. Architecture *Architecture // The artifact tags of a community gallery resource. @@ -2185,21 +2109,6 @@ type EventGridAndResourceGraph struct { Enable *bool } -// ExecutedValidation - This is the executed Validation. -type ExecutedValidation struct { - // This property specifies the starting timestamp. - ExecutionTime *time.Time - - // This property specifies the status of the validationProfile of the image version. - Status *ValidationStatus - - // This property specifies the type of image version validation. - Type *string - - // This property specifies the valid version of the validation. - Version *string -} - // ExtendedLocation - The complex type of the extended location. type ExtendedLocation struct { // The name of the extended location. @@ -2223,9 +2132,6 @@ type Gallery struct { // REQUIRED; Resource location Location *string - // The identity of the gallery, if configured. - Identity *GalleryIdentity - // Describes the properties of a Shared Image Gallery. Properties *GalleryProperties @@ -2582,25 +2488,6 @@ type GalleryIdentifier struct { UniqueName *string } -// GalleryIdentity - Identity for the virtual machine. -type GalleryIdentity struct { - // The type of identity used for the gallery. The type 'SystemAssigned, UserAssigned' includes both an implicitly created - // identity and a set of user assigned identities. The type 'None' will remove all - // identities from the gallery. - Type *ResourceIdentityType - - // The list of user identities associated with the gallery. The user identity dictionary key references will be ARM resource - // ids in the form: - // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserAssignedIdentitiesValue - - // READ-ONLY; The principal id of the gallery identity. This property will only be provided for a system assigned identity. - PrincipalID *string - - // READ-ONLY; The AAD tenant id of the gallery identity. This property will only be provided for a system assigned identity. - TenantID *string -} - // GalleryImage - Specifies information about the gallery image definition that you want to create or update. type GalleryImage struct { // REQUIRED; Resource location @@ -2627,9 +2514,6 @@ type GalleryImageFeature struct { // The name of the gallery image feature. Name *string - // The minimum gallery image version which supports this feature. - StartsAtVersion *string - // The value of the gallery image feature. Value *string } @@ -2669,10 +2553,7 @@ type GalleryImageProperties struct { // managed image. Possible values are: Windows, Linux. OSType *OperatingSystemTypes - // Optional. Must be set to true if the gallery image features are being updated. - AllowUpdateImage *bool - - // CPU architecture supported by an OS disk. + // The architecture of the image. Applicable to OS disks only. Architecture *Architecture // The description of this gallery image definition resource. This property is updatable. @@ -2767,9 +2648,6 @@ type GalleryImageVersionProperties struct { // The publishing profile of a gallery image Version. PublishingProfile *GalleryImageVersionPublishingProfile - // Indicates if this is a soft-delete resource restoration request. - Restore *bool - // This is the safety profile of the Gallery Image Version. SafetyProfile *GalleryImageVersionSafetyProfile @@ -2781,9 +2659,6 @@ type GalleryImageVersionProperties struct { // READ-ONLY; This is the replication status of the gallery image version. ReplicationStatus *ReplicationStatus - - // READ-ONLY; This is the validations profile of a Gallery Image Version. - ValidationsProfile *ValidationsProfile } // GalleryImageVersionPublishingProfile - The publishing profile of a gallery image Version. @@ -2820,9 +2695,6 @@ type GalleryImageVersionSafetyProfile struct { // Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. AllowDeletionOfReplicatedLocations *bool - // Indicates whether or not the deletion is blocked for this Gallery Image Version if its End Of Life has not expired. - BlockDeletionBeforeEndOfLife *bool - // READ-ONLY; A list of Policy Violations that have been reported for this Gallery Image Version. PolicyViolations []*PolicyViolation @@ -2869,154 +2741,6 @@ type GalleryImageVersionUpdate struct { Type *string } -// GalleryInVMAccessControlProfile - Specifies information about the gallery inVMAccessControlProfile that you want to create -// or update. -type GalleryInVMAccessControlProfile struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a gallery inVMAccessControlProfile. - Properties *GalleryInVMAccessControlProfileProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryInVMAccessControlProfileList - The List Gallery InVMAccessControlProfiles operation response. -type GalleryInVMAccessControlProfileList struct { - // REQUIRED; A list of Gallery InVMAccessControlProfiles. - Value []*GalleryInVMAccessControlProfile - - // The uri to fetch the next page of inVMAccessControlProfiles in the gallery. Call ListNext() with this to fetch the next - // page of gallery inVMAccessControlProfiles. - NextLink *string -} - -// GalleryInVMAccessControlProfileProperties - Describes the properties of a gallery inVMAccessControlProfile. -type GalleryInVMAccessControlProfileProperties struct { - // REQUIRED; This property allows you to specify the Endpoint type for which this profile is defining the access control for. - // Possible values are: 'WireServer' or 'IMDS' - ApplicableHostEndpoint *EndpointTypes - - // REQUIRED; This property allows you to specify the OS type of the VMs/VMSS for which this profile can be used against. Possible - // values are: 'Windows' or 'Linux' - OSType *OperatingSystemTypes - - // The description of this gallery inVMAccessControlProfile resources. This property is updatable. - Description *string - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState -} - -// GalleryInVMAccessControlProfileUpdate - Specifies information about the gallery inVMAccessControlProfile that you want -// to update. -type GalleryInVMAccessControlProfileUpdate struct { - // Describes the properties of a gallery inVMAccessControlProfile. - Properties *GalleryInVMAccessControlProfileProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryInVMAccessControlProfileVersion - Specifies information about the gallery inVMAccessControlProfile version that -// you want to create or update. -type GalleryInVMAccessControlProfileVersion struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of an inVMAccessControlProfile version. - Properties *GalleryInVMAccessControlProfileVersionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GalleryInVMAccessControlProfileVersionList - The List Gallery InVMAccessControlProfile Versions operation response. -type GalleryInVMAccessControlProfileVersionList struct { - // REQUIRED; A list of Gallery InVMAccessControlProfile Versions. - Value []*GalleryInVMAccessControlProfileVersion - - // The uri to fetch the next page of inVMAccessControlProfile versions. Call ListNext() with this to fetch the next page of - // gallery inVMAccessControlProfile versions. - NextLink *string -} - -// GalleryInVMAccessControlProfileVersionProperties - Describes the properties of an inVMAccessControlProfile version. -type GalleryInVMAccessControlProfileVersionProperties struct { - // REQUIRED; This property allows you to specify if the requests will be allowed to access the host endpoints. Possible values - // are: 'Allow', 'Deny'. - DefaultAccess *EndpointAccess - - // REQUIRED; This property allows you to specify whether the access control rules are in Audit mode, in Enforce mode or Disabled. - // Possible values are: 'Audit', 'Enforce' or 'Disabled'. - Mode *AccessControlRulesMode - - // If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. - ExcludeFromLatest *bool - - // This is the Access Control Rules specification for an inVMAccessControlProfile version. - Rules *AccessControlRules - - // The target regions where the Resource Profile version is going to be replicated to. This property is updatable. - TargetLocations []*TargetRegion - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState - - // READ-ONLY; The timestamp for when the Resource Profile Version is published. - PublishedDate *time.Time - - // READ-ONLY; This is the replication status of the gallery image version. - ReplicationStatus *ReplicationStatus -} - -// GalleryInVMAccessControlProfileVersionUpdate - Specifies information about the gallery inVMAccessControlProfile version -// that you want to update. -type GalleryInVMAccessControlProfileVersionUpdate struct { - // Describes the properties of an inVMAccessControlProfile version. - Properties *GalleryInVMAccessControlProfileVersionProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - // GalleryList - The List Galleries operation response. type GalleryList struct { // REQUIRED; A list of galleries. @@ -3024,9 +2748,6 @@ type GalleryList struct { // The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. NextLink *string - - // The security profile of a gallery image version - SecurityProfile *ImageVersionSecurityProfile } // GalleryOSDiskImage - This is the OS disk image. @@ -3062,73 +2783,6 @@ type GalleryProperties struct { SharingStatus *SharingStatus } -// GalleryResourceProfilePropertiesBase - The properties of a gallery ResourceProfile. -type GalleryResourceProfilePropertiesBase struct { - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState -} - -// GalleryResourceProfileVersionPropertiesBase - The properties of a gallery ResourceProfile version. -type GalleryResourceProfileVersionPropertiesBase struct { - // If set to true, Virtual Machines deployed from the latest version of the Resource Profile won't use this Profile version. - ExcludeFromLatest *bool - - // The target regions where the Resource Profile version is going to be replicated to. This property is updatable. - TargetLocations []*TargetRegion - - // READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *GalleryProvisioningState - - // READ-ONLY; The timestamp for when the Resource Profile Version is published. - PublishedDate *time.Time - - // READ-ONLY; This is the replication status of the gallery image version. - ReplicationStatus *ReplicationStatus -} - -// GallerySoftDeletedResource - The details information of soft-deleted resource. -type GallerySoftDeletedResource struct { - // REQUIRED; Resource location - Location *string - - // Describes the properties of a soft-deleted resource. - Properties *GallerySoftDeletedResourceProperties - - // Resource tags - Tags map[string]*string - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// GallerySoftDeletedResourceList - The List Soft-deleted Resources operation response. -type GallerySoftDeletedResourceList struct { - // REQUIRED; A list of soft-deleted resources. - Value []*GallerySoftDeletedResource - - // The uri to fetch the next page of soft-deleted resources. Call ListNext() with this to fetch the next page of soft-deleted - // resources. - NextLink *string -} - -// GallerySoftDeletedResourceProperties - Describes the properties of a soft-deleted resource. -type GallerySoftDeletedResourceProperties struct { - // arm id of the soft-deleted resource - ResourceArmID *string - - // artifact type of the soft-deleted resource - SoftDeletedArtifactType *SoftDeletedArtifactTypes - - // The timestamp for when the resource is soft-deleted. In dateTime offset format. - SoftDeletedTime *string -} - type GalleryTargetExtendedLocation struct { // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. Encryption *EncryptionImages @@ -3148,9 +2802,6 @@ type GalleryTargetExtendedLocation struct { // GalleryUpdate - Specifies information about the Shared Image Gallery that you want to update. type GalleryUpdate struct { - // The identity of the gallery, if configured. - Identity *GalleryIdentity - // Describes the properties of a Shared Image Gallery. Properties *GalleryProperties @@ -4273,15 +3924,6 @@ type Plan struct { Publisher *string } -// PlatformAttribute - This is the platform attribute of the image version. -type PlatformAttribute struct { - // READ-ONLY; This property specifies the name of the platformAttribute. It is read-only. - Name *string - - // READ-ONLY; This property specifies the value of the corresponding name property. It is read-only. - Value *string -} - // PolicyViolation - A policy violation reported against a gallery artifact. type PolicyViolation struct { // Describes the nature of the policy violation. @@ -5698,7 +5340,7 @@ type SharedGalleryImageProperties struct { // managed image. Possible values are: Windows, Linux. OSType *OperatingSystemTypes - // CPU architecture supported by an OS disk. + // The architecture of the image. Applicable to OS disks only. Architecture *Architecture // The artifact tags of a shared gallery resource. @@ -6130,9 +5772,6 @@ type TargetRegion struct { // REQUIRED; The name of the region. Name *string - // List of storage sku with replica count to create direct drive replicas. - AdditionalReplicaSets []*AdditionalReplicaSet - // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. Encryption *EncryptionImages @@ -6366,9 +6005,6 @@ type UserArtifactSettings struct { // 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 - - // Optional. The action to be taken with regards to install/update/remove of the gallery application in the event of a reboot. - ScriptBehaviorAfterReboot *GalleryApplicationScriptRebootBehavior } // UserArtifactSource - The source image from which the Image Version is going to be created. @@ -6467,17 +6103,6 @@ type VMSizeProperties struct { VCPUsPerCore *int32 } -// ValidationsProfile - This is the validations profile of a Gallery Image Version. -type ValidationsProfile struct { - ExecutedValidations []*ExecutedValidation - - // This specifies the pub, offer, sku and version of the image version metadata - PlatformAttributes []*PlatformAttribute - - // The published time of the image version - ValidationEtag *string -} - // VaultCertificate - Describes a single certificate reference in a Key Vault, and where the certificate should reside on // the VM. type VaultCertificate struct { @@ -7056,7 +6681,7 @@ type VirtualMachineInstanceView struct { // READ-ONLY; [Preview Feature] Specifies whether the VM is currently in or out of the Standby Pool. IsVMInStandbyPool *bool - // READ-ONLY; The health status for the VM. + // READ-ONLY; The application health status for the VM, provided through Application Health Extension. VMHealth *VirtualMachineHealthStatus } @@ -8694,7 +8319,8 @@ type VirtualMachineScaleSetVMInstanceView struct { // placement enabled. Minimum api-version: 2020-06-01. AssignedHost *string - // READ-ONLY; The health status for the VM. + // READ-ONLY; The application health status for the VM, provided through Application Health Extension or Load Balancer Health + // Probes. VMHealth *VirtualMachineHealthStatus } diff --git a/sdk/resourcemanager/compute/armcompute/models_serde.go b/sdk/resourcemanager/compute/armcompute/models_serde.go index 60a57c555aa8..46fa9122631f 100644 --- a/sdk/resourcemanager/compute/armcompute/models_serde.go +++ b/sdk/resourcemanager/compute/armcompute/models_serde.go @@ -120,185 +120,6 @@ func (a *APIErrorBase) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AccessControlRules. -func (a AccessControlRules) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identities", a.Identities) - populate(objectMap, "privileges", a.Privileges) - populate(objectMap, "roleAssignments", a.RoleAssignments) - populate(objectMap, "roles", a.Roles) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccessControlRules. -func (a *AccessControlRules) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identities": - err = unpopulate(val, "Identities", &a.Identities) - delete(rawMsg, key) - case "privileges": - err = unpopulate(val, "Privileges", &a.Privileges) - delete(rawMsg, key) - case "roleAssignments": - err = unpopulate(val, "RoleAssignments", &a.RoleAssignments) - delete(rawMsg, key) - case "roles": - err = unpopulate(val, "Roles", &a.Roles) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AccessControlRulesIdentity. -func (a AccessControlRulesIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "exePath", a.ExePath) - populate(objectMap, "groupName", a.GroupName) - populate(objectMap, "name", a.Name) - populate(objectMap, "processName", a.ProcessName) - populate(objectMap, "userName", a.UserName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccessControlRulesIdentity. -func (a *AccessControlRulesIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exePath": - err = unpopulate(val, "ExePath", &a.ExePath) - delete(rawMsg, key) - case "groupName": - err = unpopulate(val, "GroupName", &a.GroupName) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "processName": - err = unpopulate(val, "ProcessName", &a.ProcessName) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, "UserName", &a.UserName) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AccessControlRulesPrivilege. -func (a AccessControlRulesPrivilege) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", a.Name) - populate(objectMap, "path", a.Path) - populate(objectMap, "queryParameters", a.QueryParameters) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccessControlRulesPrivilege. -func (a *AccessControlRulesPrivilege) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &a.Path) - delete(rawMsg, key) - case "queryParameters": - err = unpopulate(val, "QueryParameters", &a.QueryParameters) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AccessControlRulesRole. -func (a AccessControlRulesRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", a.Name) - populate(objectMap, "privileges", a.Privileges) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccessControlRulesRole. -func (a *AccessControlRulesRole) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "privileges": - err = unpopulate(val, "Privileges", &a.Privileges) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AccessControlRulesRoleAssignment. -func (a AccessControlRulesRoleAssignment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "identities", a.Identities) - populate(objectMap, "role", a.Role) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccessControlRulesRoleAssignment. -func (a *AccessControlRulesRoleAssignment) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "identities": - err = unpopulate(val, "Identities", &a.Identities) - delete(rawMsg, key) - case "role": - err = unpopulate(val, "Role", &a.Role) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type AccessURI. func (a AccessURI) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -361,37 +182,6 @@ func (a *AdditionalCapabilities) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdditionalReplicaSet. -func (a AdditionalReplicaSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "regionalReplicaCount", a.RegionalReplicaCount) - populate(objectMap, "storageAccountType", a.StorageAccountType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalReplicaSet. -func (a *AdditionalReplicaSet) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "regionalReplicaCount": - err = unpopulate(val, "RegionalReplicaCount", &a.RegionalReplicaCount) - delete(rawMsg, key) - case "storageAccountType": - err = unpopulate(val, "StorageAccountType", &a.StorageAccountType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type AdditionalUnattendContent. func (a AdditionalUnattendContent) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2020,7 +1810,6 @@ func (c *CloudServiceVaultAndSecretReference) UnmarshalJSON(data []byte) error { func (c CloudServiceVaultCertificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "certificateUrl", c.CertificateURL) - populate(objectMap, "isBootstrapCertificate", c.IsBootstrapCertificate) return json.Marshal(objectMap) } @@ -2036,9 +1825,6 @@ func (c *CloudServiceVaultCertificate) UnmarshalJSON(data []byte) error { case "certificateUrl": err = unpopulate(val, "CertificateURL", &c.CertificateURL) delete(rawMsg, key) - case "isBootstrapCertificate": - err = unpopulate(val, "IsBootstrapCertificate", &c.IsBootstrapCertificate) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -5018,45 +4804,6 @@ func (e *EventGridAndResourceGraph) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExecutedValidation. -func (e ExecutedValidation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "executionTime", e.ExecutionTime) - populate(objectMap, "status", e.Status) - populate(objectMap, "type", e.Type) - populate(objectMap, "version", e.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExecutedValidation. -func (e *ExecutedValidation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "executionTime": - err = unpopulateDateTimeRFC3339(val, "ExecutionTime", &e.ExecutionTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &e.Status) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &e.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ExtendedLocation. func (e ExtendedLocation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5123,7 +4870,6 @@ func (e *Extension) UnmarshalJSON(data []byte) error { func (g Gallery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", g.ID) - populate(objectMap, "identity", g.Identity) populate(objectMap, "location", g.Location) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) @@ -5144,9 +4890,6 @@ func (g *Gallery) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &g.Identity) - delete(rawMsg, key) case "location": err = unpopulate(val, "Location", &g.Location) delete(rawMsg, key) @@ -6028,45 +5771,6 @@ func (g *GalleryIdentifier) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GalleryIdentity. -func (g GalleryIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "principalId", g.PrincipalID) - populate(objectMap, "tenantId", g.TenantID) - populate(objectMap, "type", g.Type) - populate(objectMap, "userAssignedIdentities", g.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryIdentity. -func (g *GalleryIdentity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &g.PrincipalID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &g.TenantID) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &g.UserAssignedIdentities) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type GalleryImage. func (g GalleryImage) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6118,7 +5822,6 @@ func (g *GalleryImage) UnmarshalJSON(data []byte) error { func (g GalleryImageFeature) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "name", g.Name) - populate(objectMap, "startsAtVersion", g.StartsAtVersion) populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } @@ -6135,9 +5838,6 @@ func (g *GalleryImageFeature) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "startsAtVersion": - err = unpopulate(val, "StartsAtVersion", &g.StartsAtVersion) - delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) @@ -6218,7 +5918,6 @@ func (g *GalleryImageList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GalleryImageProperties. func (g GalleryImageProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowUpdateImage", g.AllowUpdateImage) populate(objectMap, "architecture", g.Architecture) populate(objectMap, "description", g.Description) populate(objectMap, "disallowed", g.Disallowed) @@ -6246,9 +5945,6 @@ func (g *GalleryImageProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "allowUpdateImage": - err = unpopulate(val, "AllowUpdateImage", &g.AllowUpdateImage) - delete(rawMsg, key) case "architecture": err = unpopulate(val, "Architecture", &g.Architecture) delete(rawMsg, key) @@ -6429,11 +6125,9 @@ func (g GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "provisioningState", g.ProvisioningState) populate(objectMap, "publishingProfile", g.PublishingProfile) populate(objectMap, "replicationStatus", g.ReplicationStatus) - populate(objectMap, "restore", g.Restore) populate(objectMap, "safetyProfile", g.SafetyProfile) populate(objectMap, "securityProfile", g.SecurityProfile) populate(objectMap, "storageProfile", g.StorageProfile) - populate(objectMap, "validationsProfile", g.ValidationsProfile) return json.Marshal(objectMap) } @@ -6455,9 +6149,6 @@ func (g *GalleryImageVersionProperties) UnmarshalJSON(data []byte) error { case "replicationStatus": err = unpopulate(val, "ReplicationStatus", &g.ReplicationStatus) delete(rawMsg, key) - case "restore": - err = unpopulate(val, "Restore", &g.Restore) - delete(rawMsg, key) case "safetyProfile": err = unpopulate(val, "SafetyProfile", &g.SafetyProfile) delete(rawMsg, key) @@ -6467,9 +6158,6 @@ func (g *GalleryImageVersionProperties) UnmarshalJSON(data []byte) error { case "storageProfile": err = unpopulate(val, "StorageProfile", &g.StorageProfile) delete(rawMsg, key) - case "validationsProfile": - err = unpopulate(val, "ValidationsProfile", &g.ValidationsProfile) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -6537,7 +6225,6 @@ func (g *GalleryImageVersionPublishingProfile) UnmarshalJSON(data []byte) error func (g GalleryImageVersionSafetyProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "allowDeletionOfReplicatedLocations", g.AllowDeletionOfReplicatedLocations) - populate(objectMap, "blockDeletionBeforeEndOfLife", g.BlockDeletionBeforeEndOfLife) populate(objectMap, "policyViolations", g.PolicyViolations) populate(objectMap, "reportedForPolicyViolation", g.ReportedForPolicyViolation) return json.Marshal(objectMap) @@ -6555,9 +6242,6 @@ func (g *GalleryImageVersionSafetyProfile) UnmarshalJSON(data []byte) error { case "allowDeletionOfReplicatedLocations": err = unpopulate(val, "AllowDeletionOfReplicatedLocations", &g.AllowDeletionOfReplicatedLocations) delete(rawMsg, key) - case "blockDeletionBeforeEndOfLife": - err = unpopulate(val, "BlockDeletionBeforeEndOfLife", &g.BlockDeletionBeforeEndOfLife) - delete(rawMsg, key) case "policyViolations": err = unpopulate(val, "PolicyViolations", &g.PolicyViolations) delete(rawMsg, key) @@ -6577,327 +6261,12 @@ func (g GalleryImageVersionStorageProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "dataDiskImages", g.DataDiskImages) populate(objectMap, "osDiskImage", g.OSDiskImage) - populate(objectMap, "source", g.Source) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionStorageProfile. -func (g *GalleryImageVersionStorageProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "dataDiskImages": - err = unpopulate(val, "DataDiskImages", &g.DataDiskImages) - delete(rawMsg, key) - case "osDiskImage": - err = unpopulate(val, "OSDiskImage", &g.OSDiskImage) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &g.Source) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUefiSettings. -func (g GalleryImageVersionUefiSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalSignatures", g.AdditionalSignatures) - populate(objectMap, "signatureTemplateNames", g.SignatureTemplateNames) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUefiSettings. -func (g *GalleryImageVersionUefiSettings) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalSignatures": - err = unpopulate(val, "AdditionalSignatures", &g.AdditionalSignatures) - delete(rawMsg, key) - case "signatureTemplateNames": - err = unpopulate(val, "SignatureTemplateNames", &g.SignatureTemplateNames) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUpdate. -func (g GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUpdate. -func (g *GalleryImageVersionUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryInVMAccessControlProfile. -func (g GalleryInVMAccessControlProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryInVMAccessControlProfile. -func (g *GalleryInVMAccessControlProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryInVMAccessControlProfileList. -func (g GalleryInVMAccessControlProfileList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryInVMAccessControlProfileList. -func (g *GalleryInVMAccessControlProfileList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryInVMAccessControlProfileProperties. -func (g GalleryInVMAccessControlProfileProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "applicableHostEndpoint", g.ApplicableHostEndpoint) - populate(objectMap, "description", g.Description) - populate(objectMap, "osType", g.OSType) - populate(objectMap, "provisioningState", g.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryInVMAccessControlProfileProperties. -func (g *GalleryInVMAccessControlProfileProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "applicableHostEndpoint": - err = unpopulate(val, "ApplicableHostEndpoint", &g.ApplicableHostEndpoint) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &g.Description) - delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &g.OSType) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryInVMAccessControlProfileUpdate. -func (g GalleryInVMAccessControlProfileUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryInVMAccessControlProfileUpdate. -func (g *GalleryInVMAccessControlProfileUpdate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryInVMAccessControlProfileVersion. -func (g GalleryInVMAccessControlProfileVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryInVMAccessControlProfileVersion. -func (g *GalleryInVMAccessControlProfileVersion) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryInVMAccessControlProfileVersionList. -func (g GalleryInVMAccessControlProfileVersionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) + populate(objectMap, "source", g.Source) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryInVMAccessControlProfileVersionList. -func (g *GalleryInVMAccessControlProfileVersionList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionStorageProfile. +func (g *GalleryImageVersionStorageProfile) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -6905,11 +6274,14 @@ func (g *GalleryInVMAccessControlProfileVersionList) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) + case "dataDiskImages": + err = unpopulate(val, "DataDiskImages", &g.DataDiskImages) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) + case "osDiskImage": + err = unpopulate(val, "OSDiskImage", &g.OSDiskImage) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &g.Source) delete(rawMsg, key) } if err != nil { @@ -6919,22 +6291,16 @@ func (g *GalleryInVMAccessControlProfileVersionList) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type GalleryInVMAccessControlProfileVersionProperties. -func (g GalleryInVMAccessControlProfileVersionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUefiSettings. +func (g GalleryImageVersionUefiSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "defaultAccess", g.DefaultAccess) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populate(objectMap, "mode", g.Mode) - populate(objectMap, "provisioningState", g.ProvisioningState) - populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicationStatus", g.ReplicationStatus) - populate(objectMap, "rules", g.Rules) - populate(objectMap, "targetLocations", g.TargetLocations) + populate(objectMap, "additionalSignatures", g.AdditionalSignatures) + populate(objectMap, "signatureTemplateNames", g.SignatureTemplateNames) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryInVMAccessControlProfileVersionProperties. -func (g *GalleryInVMAccessControlProfileVersionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUefiSettings. +func (g *GalleryImageVersionUefiSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -6942,29 +6308,11 @@ func (g *GalleryInVMAccessControlProfileVersionProperties) UnmarshalJSON(data [] for key, val := range rawMsg { var err error switch key { - case "defaultAccess": - err = unpopulate(val, "DefaultAccess", &g.DefaultAccess) - delete(rawMsg, key) - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "mode": - err = unpopulate(val, "Mode", &g.Mode) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicationStatus": - err = unpopulate(val, "ReplicationStatus", &g.ReplicationStatus) - delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &g.Rules) + case "additionalSignatures": + err = unpopulate(val, "AdditionalSignatures", &g.AdditionalSignatures) delete(rawMsg, key) - case "targetLocations": - err = unpopulate(val, "TargetLocations", &g.TargetLocations) + case "signatureTemplateNames": + err = unpopulate(val, "SignatureTemplateNames", &g.SignatureTemplateNames) delete(rawMsg, key) } if err != nil { @@ -6974,8 +6322,8 @@ func (g *GalleryInVMAccessControlProfileVersionProperties) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type GalleryInVMAccessControlProfileVersionUpdate. -func (g GalleryInVMAccessControlProfileVersionUpdate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GalleryImageVersionUpdate. +func (g GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", g.ID) populate(objectMap, "name", g.Name) @@ -6985,8 +6333,8 @@ func (g GalleryInVMAccessControlProfileVersionUpdate) MarshalJSON() ([]byte, err return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryInVMAccessControlProfileVersionUpdate. -func (g *GalleryInVMAccessControlProfileVersionUpdate) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryImageVersionUpdate. +func (g *GalleryImageVersionUpdate) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -7021,7 +6369,6 @@ func (g *GalleryInVMAccessControlProfileVersionUpdate) UnmarshalJSON(data []byte func (g GalleryList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "securityProfile", g.SecurityProfile) populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } @@ -7038,9 +6385,6 @@ func (g *GalleryList) UnmarshalJSON(data []byte) error { case "nextLink": err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) - case "securityProfile": - err = unpopulate(val, "SecurityProfile", &g.SecurityProfile) - delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) @@ -7134,189 +6478,6 @@ func (g *GalleryProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GalleryResourceProfilePropertiesBase. -func (g GalleryResourceProfilePropertiesBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "provisioningState", g.ProvisioningState) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryResourceProfilePropertiesBase. -func (g *GalleryResourceProfilePropertiesBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GalleryResourceProfileVersionPropertiesBase. -func (g GalleryResourceProfileVersionPropertiesBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "excludeFromLatest", g.ExcludeFromLatest) - populate(objectMap, "provisioningState", g.ProvisioningState) - populateDateTimeRFC3339(objectMap, "publishedDate", g.PublishedDate) - populate(objectMap, "replicationStatus", g.ReplicationStatus) - populate(objectMap, "targetLocations", g.TargetLocations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GalleryResourceProfileVersionPropertiesBase. -func (g *GalleryResourceProfileVersionPropertiesBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "excludeFromLatest": - err = unpopulate(val, "ExcludeFromLatest", &g.ExcludeFromLatest) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) - delete(rawMsg, key) - case "publishedDate": - err = unpopulateDateTimeRFC3339(val, "PublishedDate", &g.PublishedDate) - delete(rawMsg, key) - case "replicationStatus": - err = unpopulate(val, "ReplicationStatus", &g.ReplicationStatus) - delete(rawMsg, key) - case "targetLocations": - err = unpopulate(val, "TargetLocations", &g.TargetLocations) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GallerySoftDeletedResource. -func (g GallerySoftDeletedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", g.ID) - populate(objectMap, "location", g.Location) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "tags", g.Tags) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GallerySoftDeletedResource. -func (g *GallerySoftDeletedResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &g.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &g.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &g.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &g.Properties) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &g.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &g.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GallerySoftDeletedResourceList. -func (g GallerySoftDeletedResourceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", g.NextLink) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GallerySoftDeletedResourceList. -func (g *GallerySoftDeletedResourceList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &g.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &g.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type GallerySoftDeletedResourceProperties. -func (g GallerySoftDeletedResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "resourceArmId", g.ResourceArmID) - populate(objectMap, "softDeletedArtifactType", g.SoftDeletedArtifactType) - populate(objectMap, "softDeletedTime", g.SoftDeletedTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GallerySoftDeletedResourceProperties. -func (g *GallerySoftDeletedResourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "resourceArmId": - err = unpopulate(val, "ResourceArmID", &g.ResourceArmID) - delete(rawMsg, key) - case "softDeletedArtifactType": - err = unpopulate(val, "SoftDeletedArtifactType", &g.SoftDeletedArtifactType) - delete(rawMsg, key) - case "softDeletedTime": - err = unpopulate(val, "SoftDeletedTime", &g.SoftDeletedTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type GalleryTargetExtendedLocation. func (g GalleryTargetExtendedLocation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7364,7 +6525,6 @@ func (g *GalleryTargetExtendedLocation) UnmarshalJSON(data []byte) error { func (g GalleryUpdate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", g.ID) - populate(objectMap, "identity", g.Identity) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) populate(objectMap, "tags", g.Tags) @@ -7384,9 +6544,6 @@ func (g *GalleryUpdate) UnmarshalJSON(data []byte) error { case "id": err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "identity": - err = unpopulate(val, "Identity", &g.Identity) - delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) @@ -9978,37 +9135,6 @@ func (p *Plan) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PlatformAttribute. -func (p PlatformAttribute) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "name", p.Name) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PlatformAttribute. -func (p *PlatformAttribute) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &p.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type PolicyViolation. func (p PolicyViolation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14839,7 +13965,6 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TargetRegion. func (t TargetRegion) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalReplicaSets", t.AdditionalReplicaSets) populate(objectMap, "encryption", t.Encryption) populate(objectMap, "excludeFromLatest", t.ExcludeFromLatest) populate(objectMap, "name", t.Name) @@ -14857,9 +13982,6 @@ func (t *TargetRegion) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "additionalReplicaSets": - err = unpopulate(val, "AdditionalReplicaSets", &t.AdditionalReplicaSets) - delete(rawMsg, key) case "encryption": err = unpopulate(val, "Encryption", &t.Encryption) delete(rawMsg, key) @@ -15460,7 +14582,6 @@ func (u UserArtifactSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "configFileName", u.ConfigFileName) populate(objectMap, "packageFileName", u.PackageFileName) - populate(objectMap, "scriptBehaviorAfterReboot", u.ScriptBehaviorAfterReboot) return json.Marshal(objectMap) } @@ -15479,9 +14600,6 @@ func (u *UserArtifactSettings) UnmarshalJSON(data []byte) error { case "packageFileName": err = unpopulate(val, "PackageFileName", &u.PackageFileName) delete(rawMsg, key) - case "scriptBehaviorAfterReboot": - err = unpopulate(val, "ScriptBehaviorAfterReboot", &u.ScriptBehaviorAfterReboot) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) @@ -15773,41 +14891,6 @@ func (v *VMSizeProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ValidationsProfile. -func (v ValidationsProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "executedValidations", v.ExecutedValidations) - populate(objectMap, "platformAttributes", v.PlatformAttributes) - populate(objectMap, "validationEtag", v.ValidationEtag) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidationsProfile. -func (v *ValidationsProfile) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "executedValidations": - err = unpopulate(val, "ExecutedValidations", &v.ExecutedValidations) - delete(rawMsg, key) - case "platformAttributes": - err = unpopulate(val, "PlatformAttributes", &v.PlatformAttributes) - delete(rawMsg, key) - case "validationEtag": - err = unpopulate(val, "ValidationEtag", &v.ValidationEtag) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type VaultCertificate. func (v VaultCertificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/compute/armcompute/operations_client.go b/sdk/resourcemanager/compute/armcompute/operations_client.go index dca24b963743..4e2073d70c95 100644 --- a/sdk/resourcemanager/compute/armcompute/operations_client.go +++ b/sdk/resourcemanager/compute/armcompute/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of compute operations. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -73,7 +73,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/operations_client_example_test.go b/sdk/resourcemanager/compute/armcompute/operations_client_example_test.go deleted file mode 100644 index 04011e830a70..000000000000 --- a/sdk/resourcemanager/compute/armcompute/operations_client_example_test.go +++ /dev/null @@ -1,83 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armcompute.OperationListResult{ - // Value: []*armcompute.OperationValue{ - // { - // Name: to.Ptr("aaaaaaaaaaaa"), - // Display: &armcompute.OperationValueDisplay{ - // Description: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Operation: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Provider: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Resource: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Origin: to.Ptr("aaaaa"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armcompute.OperationListResult{ - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/options.go b/sdk/resourcemanager/compute/armcompute/options.go index b1ba703ab954..c94e80f30245 100644 --- a/sdk/resourcemanager/compute/armcompute/options.go +++ b/sdk/resourcemanager/compute/armcompute/options.go @@ -33,7 +33,7 @@ type AvailabilitySetsClientListAvailableSizesOptions struct { // AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager // method. type AvailabilitySetsClientListBySubscriptionOptions struct { - // The expand expression to apply to the operation. Allowed values are 'virtualMachines/$ref'. + // The expand expression to apply to the operation. Allowed values are 'instanceView'. Expand *string } @@ -793,72 +793,6 @@ type GalleryImagesClientListByGalleryOptions struct { // placeholder for future optional parameters } -// GalleryInVMAccessControlProfileVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryInVMAccessControlProfileVersionsClient.BeginCreateOrUpdate -// method. -type GalleryInVMAccessControlProfileVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryInVMAccessControlProfileVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryInVMAccessControlProfileVersionsClient.BeginDelete -// method. -type GalleryInVMAccessControlProfileVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryInVMAccessControlProfileVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryInVMAccessControlProfileVersionsClient.BeginUpdate -// method. -type GalleryInVMAccessControlProfileVersionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryInVMAccessControlProfileVersionsClientGetOptions contains the optional parameters for the GalleryInVMAccessControlProfileVersionsClient.Get -// method. -type GalleryInVMAccessControlProfileVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileOptions contains the optional parameters -// for the GalleryInVMAccessControlProfileVersionsClient.NewListByGalleryInVMAccessControlProfilePager method. -type GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileOptions struct { - // placeholder for future optional parameters -} - -// GalleryInVMAccessControlProfilesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryInVMAccessControlProfilesClient.BeginCreateOrUpdate -// method. -type GalleryInVMAccessControlProfilesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryInVMAccessControlProfilesClientBeginDeleteOptions contains the optional parameters for the GalleryInVMAccessControlProfilesClient.BeginDelete -// method. -type GalleryInVMAccessControlProfilesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryInVMAccessControlProfilesClientBeginUpdateOptions contains the optional parameters for the GalleryInVMAccessControlProfilesClient.BeginUpdate -// method. -type GalleryInVMAccessControlProfilesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryInVMAccessControlProfilesClientGetOptions contains the optional parameters for the GalleryInVMAccessControlProfilesClient.Get -// method. -type GalleryInVMAccessControlProfilesClientGetOptions struct { - // placeholder for future optional parameters -} - -// GalleryInVMAccessControlProfilesClientListByGalleryOptions contains the optional parameters for the GalleryInVMAccessControlProfilesClient.NewListByGalleryPager -// method. -type GalleryInVMAccessControlProfilesClientListByGalleryOptions struct { - // placeholder for future optional parameters -} - // GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate // method. type GallerySharingProfileClientBeginUpdateOptions struct { @@ -1143,12 +1077,6 @@ type SnapshotsClientListOptions struct { // placeholder for future optional parameters } -// SoftDeletedResourceClientListByArtifactNameOptions contains the optional parameters for the SoftDeletedResourceClient.NewListByArtifactNamePager -// method. -type SoftDeletedResourceClientListByArtifactNameOptions struct { - // placeholder for future optional parameters -} - // UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method. type UsageClientListOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/compute/armcompute/proximityplacementgroup_live_test.go b/sdk/resourcemanager/compute/armcompute/proximityplacementgroup_live_test.go index f8ef5d5e15d9..de2cef302693 100644 --- a/sdk/resourcemanager/compute/armcompute/proximityplacementgroup_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/proximityplacementgroup_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/proximityplacementgroups_client.go b/sdk/resourcemanager/compute/armcompute/proximityplacementgroups_client.go index 7db4b6814a3b..c109591b02b3 100644 --- a/sdk/resourcemanager/compute/armcompute/proximityplacementgroups_client.go +++ b/sdk/resourcemanager/compute/armcompute/proximityplacementgroups_client.go @@ -47,7 +47,7 @@ func NewProximityPlacementGroupsClient(subscriptionID string, credential azcore. // CreateOrUpdate - Create or update a proximity placement group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - proximityPlacementGroupName - The name of the proximity placement group. // - parameters - Parameters supplied to the Create Proximity Placement Group operation. @@ -95,7 +95,7 @@ func (client *ProximityPlacementGroupsClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -116,7 +116,7 @@ func (client *ProximityPlacementGroupsClient) createOrUpdateHandleResponse(resp // Delete - Delete a proximity placement group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - proximityPlacementGroupName - The name of the proximity placement group. // - options - ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete @@ -162,7 +162,7 @@ func (client *ProximityPlacementGroupsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *ProximityPlacementGroupsClient) deleteCreateRequest(ctx context.Co // Get - Retrieves information about a proximity placement group . // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - proximityPlacementGroupName - The name of the proximity placement group. // - options - ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get @@ -218,7 +218,7 @@ func (client *ProximityPlacementGroupsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.IncludeColocationStatus != nil { reqQP.Set("includeColocationStatus", *options.IncludeColocationStatus) } @@ -238,7 +238,7 @@ func (client *ProximityPlacementGroupsClient) getHandleResponse(resp *http.Respo // NewListByResourceGroupPager - Lists all proximity placement groups in a resource group. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - options - ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager // method. @@ -281,7 +281,7 @@ func (client *ProximityPlacementGroupsClient) listByResourceGroupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +298,7 @@ func (client *ProximityPlacementGroupsClient) listByResourceGroupHandleResponse( // NewListBySubscriptionPager - Lists all proximity placement groups in a subscription. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - options - ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager // method. func (client *ProximityPlacementGroupsClient) NewListBySubscriptionPager(options *ProximityPlacementGroupsClientListBySubscriptionOptions) *runtime.Pager[ProximityPlacementGroupsClientListBySubscriptionResponse] { @@ -336,7 +336,7 @@ func (client *ProximityPlacementGroupsClient) listBySubscriptionCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +354,7 @@ func (client *ProximityPlacementGroupsClient) listBySubscriptionHandleResponse(r // Update - Update a proximity placement group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - proximityPlacementGroupName - The name of the proximity placement group. // - parameters - Parameters supplied to the Update Proximity Placement Group operation. @@ -402,7 +402,7 @@ func (client *ProximityPlacementGroupsClient) updateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/proximityplacementgroups_client_example_test.go b/sdk/resourcemanager/compute/armcompute/proximityplacementgroups_client_example_test.go deleted file mode 100644 index 31b23c260ce1..000000000000 --- a/sdk/resourcemanager/compute/armcompute/proximityplacementgroups_client_example_test.go +++ /dev/null @@ -1,277 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProximityPlacementGroupsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProximityPlacementGroup = armcompute.ProximityPlacementGroup{ - // Name: to.Ptr("myProximityPlacementGroup"), - // Type: to.Ptr("Microsoft.Compute/proximityPlacementGroups"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/myProximityPlacementGroup"), - // 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")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProximityPlacementGroupsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProximityPlacementGroup = armcompute.ProximityPlacementGroup{ - // Name: to.Ptr("myProximityPlacementGroup"), - // Type: to.Ptr("Microsoft.Compute/proximityPlacementGroups"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/myProximityPlacementGroup"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ProximityPlacementGroupProperties{ - // ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProximityPlacementGroupsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProximityPlacementGroupsClient().Get(ctx, "myResourceGroup", "myProximityPlacementGroup", &armcompute.ProximityPlacementGroupsClientGetOptions{IncludeColocationStatus: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProximityPlacementGroup = armcompute.ProximityPlacementGroup{ - // Name: to.Ptr("myProximityPlacementGroup"), - // Type: to.Ptr("Microsoft.Compute/proximityPlacementGroups"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/myProximityPlacementGroup"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ProximityPlacementGroupProperties{ - // AvailabilitySets: []*armcompute.SubResourceWithColocationStatus{ - // { - // ID: to.Ptr("string"), - // }}, - // Intent: &armcompute.ProximityPlacementGroupPropertiesIntent{ - // VMSizes: []*string{ - // to.Ptr("Basic_A0"), - // to.Ptr("Basic_A2")}, - // }, - // ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), - // VirtualMachineScaleSets: []*armcompute.SubResourceWithColocationStatus{ - // { - // ID: to.Ptr("string"), - // }}, - // VirtualMachines: []*armcompute.SubResourceWithColocationStatus{ - // { - // ID: to.Ptr("string"), - // }}, - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProximityPlacementGroupsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProximityPlacementGroupListResult = armcompute.ProximityPlacementGroupListResult{ - // Value: []*armcompute.ProximityPlacementGroup{ - // { - // Name: to.Ptr("myProximityPlacementGroup"), - // Type: to.Ptr("Microsoft.Compute/proximityPlacementGroups"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/myProximityPlacementGroup"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ProximityPlacementGroupProperties{ - // AvailabilitySets: []*armcompute.SubResourceWithColocationStatus{ - // { - // ID: to.Ptr("string"), - // }}, - // Intent: &armcompute.ProximityPlacementGroupPropertiesIntent{ - // VMSizes: []*string{ - // to.Ptr("Basic_A0"), - // to.Ptr("Basic_A2")}, - // }, - // ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), - // VirtualMachineScaleSets: []*armcompute.SubResourceWithColocationStatus{ - // { - // ID: to.Ptr("string"), - // }}, - // VirtualMachines: []*armcompute.SubResourceWithColocationStatus{ - // { - // ID: to.Ptr("string"), - // }}, - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProximityPlacementGroupsClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProximityPlacementGroupListResult = armcompute.ProximityPlacementGroupListResult{ - // Value: []*armcompute.ProximityPlacementGroup{ - // { - // Name: to.Ptr("myProximityPlacementGroup"), - // Type: to.Ptr("Microsoft.Compute/proximityPlacementGroups"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/myProximityPlacementGroup"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.ProximityPlacementGroupProperties{ - // AvailabilitySets: []*armcompute.SubResourceWithColocationStatus{ - // { - // ID: to.Ptr("string"), - // }}, - // Intent: &armcompute.ProximityPlacementGroupPropertiesIntent{ - // VMSizes: []*string{ - // to.Ptr("Basic_A0"), - // to.Ptr("Basic_A2")}, - // }, - // ProximityPlacementGroupType: to.Ptr(armcompute.ProximityPlacementGroupTypeStandard), - // VirtualMachineScaleSets: []*armcompute.SubResourceWithColocationStatus{ - // { - // ID: to.Ptr("string"), - // }}, - // VirtualMachines: []*armcompute.SubResourceWithColocationStatus{ - // { - // ID: to.Ptr("string"), - // }}, - // }, - // Zones: []*string{ - // to.Ptr("1")}, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/resourceskus_client_example_test.go b/sdk/resourcemanager/compute/armcompute/resourceskus_client_example_test.go deleted file mode 100644 index 46b7d8264413..000000000000 --- a/sdk/resourcemanager/compute/armcompute/resourceskus_client_example_test.go +++ /dev/null @@ -1,612 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkus.json -func ExampleResourceSKUsClient_NewListPager_listsAllAvailableResourceSkUs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: nil, - IncludeExtendedLocations: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceSKUsResult = armcompute.ResourceSKUsResult{ - // Value: []*armcompute.ResourceSKU{ - // { - // Name: to.Ptr("Standard_A0"), - // Capabilities: []*armcompute.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("MaxResourceVolumeMB"), - // Value: to.Ptr("20480"), - // }, - // { - // Name: to.Ptr("OSVhdSizeMB"), - // Value: to.Ptr("1047552"), - // }, - // { - // Name: to.Ptr("vCPUs"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("HyperVGenerations"), - // Value: to.Ptr("V1"), - // }, - // { - // Name: to.Ptr("MemoryGB"), - // Value: to.Ptr("0.75"), - // }, - // { - // Name: to.Ptr("MaxDataDiskCount"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("LowPriorityCapable"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("PremiumIO"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("vCPUsAvailable"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("ACUs"), - // Value: to.Ptr("50"), - // }, - // { - // Name: to.Ptr("vCPUsPerCore"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("EphemeralOSDiskSupported"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("AcceleratedNetworkingEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("RdmaEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("MaxNetworkInterfaces"), - // Value: to.Ptr("2"), - // }}, - // Family: to.Ptr("standardA0_A7Family"), - // LocationInfo: []*armcompute.ResourceSKULocationInfo{ - // { - // Location: to.Ptr("westus"), - // ZoneDetails: []*armcompute.ResourceSKUZoneDetails{ - // { - // Name: []*string{ - // to.Ptr("2")}, - // Capabilities: []*armcompute.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("UltraSSDAvailable"), - // Value: to.Ptr("True"), - // }}, - // }}, - // Zones: []*string{ - // to.Ptr("2"), - // to.Ptr("1")}, - // }}, - // Locations: []*string{ - // to.Ptr("westus")}, - // ResourceType: to.Ptr("virtualMachines"), - // Size: to.Ptr("A0"), - // Tier: to.Ptr("Standard"), - // }, - // { - // Name: to.Ptr("Standard_A1"), - // Capabilities: []*armcompute.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("MaxResourceVolumeMB"), - // Value: to.Ptr("71680"), - // }, - // { - // Name: to.Ptr("OSVhdSizeMB"), - // Value: to.Ptr("1047552"), - // }, - // { - // Name: to.Ptr("vCPUs"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("HyperVGenerations"), - // Value: to.Ptr("V1"), - // }, - // { - // Name: to.Ptr("MemoryGB"), - // Value: to.Ptr("1.75"), - // }, - // { - // Name: to.Ptr("MaxDataDiskCount"), - // Value: to.Ptr("2"), - // }, - // { - // Name: to.Ptr("LowPriorityCapable"), - // Value: to.Ptr("True"), - // }, - // { - // Name: to.Ptr("PremiumIO"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("vCPUsAvailable"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("ACUs"), - // Value: to.Ptr("100"), - // }, - // { - // Name: to.Ptr("vCPUsPerCore"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("EphemeralOSDiskSupported"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("AcceleratedNetworkingEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("RdmaEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("MaxNetworkInterfaces"), - // Value: to.Ptr("2"), - // }}, - // Family: to.Ptr("standardA0_A7Family"), - // LocationInfo: []*armcompute.ResourceSKULocationInfo{ - // { - // Location: to.Ptr("westus"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }}, - // Locations: []*string{ - // to.Ptr("westus")}, - // ResourceType: to.Ptr("virtualMachines"), - // Size: to.Ptr("A1"), - // Tier: to.Ptr("Standard"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusForARegion.json -func ExampleResourceSKUsClient_NewListPager_listsAllAvailableResourceSkUsForTheSpecifiedRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: to.Ptr("location eq 'westus'"), - IncludeExtendedLocations: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceSKUsResult = armcompute.ResourceSKUsResult{ - // Value: []*armcompute.ResourceSKU{ - // { - // Name: to.Ptr("Standard_A0"), - // Capabilities: []*armcompute.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("MaxResourceVolumeMB"), - // Value: to.Ptr("20480"), - // }, - // { - // Name: to.Ptr("OSVhdSizeMB"), - // Value: to.Ptr("1047552"), - // }, - // { - // Name: to.Ptr("vCPUs"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("HyperVGenerations"), - // Value: to.Ptr("V1"), - // }, - // { - // Name: to.Ptr("MemoryGB"), - // Value: to.Ptr("0.75"), - // }, - // { - // Name: to.Ptr("MaxDataDiskCount"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("LowPriorityCapable"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("PremiumIO"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("vCPUsAvailable"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("ACUs"), - // Value: to.Ptr("50"), - // }, - // { - // Name: to.Ptr("vCPUsPerCore"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("EphemeralOSDiskSupported"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("AcceleratedNetworkingEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("RdmaEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("MaxNetworkInterfaces"), - // Value: to.Ptr("2"), - // }}, - // Family: to.Ptr("standardA0_A7Family"), - // LocationInfo: []*armcompute.ResourceSKULocationInfo{ - // { - // Location: to.Ptr("westus"), - // ZoneDetails: []*armcompute.ResourceSKUZoneDetails{ - // { - // Name: []*string{ - // to.Ptr("2")}, - // Capabilities: []*armcompute.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("UltraSSDAvailable"), - // Value: to.Ptr("True"), - // }}, - // }}, - // Zones: []*string{ - // to.Ptr("2"), - // to.Ptr("1")}, - // }}, - // Locations: []*string{ - // to.Ptr("westus")}, - // ResourceType: to.Ptr("virtualMachines"), - // Size: to.Ptr("A0"), - // Tier: to.Ptr("Standard"), - // }, - // { - // Name: to.Ptr("Standard_A1"), - // Capabilities: []*armcompute.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("MaxResourceVolumeMB"), - // Value: to.Ptr("71680"), - // }, - // { - // Name: to.Ptr("OSVhdSizeMB"), - // Value: to.Ptr("1047552"), - // }, - // { - // Name: to.Ptr("vCPUs"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("HyperVGenerations"), - // Value: to.Ptr("V1"), - // }, - // { - // Name: to.Ptr("MemoryGB"), - // Value: to.Ptr("1.75"), - // }, - // { - // Name: to.Ptr("MaxDataDiskCount"), - // Value: to.Ptr("2"), - // }, - // { - // Name: to.Ptr("LowPriorityCapable"), - // Value: to.Ptr("True"), - // }, - // { - // Name: to.Ptr("PremiumIO"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("vCPUsAvailable"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("ACUs"), - // Value: to.Ptr("100"), - // }, - // { - // Name: to.Ptr("vCPUsPerCore"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("EphemeralOSDiskSupported"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("AcceleratedNetworkingEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("RdmaEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("MaxNetworkInterfaces"), - // Value: to.Ptr("2"), - // }}, - // Family: to.Ptr("standardA0_A7Family"), - // LocationInfo: []*armcompute.ResourceSKULocationInfo{ - // { - // Location: to.Ptr("westus"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }}, - // Locations: []*string{ - // to.Ptr("westus")}, - // ResourceType: to.Ptr("virtualMachines"), - // Size: to.Ptr("A1"), - // Tier: to.Ptr("Standard"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/Skus/stable/2021-07-01/examples/skus/ListAvailableResourceSkusWithExtendedLocations.json -func ExampleResourceSKUsClient_NewListPager_listsAllAvailableResourceSkUsWithExtendedLocationInformation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceSKUsClient().NewListPager(&armcompute.ResourceSKUsClientListOptions{Filter: nil, - IncludeExtendedLocations: to.Ptr("true"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceSKUsResult = armcompute.ResourceSKUsResult{ - // Value: []*armcompute.ResourceSKU{ - // { - // Name: to.Ptr("Standard_A0"), - // Capabilities: []*armcompute.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("MaxResourceVolumeMB"), - // Value: to.Ptr("20480"), - // }, - // { - // Name: to.Ptr("OSVhdSizeMB"), - // Value: to.Ptr("1047552"), - // }, - // { - // Name: to.Ptr("vCPUs"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("HyperVGenerations"), - // Value: to.Ptr("V1"), - // }, - // { - // Name: to.Ptr("MemoryGB"), - // Value: to.Ptr("0.75"), - // }, - // { - // Name: to.Ptr("MaxDataDiskCount"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("LowPriorityCapable"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("PremiumIO"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("vCPUsAvailable"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("ACUs"), - // Value: to.Ptr("50"), - // }, - // { - // Name: to.Ptr("vCPUsPerCore"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("EphemeralOSDiskSupported"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("AcceleratedNetworkingEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("RdmaEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("MaxNetworkInterfaces"), - // Value: to.Ptr("2"), - // }}, - // Family: to.Ptr("standardA0_A7Family"), - // LocationInfo: []*armcompute.ResourceSKULocationInfo{ - // { - // Location: to.Ptr("westus"), - // ZoneDetails: []*armcompute.ResourceSKUZoneDetails{ - // { - // Name: []*string{ - // to.Ptr("2")}, - // Capabilities: []*armcompute.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("UltraSSDAvailable"), - // Value: to.Ptr("True"), - // }}, - // }}, - // Zones: []*string{ - // to.Ptr("2"), - // to.Ptr("1")}, - // }}, - // Locations: []*string{ - // to.Ptr("westus")}, - // ResourceType: to.Ptr("virtualMachines"), - // Size: to.Ptr("A0"), - // Tier: to.Ptr("Standard"), - // }, - // { - // Name: to.Ptr("Standard_A1"), - // Capabilities: []*armcompute.ResourceSKUCapabilities{ - // { - // Name: to.Ptr("MaxResourceVolumeMB"), - // Value: to.Ptr("71680"), - // }, - // { - // Name: to.Ptr("OSVhdSizeMB"), - // Value: to.Ptr("1047552"), - // }, - // { - // Name: to.Ptr("vCPUs"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("HyperVGenerations"), - // Value: to.Ptr("V1"), - // }, - // { - // Name: to.Ptr("MemoryGB"), - // Value: to.Ptr("1.75"), - // }, - // { - // Name: to.Ptr("MaxDataDiskCount"), - // Value: to.Ptr("2"), - // }, - // { - // Name: to.Ptr("LowPriorityCapable"), - // Value: to.Ptr("True"), - // }, - // { - // Name: to.Ptr("PremiumIO"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("vCPUsAvailable"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("ACUs"), - // Value: to.Ptr("100"), - // }, - // { - // Name: to.Ptr("vCPUsPerCore"), - // Value: to.Ptr("1"), - // }, - // { - // Name: to.Ptr("EphemeralOSDiskSupported"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("AcceleratedNetworkingEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("RdmaEnabled"), - // Value: to.Ptr("False"), - // }, - // { - // Name: to.Ptr("MaxNetworkInterfaces"), - // Value: to.Ptr("2"), - // }}, - // Family: to.Ptr("standardA0_A7Family"), - // LocationInfo: []*armcompute.ResourceSKULocationInfo{ - // { - // Location: to.Ptr("westus"), - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }, - // { - // Type: to.Ptr(armcompute.ExtendedLocationTypeEdgeZone), - // ExtendedLocations: []*string{ - // to.Ptr("Las Vegas"), - // to.Ptr("Seattle"), - // to.Ptr("Portland")}, - // Location: to.Ptr("westus"), - // }}, - // Locations: []*string{ - // to.Ptr("westus")}, - // ResourceType: to.Ptr("virtualMachines"), - // Size: to.Ptr("A1"), - // Tier: to.Ptr("Standard"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/responses.go b/sdk/resourcemanager/compute/armcompute/responses.go index 5991aeb0dca0..db4fc2bd38ee 100644 --- a/sdk/resourcemanager/compute/armcompute/responses.go +++ b/sdk/resourcemanager/compute/armcompute/responses.go @@ -745,65 +745,6 @@ type GalleryImagesClientUpdateResponse struct { GalleryImage } -// GalleryInVMAccessControlProfileVersionsClientCreateOrUpdateResponse contains the response from method GalleryInVMAccessControlProfileVersionsClient.BeginCreateOrUpdate. -type GalleryInVMAccessControlProfileVersionsClientCreateOrUpdateResponse struct { - // Specifies information about the gallery inVMAccessControlProfile version that you want to create or update. - GalleryInVMAccessControlProfileVersion -} - -// GalleryInVMAccessControlProfileVersionsClientDeleteResponse contains the response from method GalleryInVMAccessControlProfileVersionsClient.BeginDelete. -type GalleryInVMAccessControlProfileVersionsClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryInVMAccessControlProfileVersionsClientGetResponse contains the response from method GalleryInVMAccessControlProfileVersionsClient.Get. -type GalleryInVMAccessControlProfileVersionsClientGetResponse struct { - // Specifies information about the gallery inVMAccessControlProfile version that you want to create or update. - GalleryInVMAccessControlProfileVersion -} - -// GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse contains the response from method -// GalleryInVMAccessControlProfileVersionsClient.NewListByGalleryInVMAccessControlProfilePager. -type GalleryInVMAccessControlProfileVersionsClientListByGalleryInVMAccessControlProfileResponse struct { - // The List Gallery InVMAccessControlProfile Versions operation response. - GalleryInVMAccessControlProfileVersionList -} - -// GalleryInVMAccessControlProfileVersionsClientUpdateResponse contains the response from method GalleryInVMAccessControlProfileVersionsClient.BeginUpdate. -type GalleryInVMAccessControlProfileVersionsClientUpdateResponse struct { - // Specifies information about the gallery inVMAccessControlProfile version that you want to create or update. - GalleryInVMAccessControlProfileVersion -} - -// GalleryInVMAccessControlProfilesClientCreateOrUpdateResponse contains the response from method GalleryInVMAccessControlProfilesClient.BeginCreateOrUpdate. -type GalleryInVMAccessControlProfilesClientCreateOrUpdateResponse struct { - // Specifies information about the gallery inVMAccessControlProfile that you want to create or update. - GalleryInVMAccessControlProfile -} - -// GalleryInVMAccessControlProfilesClientDeleteResponse contains the response from method GalleryInVMAccessControlProfilesClient.BeginDelete. -type GalleryInVMAccessControlProfilesClientDeleteResponse struct { - // placeholder for future response values -} - -// GalleryInVMAccessControlProfilesClientGetResponse contains the response from method GalleryInVMAccessControlProfilesClient.Get. -type GalleryInVMAccessControlProfilesClientGetResponse struct { - // Specifies information about the gallery inVMAccessControlProfile that you want to create or update. - GalleryInVMAccessControlProfile -} - -// GalleryInVMAccessControlProfilesClientListByGalleryResponse contains the response from method GalleryInVMAccessControlProfilesClient.NewListByGalleryPager. -type GalleryInVMAccessControlProfilesClientListByGalleryResponse struct { - // The List Gallery InVMAccessControlProfiles operation response. - GalleryInVMAccessControlProfileList -} - -// GalleryInVMAccessControlProfilesClientUpdateResponse contains the response from method GalleryInVMAccessControlProfilesClient.BeginUpdate. -type GalleryInVMAccessControlProfilesClientUpdateResponse struct { - // Specifies information about the gallery inVMAccessControlProfile that you want to create or update. - GalleryInVMAccessControlProfile -} - // GallerySharingProfileClientUpdateResponse contains the response from method GallerySharingProfileClient.BeginUpdate. type GallerySharingProfileClientUpdateResponse struct { // Specifies information about the gallery sharing profile update. @@ -1082,12 +1023,6 @@ type SnapshotsClientUpdateResponse struct { Snapshot } -// SoftDeletedResourceClientListByArtifactNameResponse contains the response from method SoftDeletedResourceClient.NewListByArtifactNamePager. -type SoftDeletedResourceClientListByArtifactNameResponse struct { - // The List Soft-deleted Resources operation response. - GallerySoftDeletedResourceList -} - // UsageClientListResponse contains the response from method UsageClient.NewListPager. type UsageClientListResponse struct { // The List Usages operation response. diff --git a/sdk/resourcemanager/compute/armcompute/restorepoint_live_test.go b/sdk/resourcemanager/compute/armcompute/restorepoint_live_test.go index 3c394ef16303..ee325a8321ff 100644 --- a/sdk/resourcemanager/compute/armcompute/restorepoint_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/restorepoint_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" diff --git a/sdk/resourcemanager/compute/armcompute/restorepointcollections_client.go b/sdk/resourcemanager/compute/armcompute/restorepointcollections_client.go index c105b6011b79..bdc4d98a8e18 100644 --- a/sdk/resourcemanager/compute/armcompute/restorepointcollections_client.go +++ b/sdk/resourcemanager/compute/armcompute/restorepointcollections_client.go @@ -48,7 +48,7 @@ func NewRestorePointCollectionsClient(subscriptionID string, credential azcore.T // for more details. When updating a restore point collection, only tags may be modified. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - restorePointCollectionName - The name of the restore point collection. // - parameters - Parameters supplied to the Create or Update restore point collection operation. @@ -96,7 +96,7 @@ func (client *RestorePointCollectionsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -118,7 +118,7 @@ func (client *RestorePointCollectionsClient) createOrUpdateHandleResponse(resp * // points. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - restorePointCollectionName - The name of the Restore Point Collection. // - options - RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete @@ -144,7 +144,7 @@ func (client *RestorePointCollectionsClient) BeginDelete(ctx context.Context, re // points. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *RestorePointCollectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, restorePointCollectionName string, options *RestorePointCollectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RestorePointCollectionsClient.BeginDelete" @@ -186,7 +186,7 @@ func (client *RestorePointCollectionsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,7 +195,7 @@ func (client *RestorePointCollectionsClient) deleteCreateRequest(ctx context.Con // Get - The operation to get the restore point collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - restorePointCollectionName - The name of the restore point collection. // - options - RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get @@ -245,7 +245,7 @@ func (client *RestorePointCollectionsClient) getCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +262,7 @@ func (client *RestorePointCollectionsClient) getHandleResponse(resp *http.Respon // NewListPager - Gets the list of restore point collections in a resource group. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - options - RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager // method. @@ -305,7 +305,7 @@ func (client *RestorePointCollectionsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *RestorePointCollectionsClient) listHandleResponse(resp *http.Respo // to get the next page of restore point collections. Do this till nextLink is not null to fetch all // the restore point collections. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - options - RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager // method. func (client *RestorePointCollectionsClient) NewListAllPager(options *RestorePointCollectionsClientListAllOptions) *runtime.Pager[RestorePointCollectionsClientListAllResponse] { @@ -362,7 +362,7 @@ func (client *RestorePointCollectionsClient) listAllCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,7 +380,7 @@ func (client *RestorePointCollectionsClient) listAllHandleResponse(resp *http.Re // Update - The operation to update the restore point collection. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - restorePointCollectionName - The name of the restore point collection. // - parameters - Parameters supplied to the Update restore point collection operation. @@ -428,7 +428,7 @@ func (client *RestorePointCollectionsClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/restorepointcollections_client_example_test.go b/sdk/resourcemanager/compute/armcompute/restorepointcollections_client_example_test.go deleted file mode 100644 index 6ecc4696a82b..000000000000 --- a/sdk/resourcemanager/compute/armcompute/restorepointcollections_client_example_test.go +++ /dev/null @@ -1,636 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate_ForCrossRegionCopy.json -func ExampleRestorePointCollectionsClient_CreateOrUpdate_createOrUpdateARestorePointCollectionForCrossRegionCopy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorePointCollectionsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePointCollection = armcompute.RestorePointCollection{ - // Name: to.Ptr("myRpc"), - // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"), - // Location: to.Ptr("norwayeast"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.RestorePointCollectionProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // RestorePointCollectionID: to.Ptr("638f052b-a7c2-450c-89e7-6a3b8f1d6a7c"), - // Source: &armcompute.RestorePointCollectionSourceProperties{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("eastus"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_CreateOrUpdate.json -func ExampleRestorePointCollectionsClient_CreateOrUpdate_createOrUpdateARestorePointCollection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorePointCollectionsClient().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/virtualMachines/myVM"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePointCollection = armcompute.RestorePointCollection{ - // Name: to.Ptr("myRpc"), - // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"), - // Location: to.Ptr("norwayeast"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.RestorePointCollectionProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // RestorePointCollectionID: to.Ptr("638f052b-a7c2-450c-89e7-6a3b8f1d6a7c"), - // Source: &armcompute.RestorePointCollectionSourceProperties{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("eastus"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Update_MaximumSet_Gen.json -func ExampleRestorePointCollectionsClient_Update_restorePointCollectionUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorePointCollectionsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePointCollection = armcompute.RestorePointCollection{ - // Name: to.Ptr("myRpc"), - // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"), - // Location: to.Ptr("norwayeast"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.RestorePointCollectionProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // RestorePointCollectionID: to.Ptr("638f052b-a7c2-450c-89e7-6a3b8f1d6a7c"), - // RestorePoints: []*armcompute.RestorePoint{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaa"), - // Properties: &armcompute.RestorePointProperties{ - // ConsistencyMode: to.Ptr(armcompute.ConsistencyModeTypesCrashConsistent), - // ExcludeDisks: []*armcompute.APIEntityReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // SourceMetadata: &armcompute.RestorePointSourceMetadata{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardB1S), - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](9), - // VCPUsPerCore: to.Ptr[int32](12), - // }, - // }, - // LicenseType: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("westus"), - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("admin"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("computerName"), - // CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // 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{ - // { - // 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), - // EnableHotpatching: to.Ptr(true), - // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), - // }, - // ProvisionVMAgent: to.Ptr(true), - // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // WinRM: &armcompute.WinRMConfiguration{ - // Listeners: []*armcompute.WinRMListener{ - // { - // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), - // }}, - // }, - // }, - // }, - // 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.RestorePointSourceVMStorageProfile{ - // DataDisks: []*armcompute.RestorePointSourceVMDataDisk{ - // { - // Name: to.Ptr("testingexcludedisk_DataDisk_1"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"), - // }, - // DiskSizeGB: to.Ptr[int32](24), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_DataDisk_1"), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaa"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }}, - // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), - // OSDisk: &armcompute.RestorePointSourceVMOSDisk{ - // Name: to.Ptr("testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), - // }, - // DiskSizeGB: to.Ptr[int32](3), - // 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}"), - // }, - // }, - // }, - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaa"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypeWindows), - // }, - // }, - // VMID: to.Ptr("76d6541e-80bd-4dc1-932b-3cae4cfb80e7"), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.593Z"); return t}()), - // }, - // }}, - // Source: &armcompute.RestorePointCollectionSourceProperties{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("eastus"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Update_MinimumSet_Gen.json -func ExampleRestorePointCollectionsClient_Update_restorePointCollectionUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorePointCollectionsClient().Update(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaa", armcompute.RestorePointCollectionUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePointCollection = armcompute.RestorePointCollection{ - // Location: to.Ptr("norwayeast"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Delete_MaximumSet_Gen.json -func ExampleRestorePointCollectionsClient_BeginDelete_restorePointCollectionDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestorePointCollectionsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Delete_MinimumSet_Gen.json -func ExampleRestorePointCollectionsClient_BeginDelete_restorePointCollectionDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestorePointCollectionsClient().BeginDelete(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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get.json -func ExampleRestorePointCollectionsClient_Get_getARestorePointCollectionButNotTheRestorePointsContainedInTheRestorePointCollection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorePointCollectionsClient().Get(ctx, "myResourceGroup", "myRpc", &armcompute.RestorePointCollectionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePointCollection = armcompute.RestorePointCollection{ - // Name: to.Ptr("myRpc"), - // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.RestorePointCollectionProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // RestorePointCollectionID: to.Ptr("59f04a5d-f783-4200-a1bd-d3f464e8c4b4"), - // Source: &armcompute.RestorePointCollectionSourceProperties{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/myRpc"), - // Location: to.Ptr("eastus"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePointCollection_Get_WithContainedRestorePoints.json -func ExampleRestorePointCollectionsClient_Get_getARestorePointCollectionIncludingTheRestorePointsContainedInTheRestorePointCollection() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorePointCollectionsClient().Get(ctx, "myResourceGroup", "rpcName", &armcompute.RestorePointCollectionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePointCollection = armcompute.RestorePointCollection{ - // Name: to.Ptr("rpcName"), - // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.RestorePointCollectionProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // RestorePointCollectionID: to.Ptr("59f04a5d-f783-4200-a1bd-d3f464e8c4b4"), - // RestorePoints: []*armcompute.RestorePoint{ - // { - // Name: to.Ptr("restorePointName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName"), - // Properties: &armcompute.RestorePointProperties{ - // ConsistencyMode: to.Ptr(armcompute.ConsistencyModeTypesApplicationConsistent), - // ExcludeDisks: []*armcompute.APIEntityReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vm8768_disk2_fe6ffde4f69b491ca33fb984d5bcd89f"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // SourceMetadata: &armcompute.RestorePointSourceMetadata{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardB1S), - // }, - // Location: to.Ptr("westus"), - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("admin"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("computerName"), - // RequireGuestProvisionSignal: to.Ptr(true), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.RestorePointSourceVMStorageProfile{ - // DataDisks: []*armcompute.RestorePointSourceVMDataDisk{ - // { - // Name: to.Ptr("testingexcludedisk_DataDisk_1"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"), - // }, - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_DataDisk_1"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }}, - // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), - // OSDisk: &armcompute.RestorePointSourceVMOSDisk{ - // Name: to.Ptr("testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), - // }, - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypeWindows), - // }, - // }, - // VMID: to.Ptr("76d6541e-80bd-4dc1-932b-3cae4cfb80e7"), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-27T20:35:05.840Z"); return t}()), - // }, - // }}, - // Source: &armcompute.RestorePointCollectionSourceProperties{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("eastus"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorePointCollectionsClient().NewListPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RestorePointCollectionListResult = armcompute.RestorePointCollectionListResult{ - // Value: []*armcompute.RestorePointCollection{ - // { - // Name: to.Ptr("restorePointCollection1"), - // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/restorePointCollection1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.RestorePointCollectionProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // RestorePointCollectionID: to.Ptr("59f04a5d-f783-4200-a1bd-d3f464e8c4b4"), - // Source: &armcompute.RestorePointCollectionSourceProperties{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/restorePointCollection1"), - // Location: to.Ptr("westus"), - // }, - // }, - // }, - // { - // Name: to.Ptr("restorePointCollection2"), - // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/restorePointCollection2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.RestorePointCollectionProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // RestorePointCollectionID: to.Ptr("2875c590-e337-4102-9668-4f5b7e3f98a4"), - // Source: &armcompute.RestorePointCollectionSourceProperties{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/restorePointCollection2"), - // Location: to.Ptr("westus"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRestorePointCollectionsClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RestorePointCollectionListResult = armcompute.RestorePointCollectionListResult{ - // Value: []*armcompute.RestorePointCollection{ - // { - // Name: to.Ptr("restorePointCollection1"), - // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/resourceGroup1/providers/Microsoft.Compute/restorePointCollections/restorePointCollection1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.RestorePointCollectionProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // RestorePointCollectionID: to.Ptr("59f04a5d-f783-4200-a1bd-d3f464e8c4b4"), - // Source: &armcompute.RestorePointCollectionSourceProperties{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/VM_Test"), - // Location: to.Ptr("westus"), - // }, - // }, - // }, - // { - // Name: to.Ptr("restorePointCollection2"), - // Type: to.Ptr("Microsoft.Compute/restorePointCollections"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/resourceGroup2/providers/Microsoft.Compute/restorePointCollections/restorePointCollection2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.RestorePointCollectionProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // RestorePointCollectionID: to.Ptr("2875c590-e337-4102-9668-4f5b7e3f98a4"), - // Source: &armcompute.RestorePointCollectionSourceProperties{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/VM_Prod"), - // Location: to.Ptr("westus"), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/restorepoints_client.go b/sdk/resourcemanager/compute/armcompute/restorepoints_client.go index 962779d0714f..380d6e4e6782 100644 --- a/sdk/resourcemanager/compute/armcompute/restorepoints_client.go +++ b/sdk/resourcemanager/compute/armcompute/restorepoints_client.go @@ -47,7 +47,7 @@ func NewRestorePointsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreate - The operation to create the restore point. Updating properties of an existing restore point is not allowed // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - restorePointCollectionName - The name of the restore point collection. // - restorePointName - The name of the restore point. @@ -74,7 +74,7 @@ func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGrou // Create - The operation to create the restore point. Updating properties of an existing restore point is not allowed // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *RestorePointsClient) create(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, parameters RestorePoint, options *RestorePointsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "RestorePointsClient.BeginCreate" @@ -120,7 +120,7 @@ func (client *RestorePointsClient) createCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -132,7 +132,7 @@ func (client *RestorePointsClient) createCreateRequest(ctx context.Context, reso // BeginDelete - The operation to delete the restore point. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - restorePointCollectionName - The name of the Restore Point Collection. // - restorePointName - The name of the restore point. @@ -158,7 +158,7 @@ func (client *RestorePointsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - The operation to delete the restore point. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *RestorePointsClient) deleteOperation(ctx context.Context, resourceGroupName string, restorePointCollectionName string, restorePointName string, options *RestorePointsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "RestorePointsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *RestorePointsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ func (client *RestorePointsClient) deleteCreateRequest(ctx context.Context, reso // Get - The operation to get the restore point. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - restorePointCollectionName - The name of the restore point collection. // - restorePointName - The name of the restore point. @@ -267,7 +267,7 @@ func (client *RestorePointsClient) getCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/restorepoints_client_example_test.go b/sdk/resourcemanager/compute/armcompute/restorepoints_client_example_test.go deleted file mode 100644 index f9a73ea1c603..000000000000 --- a/sdk/resourcemanager/compute/armcompute/restorepoints_client_example_test.go +++ /dev/null @@ -1,317 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Copy_BetweenRegions.json -func ExampleRestorePointsClient_BeginCreate_copyARestorePointToADifferentRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestorePointsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Create.json -func ExampleRestorePointsClient_BeginCreate_createARestorePoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestorePointsClient().BeginCreate(ctx, "myResourceGroup", "rpcName", "rpName", armcompute.RestorePoint{ - Properties: &armcompute.RestorePointProperties{ - ExcludeDisks: []*armcompute.APIEntityReference{ - { - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Delete_MaximumSet_Gen.json -func ExampleRestorePointsClient_BeginDelete_restorePointDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestorePointsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Delete_MinimumSet_Gen.json -func ExampleRestorePointsClient_BeginDelete_restorePointDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestorePointsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaa", "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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get.json -func ExampleRestorePointsClient_Get_getARestorePoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorePointsClient().Get(ctx, "myResourceGroup", "rpcName", "rpName", &armcompute.RestorePointsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePoint = armcompute.RestorePoint{ - // Name: to.Ptr("rpName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/rpName"), - // Properties: &armcompute.RestorePointProperties{ - // ConsistencyMode: to.Ptr(armcompute.ConsistencyModeTypesApplicationConsistent), - // ExcludeDisks: []*armcompute.APIEntityReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vm8768_disk2_fe6ffde4f69b491ca33fb984d5bcd89f"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // SourceMetadata: &armcompute.RestorePointSourceMetadata{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardB1S), - // }, - // Location: to.Ptr("westus"), - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("admin"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("computerName"), - // RequireGuestProvisionSignal: to.Ptr(true), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.RestorePointSourceVMStorageProfile{ - // DataDisks: []*armcompute.RestorePointSourceVMDataDisk{ - // { - // Name: to.Ptr("testingexcludedisk_DataDisk_1"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/userdata/providers/Microsoft.Compute/restorePointCollections/mynewrpc/restorePoints/restorepointtwo/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"), - // }, - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/userdata/providers/Microsoft.Compute/disks/testingexcludedisk_DataDisk_1"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }}, - // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), - // OSDisk: &armcompute.RestorePointSourceVMOSDisk{ - // Name: to.Ptr("testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/rpName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), - // }, - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypeWindows), - // }, - // }, - // VMID: to.Ptr("76d6541e-80bd-4dc1-932b-3cae4cfb80e7"), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-27T20:35:05.840Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/restorePointExamples/RestorePoint_Get_WithInstanceView.json -func ExampleRestorePointsClient_Get_getRestorePointWithInstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRestorePointsClient().Get(ctx, "myResourceGroup", "rpcName", "rpName", &armcompute.RestorePointsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RestorePoint = armcompute.RestorePoint{ - // Name: to.Ptr("rpName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/rpName"), - // Properties: &armcompute.RestorePointProperties{ - // ConsistencyMode: to.Ptr(armcompute.ConsistencyModeTypesApplicationConsistent), - // ExcludeDisks: []*armcompute.APIEntityReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vm8768_disk2_fe6ffde4f69b491ca33fb984d5bcd89f"), - // }}, - // InstanceView: &armcompute.RestorePointInstanceView{ - // DiskRestorePoints: []*armcompute.DiskRestorePointInstanceView{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/rpName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), - // ReplicationStatus: &armcompute.DiskRestorePointReplicationStatus{ - // CompletionPercent: to.Ptr[int32](100), - // Status: &armcompute.InstanceViewStatus{ - // Code: to.Ptr("ReplicationState/succeeded"), - // DisplayStatus: to.Ptr("Succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }, - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/userdata/providers/Microsoft.Compute/restorePointCollections/mynewrpc/restorePoints/restorepointtwo/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"), - // ReplicationStatus: &armcompute.DiskRestorePointReplicationStatus{ - // CompletionPercent: to.Ptr[int32](100), - // Status: &armcompute.InstanceViewStatus{ - // Code: to.Ptr("ReplicationState/succeeded"), - // DisplayStatus: to.Ptr("Succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }, - // }, - // }}, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ReplicationState/succeeded"), - // DisplayStatus: to.Ptr("Succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SourceMetadata: &armcompute.RestorePointSourceMetadata{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardB1S), - // }, - // Location: to.Ptr("westus"), - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("admin"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("computerName"), - // RequireGuestProvisionSignal: to.Ptr(true), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.RestorePointSourceVMStorageProfile{ - // DataDisks: []*armcompute.RestorePointSourceVMDataDisk{ - // { - // Name: to.Ptr("testingexcludedisk_DataDisk_1"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/userdata/providers/Microsoft.Compute/restorePointCollections/mynewrpc/restorePoints/restorepointtwo/diskRestorePoints/testingexcludedisk_DataDisk_1_68785190-1acb-4d5e-a8ae-705b45f3dca5"), - // }, - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/userdata/providers/Microsoft.Compute/disks/testingexcludedisk_DataDisk_1"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }}, - // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), - // OSDisk: &armcompute.RestorePointSourceVMOSDisk{ - // Name: to.Ptr("testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // DiskRestorePoint: &armcompute.DiskRestorePointAttributes{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/rpName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), - // }, - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypeWindows), - // }, - // }, - // VMID: to.Ptr("76d6541e-80bd-4dc1-932b-3cae4cfb80e7"), - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-01-27T20:35:05.840Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/runcommand_live_test.go b/sdk/resourcemanager/compute/armcompute/runcommand_live_test.go index 143ab2a181a9..ae49d8907a45 100644 --- a/sdk/resourcemanager/compute/armcompute/runcommand_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/runcommand_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" diff --git a/sdk/resourcemanager/compute/armcompute/sharedgalleries_client.go b/sdk/resourcemanager/compute/armcompute/sharedgalleries_client.go index e93b0972af56..ee8172bae84c 100644 --- a/sdk/resourcemanager/compute/armcompute/sharedgalleries_client.go +++ b/sdk/resourcemanager/compute/armcompute/sharedgalleries_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-03 // - location - Resource location. // - galleryUniqueName - The unique name of the Shared Gallery. // - options - SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. @@ -93,7 +93,7 @@ func (client *SharedGalleriesClient) getCreateRequest(ctx context.Context, locat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *SharedGalleriesClient) getHandleResponse(resp *http.Response) (Sha // NewListPager - List shared galleries by subscription id or tenant id. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-03 // - location - Resource location. // - options - SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager // method. @@ -153,7 +153,7 @@ func (client *SharedGalleriesClient) listCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") if options != nil && options.SharedTo != nil { reqQP.Set("sharedTo", string(*options.SharedTo)) } diff --git a/sdk/resourcemanager/compute/armcompute/sharedgalleries_client_example_test.go b/sdk/resourcemanager/compute/armcompute/sharedgalleries_client_example_test.go deleted file mode 100644 index 230ab2acc66f..000000000000 --- a/sdk/resourcemanager/compute/armcompute/sharedgalleries_client_example_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. -// DO NOT EDIT. - -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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/sharedGalleryExamples/SharedGallery_List.json -func ExampleSharedGalleriesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSharedGalleriesClient().NewListPager("myLocation", &armcompute.SharedGalleriesClientListOptions{SharedTo: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SharedGalleryList = armcompute.SharedGalleryList{ - // Value: []*armcompute.SharedGallery{ - // { - // Name: to.Ptr("galleryUniqueName"), - // Location: to.Ptr("myLocation"), - // Identifier: &armcompute.SharedGalleryIdentifier{ - // UniqueID: to.Ptr("/SharedGalleries/galleryUniqueName"), - // }, - // Properties: &armcompute.SharedGalleryProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-Official1PGallery": to.Ptr("Official1PGallery"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/sharedGalleryExamples/SharedGallery_Get.json -func ExampleSharedGalleriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSharedGalleriesClient().Get(ctx, "myLocation", "galleryUniqueName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharedGallery = armcompute.SharedGallery{ - // Name: to.Ptr("myGalleryName"), - // Location: to.Ptr("myLocation"), - // Identifier: &armcompute.SharedGalleryIdentifier{ - // UniqueID: to.Ptr("/SharedGalleries/galleryUniqueName"), - // }, - // Properties: &armcompute.SharedGalleryProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-Official1PGallery": to.Ptr("Official1PGallery"), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/sharedgalleryimages_client.go b/sdk/resourcemanager/compute/armcompute/sharedgalleryimages_client.go index 1e322b89c20a..8f0ef79cfe0e 100644 --- a/sdk/resourcemanager/compute/armcompute/sharedgalleryimages_client.go +++ b/sdk/resourcemanager/compute/armcompute/sharedgalleryimages_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -98,7 +98,7 @@ func (client *SharedGalleryImagesClient) getCreateRequest(ctx context.Context, l return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *SharedGalleryImagesClient) getHandleResponse(resp *http.Response) // NewListPager - List shared gallery images by subscription id or tenant id. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-03 // - location - Resource location. // - galleryUniqueName - The unique name of the Shared Gallery. // - options - SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager @@ -163,7 +163,7 @@ func (client *SharedGalleryImagesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") if options != nil && options.SharedTo != nil { reqQP.Set("sharedTo", string(*options.SharedTo)) } diff --git a/sdk/resourcemanager/compute/armcompute/sharedgalleryimages_client_example_test.go b/sdk/resourcemanager/compute/armcompute/sharedgalleryimages_client_example_test.go deleted file mode 100644 index 0ca63e0a8b31..000000000000 --- a/sdk/resourcemanager/compute/armcompute/sharedgalleryimages_client_example_test.go +++ /dev/null @@ -1,107 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/sharedGalleryExamples/SharedGalleryImages_List.json -func ExampleSharedGalleryImagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSharedGalleryImagesClient().NewListPager("myLocation", "galleryUniqueName", &armcompute.SharedGalleryImagesClientListOptions{SharedTo: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SharedGalleryImageList = armcompute.SharedGalleryImageList{ - // Value: []*armcompute.SharedGalleryImage{ - // { - // Name: to.Ptr("myGalleryImageName"), - // Location: to.Ptr("myLocation"), - // Identifier: &armcompute.SharedGalleryIdentifier{ - // UniqueID: to.Ptr("/SharedGalleries/galleryUniqueName/Images/myGalleryImageName"), - // }, - // Properties: &armcompute.SharedGalleryImageProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-Official1PGallery": to.Ptr("Official1PGallery"), - // }, - // 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), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/sharedGalleryExamples/SharedGalleryImage_Get.json -func ExampleSharedGalleryImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSharedGalleryImagesClient().Get(ctx, "myLocation", "galleryUniqueName", "myGalleryImageName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharedGalleryImage = armcompute.SharedGalleryImage{ - // Name: to.Ptr("myGalleryImageName"), - // Location: to.Ptr("myLocation"), - // Identifier: &armcompute.SharedGalleryIdentifier{ - // UniqueID: to.Ptr("/SharedGalleries/galleryUniqueName/Images/myGalleryImageName"), - // }, - // Properties: &armcompute.SharedGalleryImageProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-Official1PGallery": to.Ptr("Official1PGallery"), - // }, - // Eula: to.Ptr("https://www.microsoft.com/en-us/"), - // 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), - // }, - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/sharedgalleryimageversions_client.go b/sdk/resourcemanager/compute/armcompute/sharedgalleryimageversions_client.go index 99a9c5a403cb..729b0e3c5d54 100644 --- a/sdk/resourcemanager/compute/armcompute/sharedgalleryimageversions_client.go +++ b/sdk/resourcemanager/compute/armcompute/sharedgalleryimageversions_client.go @@ -47,7 +47,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 2024-03-03 +// Generated from API version 2023-07-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. @@ -106,7 +106,7 @@ func (client *SharedGalleryImageVersionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +123,7 @@ func (client *SharedGalleryImageVersionsClient) getHandleResponse(resp *http.Res // NewListPager - List shared gallery image versions by subscription id or tenant id. // -// Generated from API version 2024-03-03 +// Generated from API version 2023-07-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. @@ -176,7 +176,7 @@ func (client *SharedGalleryImageVersionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") + reqQP.Set("api-version", "2023-07-03") if options != nil && options.SharedTo != nil { reqQP.Set("sharedTo", string(*options.SharedTo)) } diff --git a/sdk/resourcemanager/compute/armcompute/sharedgalleryimageversions_client_example_test.go b/sdk/resourcemanager/compute/armcompute/sharedgalleryimageversions_client_example_test.go deleted file mode 100644 index 6531e373ae68..000000000000 --- a/sdk/resourcemanager/compute/armcompute/sharedgalleryimageversions_client_example_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersions_List.json -func ExampleSharedGalleryImageVersionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSharedGalleryImageVersionsClient().NewListPager("myLocation", "galleryUniqueName", "myGalleryImageName", &armcompute.SharedGalleryImageVersionsClientListOptions{SharedTo: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SharedGalleryImageVersionList = armcompute.SharedGalleryImageVersionList{ - // Value: []*armcompute.SharedGalleryImageVersion{ - // { - // Name: to.Ptr("myGalleryImageVersionName"), - // Location: to.Ptr("myLocation"), - // Identifier: &armcompute.SharedGalleryIdentifier{ - // UniqueID: to.Ptr("/SharedGalleries/galleryUniqueName/Images/myGalleryImageName/Versions/myGalleryImageVersionName"), - // }, - // Properties: &armcompute.SharedGalleryImageVersionProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-Official1PGallery": to.Ptr("Official1PGallery"), - // }, - // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-20T09:12:28.000Z"); return t}()), - // ExcludeFromLatest: to.Ptr(false), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-20T09:12:28.000Z"); return t}()), - // StorageProfile: &armcompute.SharedGalleryImageVersionStorageProfile{ - // OSDiskImage: &armcompute.SharedGalleryOSDiskImage{ - // DiskSizeGB: to.Ptr[int32](29), - // HostCaching: to.Ptr(armcompute.SharedGalleryHostCachingNone), - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/sharedGalleryExamples/SharedGalleryImageVersion_Get.json -func ExampleSharedGalleryImageVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSharedGalleryImageVersionsClient().Get(ctx, "myLocation", "galleryUniqueName", "myGalleryImageName", "myGalleryImageVersionName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharedGalleryImageVersion = armcompute.SharedGalleryImageVersion{ - // Name: to.Ptr("myGalleryImageVersionName"), - // Location: to.Ptr("myLocation"), - // Identifier: &armcompute.SharedGalleryIdentifier{ - // UniqueID: to.Ptr("/SharedGalleries/galleryUniqueName/Images/myGalleryImageName/Versions/myGalleryImageVersionName"), - // }, - // Properties: &armcompute.SharedGalleryImageVersionProperties{ - // ArtifactTags: map[string]*string{ - // "ShareTag-Official1PGallery": to.Ptr("Official1PGallery"), - // }, - // EndOfLifeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-20T09:12:28.000Z"); return t}()), - // ExcludeFromLatest: to.Ptr(false), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-20T09:12:28.000Z"); return t}()), - // StorageProfile: &armcompute.SharedGalleryImageVersionStorageProfile{ - // OSDiskImage: &armcompute.SharedGalleryOSDiskImage{ - // DiskSizeGB: to.Ptr[int32](29), - // HostCaching: to.Ptr(armcompute.SharedGalleryHostCachingNone), - // }, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/skus_live_test.go b/sdk/resourcemanager/compute/armcompute/skus_live_test.go index d2b6222e420f..1929df46ddf8 100644 --- a/sdk/resourcemanager/compute/armcompute/skus_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/skus_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/snapshot_live_test.go b/sdk/resourcemanager/compute/armcompute/snapshot_live_test.go index 8e91ecd00e28..471e8801add0 100644 --- a/sdk/resourcemanager/compute/armcompute/snapshot_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/snapshot_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/snapshots_client_example_test.go b/sdk/resourcemanager/compute/armcompute/snapshots_client_example_test.go deleted file mode 100644 index ce8ed017321f..000000000000 --- a/sdk/resourcemanager/compute/armcompute/snapshots_client_example_test.go +++ /dev/null @@ -1,792 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromADifferentSubscription.json -func ExampleSnapshotsClient_BeginCreateOrUpdate_createASnapshotByImportingAnUnmanagedBlobFromADifferentSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armcompute.Snapshot{ - // Name: to.Ptr("mySnapshot1"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // 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"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_ByImportingAnUnmanagedBlobFromTheSameSubscription.json -func ExampleSnapshotsClient_BeginCreateOrUpdate_createASnapshotByImportingAnUnmanagedBlobFromTheSameSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().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"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armcompute.Snapshot{ - // Name: to.Ptr("mySnapshot1"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // 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"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_FromAnElasticSanVolumeSnapshot.json -func ExampleSnapshotsClient_BeginCreateOrUpdate_createASnapshotFromAnElasticSanVolumeSnapshot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot", armcompute.Snapshot{ - Location: to.Ptr("West US"), - Properties: &armcompute.SnapshotProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyFromSanSnapshot), - ElasticSanResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armcompute.Snapshot{ - // Name: to.Ptr("mySnapshot"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.SnapshotProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyFromSanSnapshot), - // ElasticSanResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ElasticSan/elasticSans/myElasticSan/volumegroups/myElasticSanVolumeGroup/snapshots/myElasticSanVolumeSnapshot"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_EnhancedProvisionedBandwidthCopySpeed.json -func ExampleSnapshotsClient_BeginCreateOrUpdate_createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegionWithQuickerCopySpeed() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot2", armcompute.Snapshot{ - Location: to.Ptr("West US"), - Properties: &armcompute.SnapshotProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyStart), - ProvisionedBandwidthCopySpeed: to.Ptr(armcompute.ProvisionedBandwidthCopyOptionEnhanced), - SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armcompute.Snapshot{ - // Name: to.Ptr("mySnapshot2"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.SnapshotProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyStart), - // ProvisionedBandwidthCopySpeed: to.Ptr(armcompute.ProvisionedBandwidthCopyOptionEnhanced), - // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshotInDifferentRegion.json -func ExampleSnapshotsClient_BeginCreateOrUpdate_createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscriptionInADifferentRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot2", armcompute.Snapshot{ - Location: to.Ptr("West US"), - Properties: &armcompute.SnapshotProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyStart), - SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armcompute.Snapshot{ - // Name: to.Ptr("mySnapshot2"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.SnapshotProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopyStart), - // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Create_FromAnExistingSnapshot.json -func ExampleSnapshotsClient_BeginCreateOrUpdate_createASnapshotFromAnExistingSnapshotInTheSameOrADifferentSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "mySnapshot2", armcompute.Snapshot{ - Location: to.Ptr("West US"), - Properties: &armcompute.SnapshotProperties{ - CreationData: &armcompute.CreationData{ - CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armcompute.Snapshot{ - // Name: to.Ptr("mySnapshot2"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.SnapshotProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Update_WithAcceleratedNetwork.json -func ExampleSnapshotsClient_BeginUpdate_updateASnapshotWithAcceleratedNetworking() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armcompute.Snapshot{ - // Name: to.Ptr("mySnapshot"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("UpdateSnapshots"), - // }, - // Properties: &armcompute.SnapshotProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - // }, - // DiskSizeGB: to.Ptr[int32](20), - // ProvisioningState: to.Ptr("Succeeded"), - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // AcceleratedNetwork: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Update.json -func ExampleSnapshotsClient_BeginUpdate_updateASnapshot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().BeginUpdate(ctx, "myResourceGroup", "mySnapshot", armcompute.SnapshotUpdate{ - Properties: &armcompute.SnapshotUpdateProperties{ - DiskSizeGB: to.Ptr[int32](20), - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armcompute.Snapshot{ - // Name: to.Ptr("mySnapshot"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("UpdateSnapshots"), - // }, - // Properties: &armcompute.SnapshotProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - // }, - // DiskSizeGB: to.Ptr[int32](20), - // ProvisioningState: to.Ptr("Succeeded"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Get.json -func ExampleSnapshotsClient_Get_getInformationAboutASnapshot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSnapshotsClient().Get(ctx, "myResourceGroup", "mySnapshot", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armcompute.Snapshot{ - // Name: to.Ptr("mySnapshot"), - // Type: to.Ptr("Microsoft.Compute/snapshots"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Snapshots"), - // }, - // Properties: &armcompute.SnapshotProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // SourceUniqueID: to.Ptr("d633885d-d102-4481-901e-5b2413d1a7be"), - // }, - // DiskSizeGB: to.Ptr[int32](100), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ - // Enabled: to.Ptr(true), - // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ - // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // }}, - // }, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // PurchasePlan: &armcompute.DiskPurchasePlan{ - // Name: to.Ptr("test_sku"), - // Product: to.Ptr("marketplace_vm_test"), - // Publisher: to.Ptr("test_test_pmc2pc1"), - // }, - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // AcceleratedNetwork: to.Ptr(true), - // }, - // SupportsHibernation: to.Ptr(true), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.079Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_GetIncrementalSnapshot.json -func ExampleSnapshotsClient_Get_getInformationAboutAnIncrementalSnapshot() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSnapshotsClient().Get(ctx, "myResourceGroup", "myIncrementalSnapshot", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Snapshot = armcompute.Snapshot{ - // Name: to.Ptr("myIncrementalSnapshot"), - // Type: to.Ptr("Microsoft.Compute/snapshots"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/myIncrementalSnapshot"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Snapshots"), - // }, - // Properties: &armcompute.SnapshotProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDisk"), - // SourceUniqueID: to.Ptr("d633885d-d102-4481-901e-5b2413d1a7be"), - // }, - // DiskSizeBytes: to.Ptr[int64](10737418240), - // DiskSizeGB: to.Ptr[int32](100), - // DiskState: to.Ptr(armcompute.DiskState("0")), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ - // Enabled: to.Ptr(true), - // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ - // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // }}, - // }, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationV1), - // Incremental: to.Ptr(true), - // IncrementalSnapshotFamilyID: to.Ptr("d1a341d5-1ea7-4a85-b304-944ad8021639"), - // NetworkAccessPolicy: to.Ptr(armcompute.NetworkAccessPolicy("0")), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // PurchasePlan: &armcompute.DiskPurchasePlan{ - // Name: to.Ptr("test_sku"), - // Product: to.Ptr("marketplace_vm_test"), - // Publisher: to.Ptr("test_test_pmc2pc1"), - // }, - // SupportedCapabilities: &armcompute.SupportedCapabilities{ - // AcceleratedNetwork: to.Ptr(true), - // }, - // SupportsHibernation: to.Ptr(true), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.079Z"); return t}()), - // UniqueID: to.Ptr("a395e9c1-fb9e-446e-a9ba-7b2fa0bcd305"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_Delete.json -func ExampleSnapshotsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_ListByResourceGroup.json -func ExampleSnapshotsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSnapshotsClient().NewListByResourceGroupPager("myResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SnapshotList = armcompute.SnapshotList{ - // Value: []*armcompute.Snapshot{ - // { - // Name: to.Ptr("mySnapshot"), - // Type: to.Ptr("Microsoft.Compute/snapshots"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Snapshots"), - // }, - // Properties: &armcompute.SnapshotProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ - // Enabled: to.Ptr(true), - // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ - // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // }}, - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:41:35.927Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_ListBySubscription.json -func ExampleSnapshotsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSnapshotsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SnapshotList = armcompute.SnapshotList{ - // Value: []*armcompute.Snapshot{ - // { - // Name: to.Ptr("mySnapshot1"), - // Type: to.Ptr("Microsoft.Compute/snapshots"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Snapshots"), - // }, - // Properties: &armcompute.SnapshotProperties{ - // CreationData: &armcompute.CreationData{ - // CreateOption: to.Ptr(armcompute.DiskCreateOptionCopy), - // SourceResourceID: to.Ptr("subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot"), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ - // Enabled: to.Ptr(true), - // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ - // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // }}, - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:47:30.663Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("mySnapshot2"), - // Type: to.Ptr("Microsoft.Compute/snapshots"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/mySnapshot2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "department": to.Ptr("Development"), - // "project": to.Ptr("Snapshots"), - // }, - // 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/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/myStorageAccount"), - // }, - // DiskSizeGB: to.Ptr[int32](200), - // Encryption: &armcompute.Encryption{ - // Type: to.Ptr(armcompute.EncryptionTypeEncryptionAtRestWithPlatformKey), - // }, - // EncryptionSettingsCollection: &armcompute.EncryptionSettingsCollection{ - // Enabled: to.Ptr(true), - // EncryptionSettings: []*armcompute.EncryptionSettingsElement{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultAndSecretReference{ - // SecretURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/secrets/{secret}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // KeyEncryptionKey: &armcompute.KeyVaultAndKeyReference{ - // KeyURL: to.Ptr("https://myvmvault.vault-int.azure-int.net/keys/{key}"), - // SourceVault: &armcompute.SourceVault{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVMVault"), - // }, - // }, - // }}, - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr("Succeeded"), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2016-12-28T04:47:30.324Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_BeginGetAccess.json -func ExampleSnapshotsClient_BeginGrantAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().BeginGrantAccess(ctx, "myResourceGroup", "mySnapshot", armcompute.GrantAccessData{ - Access: to.Ptr(armcompute.AccessLevelRead), - DurationInSeconds: to.Ptr[int32](300), - FileFormat: to.Ptr(armcompute.FileFormatVHDX), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessURI = armcompute.AccessURI{ - // AccessSAS: to.Ptr("https://md-gpvmcxzlzxgd.partition.blob.storage.azure.net/xx3cqcx53f0v/abcd?sv=2014-02-14&sr=b&sk=key1&sig=XXX&st=2021-05-24T18:02:34Z&se=2021-05-24T18:19:14Z&sp=r"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/DiskRP/stable/2024-03-02/examples/snapshotExamples/Snapshot_EndGetAccess.json -func ExampleSnapshotsClient_BeginRevokeAccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSnapshotsClient().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/softdeletedresource_client.go b/sdk/resourcemanager/compute/armcompute/softdeletedresource_client.go deleted file mode 100644 index bba9f53e2561..000000000000 --- a/sdk/resourcemanager/compute/armcompute/softdeletedresource_client.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armcompute - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SoftDeletedResourceClient contains the methods for the SoftDeletedResource group. -// Don't use this type directly, use NewSoftDeletedResourceClient() instead. -type SoftDeletedResourceClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSoftDeletedResourceClient creates a new instance of SoftDeletedResourceClient with the specified values. -// - subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSoftDeletedResourceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SoftDeletedResourceClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SoftDeletedResourceClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListByArtifactNamePager - List soft-deleted resources of an artifact in the gallery, such as soft-deleted gallery image -// version of an image. -// -// Generated from API version 2024-03-03 -// - resourceGroupName - The name of the resource group. -// - galleryName - The name of the Gallery in which the soft-deleted resources resides. -// - artifactType - The type of the artifact to be listed, such as gallery image version. -// - artifactName - The artifact name to be listed. If artifact type is Images, then the artifact name should be the gallery -// image name. -// - options - SoftDeletedResourceClientListByArtifactNameOptions contains the optional parameters for the SoftDeletedResourceClient.NewListByArtifactNamePager -// method. -func (client *SoftDeletedResourceClient) NewListByArtifactNamePager(resourceGroupName string, galleryName string, artifactType string, artifactName string, options *SoftDeletedResourceClientListByArtifactNameOptions) *runtime.Pager[SoftDeletedResourceClientListByArtifactNameResponse] { - return runtime.NewPager(runtime.PagingHandler[SoftDeletedResourceClientListByArtifactNameResponse]{ - More: func(page SoftDeletedResourceClientListByArtifactNameResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *SoftDeletedResourceClientListByArtifactNameResponse) (SoftDeletedResourceClientListByArtifactNameResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "SoftDeletedResourceClient.NewListByArtifactNamePager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByArtifactNameCreateRequest(ctx, resourceGroupName, galleryName, artifactType, artifactName, options) - }, nil) - if err != nil { - return SoftDeletedResourceClientListByArtifactNameResponse{}, err - } - return client.listByArtifactNameHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByArtifactNameCreateRequest creates the ListByArtifactName request. -func (client *SoftDeletedResourceClient) listByArtifactNameCreateRequest(ctx context.Context, resourceGroupName string, galleryName string, artifactType string, artifactName string, options *SoftDeletedResourceClientListByArtifactNameOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/softDeletedArtifactTypes/{artifactType}/artifacts/{artifactName}/versions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if galleryName == "" { - return nil, errors.New("parameter galleryName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{galleryName}", url.PathEscape(galleryName)) - if artifactType == "" { - return nil, errors.New("parameter artifactType cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{artifactType}", url.PathEscape(artifactType)) - if artifactName == "" { - return nil, errors.New("parameter artifactName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{artifactName}", url.PathEscape(artifactName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-03") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByArtifactNameHandleResponse handles the ListByArtifactName response. -func (client *SoftDeletedResourceClient) listByArtifactNameHandleResponse(resp *http.Response) (SoftDeletedResourceClientListByArtifactNameResponse, error) { - result := SoftDeletedResourceClientListByArtifactNameResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GallerySoftDeletedResourceList); err != nil { - return SoftDeletedResourceClientListByArtifactNameResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/compute/armcompute/softdeletedresource_client_example_test.go b/sdk/resourcemanager/compute/armcompute/softdeletedresource_client_example_test.go deleted file mode 100644 index ddbe747d37ca..000000000000 --- a/sdk/resourcemanager/compute/armcompute/softdeletedresource_client_example_test.go +++ /dev/null @@ -1,57 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2024-03-03/examples/galleryExamples/GallerySoftDeletedResource_ListByArtifactName.json -func ExampleSoftDeletedResourceClient_NewListByArtifactNamePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSoftDeletedResourceClient().NewListByArtifactNamePager("myResourceGroup", "myGalleryName", "images", "myGalleryImageName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GallerySoftDeletedResourceList = armcompute.GallerySoftDeletedResourceList{ - // Value: []*armcompute.GallerySoftDeletedResource{ - // { - // Name: to.Ptr("1.0.0"), - // Type: to.Ptr("Microsoft.Compute/galleries/softDeletedArtifactTypes/artifacts/versions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/softDeletedArtifactTypes/Images/artifacts/myGalleryImageName/versions/1.0.0"), - // Location: to.Ptr("West US"), - // Properties: &armcompute.GallerySoftDeletedResourceProperties{ - // ResourceArmID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/images/myGalleryImageName/versions/1.0.0"), - // SoftDeletedArtifactType: to.Ptr(armcompute.SoftDeletedArtifactTypesImages), - // SoftDeletedTime: to.Ptr("2024-10-17T13:01:05+00:00"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/sshpublickey_live_test.go b/sdk/resourcemanager/compute/armcompute/sshpublickey_live_test.go index 14d7eb8f2661..080f8d93317f 100644 --- a/sdk/resourcemanager/compute/armcompute/sshpublickey_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/sshpublickey_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/sshpublickeys_client.go b/sdk/resourcemanager/compute/armcompute/sshpublickeys_client.go index 9d2c4eec1a50..e802d7166f73 100644 --- a/sdk/resourcemanager/compute/armcompute/sshpublickeys_client.go +++ b/sdk/resourcemanager/compute/armcompute/sshpublickeys_client.go @@ -47,7 +47,7 @@ func NewSSHPublicKeysClient(subscriptionID string, credential azcore.TokenCreden // Create - Creates a new SSH public key resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - sshPublicKeyName - The name of the SSH public key. // - parameters - Parameters supplied to create the SSH public key. @@ -94,7 +94,7 @@ func (client *SSHPublicKeysClient) createCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -115,7 +115,7 @@ func (client *SSHPublicKeysClient) createHandleResponse(resp *http.Response) (SS // Delete - Delete an SSH public key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - sshPublicKeyName - The name of the SSH public key. // - options - SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method. @@ -160,7 +160,7 @@ func (client *SSHPublicKeysClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *SSHPublicKeysClient) deleteCreateRequest(ctx context.Context, reso // SSH public key resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - sshPublicKeyName - The name of the SSH public key. // - options - SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair @@ -218,7 +218,7 @@ func (client *SSHPublicKeysClient) generateKeyPairCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -242,7 +242,7 @@ func (client *SSHPublicKeysClient) generateKeyPairHandleResponse(resp *http.Resp // Get - Retrieves information about an SSH public key. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - sshPublicKeyName - The name of the SSH public key. // - options - SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method. @@ -288,7 +288,7 @@ func (client *SSHPublicKeysClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,7 +306,7 @@ func (client *SSHPublicKeysClient) getHandleResponse(resp *http.Response) (SSHPu // NewListByResourceGroupPager - Lists all of the SSH public keys in the specified resource group. Use the nextLink property // in the response to get the next page of SSH public keys. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - options - SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager // method. @@ -349,7 +349,7 @@ func (client *SSHPublicKeysClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -367,7 +367,7 @@ func (client *SSHPublicKeysClient) listByResourceGroupHandleResponse(resp *http. // NewListBySubscriptionPager - Lists all of the SSH public keys in the subscription. Use the nextLink property in the response // to get the next page of SSH public keys. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - options - SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager // method. func (client *SSHPublicKeysClient) NewListBySubscriptionPager(options *SSHPublicKeysClientListBySubscriptionOptions) *runtime.Pager[SSHPublicKeysClientListBySubscriptionResponse] { @@ -405,7 +405,7 @@ func (client *SSHPublicKeysClient) listBySubscriptionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -423,7 +423,7 @@ func (client *SSHPublicKeysClient) listBySubscriptionHandleResponse(resp *http.R // Update - Updates a new SSH public key resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - sshPublicKeyName - The name of the SSH public key. // - parameters - Parameters supplied to update the SSH public key. @@ -470,7 +470,7 @@ func (client *SSHPublicKeysClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/sshpublickeys_client_example_test.go b/sdk/resourcemanager/compute/armcompute/sshpublickeys_client_example_test.go deleted file mode 100644 index c0d3bee56c6d..000000000000 --- a/sdk/resourcemanager/compute/armcompute/sshpublickeys_client_example_test.go +++ /dev/null @@ -1,407 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MaximumSet_Gen.json -func ExampleSSHPublicKeysClient_NewListBySubscriptionPager_sshPublicKeyListBySubscriptionMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSSHPublicKeysClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SSHPublicKeysGroupListResult = armcompute.SSHPublicKeysGroupListResult{ - // Value: []*armcompute.SSHPublicKeyResource{ - // { - // Name: to.Ptr("mySshPublicKeyName"), - // Type: to.Ptr("aaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key6396": to.Ptr("aaaaaaaaaaaaa"), - // "key8839": to.Ptr("aaa"), - // }, - // Properties: &armcompute.SSHPublicKeyResourceProperties{ - // PublicKey: to.Ptr("{ssh-rsa public key}"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListBySubscription_MinimumSet_Gen.json -func ExampleSSHPublicKeysClient_NewListBySubscriptionPager_sshPublicKeyListBySubscriptionMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSSHPublicKeysClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SSHPublicKeysGroupListResult = armcompute.SSHPublicKeysGroupListResult{ - // Value: []*armcompute.SSHPublicKeyResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), - // Location: to.Ptr("westus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MaximumSet_Gen.json -func ExampleSSHPublicKeysClient_NewListByResourceGroupPager_sshPublicKeyListByResourceGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSSHPublicKeysClient().NewListByResourceGroupPager("rgcompute", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SSHPublicKeysGroupListResult = armcompute.SSHPublicKeysGroupListResult{ - // Value: []*armcompute.SSHPublicKeyResource{ - // { - // Name: to.Ptr("mySshPublicKeyName"), - // Type: to.Ptr("aaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key6396": to.Ptr("aaaaaaaaaaaaa"), - // "key8839": to.Ptr("aaa"), - // }, - // Properties: &armcompute.SSHPublicKeyResourceProperties{ - // PublicKey: to.Ptr("{ssh-rsa public key}"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_ListByResourceGroup_MinimumSet_Gen.json -func ExampleSSHPublicKeysClient_NewListByResourceGroupPager_sshPublicKeyListByResourceGroupMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSSHPublicKeysClient().NewListByResourceGroupPager("rgcompute", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SSHPublicKeysGroupListResult = armcompute.SSHPublicKeysGroupListResult{ - // Value: []*armcompute.SSHPublicKeyResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), - // Location: to.Ptr("westus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSSHPublicKeysClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SSHPublicKeyResource = armcompute.SSHPublicKeyResource{ - // Name: to.Ptr("mySshPublicKeyName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.SSHPublicKeyResourceProperties{ - // PublicKey: to.Ptr("{ssh-rsa public key}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MaximumSet_Gen.json -func ExampleSSHPublicKeysClient_Update_sshPublicKeyUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSSHPublicKeysClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SSHPublicKeyResource = armcompute.SSHPublicKeyResource{ - // Name: to.Ptr("mySshPublicKeyName"), - // Type: to.Ptr("aaaa"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/sshPublicKeys/mySshPublicKeyName"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key6396": to.Ptr("aaaaaaaaaaaaa"), - // "key8839": to.Ptr("aaa"), - // }, - // Properties: &armcompute.SSHPublicKeyResourceProperties{ - // PublicKey: to.Ptr("{ssh-rsa public key}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Update_MinimumSet_Gen.json -func ExampleSSHPublicKeysClient_Update_sshPublicKeyUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSSHPublicKeysClient().Update(ctx, "rgcompute", "aaaaaaaaaaa", armcompute.SSHPublicKeyUpdateResource{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SSHPublicKeyResource = armcompute.SSHPublicKeyResource{ - // Location: to.Ptr("westus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MaximumSet_Gen.json -func ExampleSSHPublicKeysClient_Delete_sshPublicKeyDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSSHPublicKeysClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_Delete_MinimumSet_Gen.json -func ExampleSSHPublicKeysClient_Delete_sshPublicKeyDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSSHPublicKeysClient().Delete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSSHPublicKeysClient().Get(ctx, "myResourceGroup", "mySshPublicKeyName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SSHPublicKeyResource = armcompute.SSHPublicKeyResource{ - // Name: to.Ptr("mySshPublicKeyName"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "{tagName}": to.Ptr("{tagValue}"), - // }, - // Properties: &armcompute.SSHPublicKeyResourceProperties{ - // PublicKey: to.Ptr("{ssh-rsa public key}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithEd25519.json -func ExampleSSHPublicKeysClient_GenerateKeyPair_generateAnSshKeyPairWithEd25519Encryption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSSHPublicKeysClient().GenerateKeyPair(ctx, "myResourceGroup", "mySshPublicKeyName", &armcompute.SSHPublicKeysClientGenerateKeyPairOptions{Parameters: &armcompute.SSHGenerateKeyPairInputParameters{ - EncryptionType: to.Ptr(armcompute.SSHEncryptionTypesEd25519), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SSHPublicKeyGenerateKeyPairResult = armcompute.SSHPublicKeyGenerateKeyPairResult{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"), - // PrivateKey: to.Ptr("{ssh-ed25519 private key}"), - // PublicKey: to.Ptr("{ssh-ed25519 public key}"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair_EncryptionWithRSA.json -func ExampleSSHPublicKeysClient_GenerateKeyPair_generateAnSshKeyPairWithRsaEncryption() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSSHPublicKeysClient().GenerateKeyPair(ctx, "myResourceGroup", "mySshPublicKeyName", &armcompute.SSHPublicKeysClientGenerateKeyPairOptions{Parameters: &armcompute.SSHGenerateKeyPairInputParameters{ - EncryptionType: to.Ptr(armcompute.SSHEncryptionTypesRSA), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SSHPublicKeyGenerateKeyPairResult = armcompute.SSHPublicKeyGenerateKeyPairResult{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"), - // PrivateKey: to.Ptr("{ssh-rsa private key}"), - // PublicKey: to.Ptr("{ssh-rsa public key}"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/sshPublicKeyExamples/SshPublicKey_GenerateKeyPair.json -func ExampleSSHPublicKeysClient_GenerateKeyPair_generateAnSshKeyPair() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSSHPublicKeysClient().GenerateKeyPair(ctx, "myResourceGroup", "mySshPublicKeyName", &armcompute.SSHPublicKeysClientGenerateKeyPairOptions{Parameters: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SSHPublicKeyGenerateKeyPairResult = armcompute.SSHPublicKeyGenerateKeyPairResult{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/SshPublicKeys/mySshPublicKeyName"), - // PrivateKey: to.Ptr("{ssh private key}"), - // PublicKey: to.Ptr("{ssh-rsa public key}"), - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/usage_client.go b/sdk/resourcemanager/compute/armcompute/usage_client.go index 43c66eabf88d..9be56207f2d4 100644 --- a/sdk/resourcemanager/compute/armcompute/usage_client.go +++ b/sdk/resourcemanager/compute/armcompute/usage_client.go @@ -47,7 +47,7 @@ func NewUsageClient(subscriptionID string, credential azcore.TokenCredential, op // NewListPager - Gets, for the specified location, the current compute resource usage information as well as the limits for // compute resources under the subscription. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The location for which resource usage is queried. // - options - UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method. func (client *UsageClient) NewListPager(location string, options *UsageClientListOptions) *runtime.Pager[UsageClientListResponse] { @@ -89,7 +89,7 @@ func (client *UsageClient) listCreateRequest(ctx context.Context, location strin return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/usage_client_example_test.go b/sdk/resourcemanager/compute/armcompute/usage_client_example_test.go deleted file mode 100644 index c56208ccf861..000000000000 --- a/sdk/resourcemanager/compute/armcompute/usage_client_example_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. -// DO NOT EDIT. - -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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/Usage_List_MaximumSet_Gen.json -func ExampleUsageClient_NewListPager_usageListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsageClient().NewListPager("4_.", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListUsagesResult = armcompute.ListUsagesResult{ - // Value: []*armcompute.Usage{ - // { - // Name: &armcompute.UsageName{ - // LocalizedValue: to.Ptr("aaaaaaaaaaaaaa"), - // Value: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }, - // CurrentValue: to.Ptr[int32](17), - // Limit: to.Ptr[int64](19), - // Unit: to.Ptr("Count"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/Usage_List_MinimumSet_Gen.json -func ExampleUsageClient_NewListPager_usageListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsageClient().NewListPager("_--", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListUsagesResult = armcompute.ListUsagesResult{ - // Value: []*armcompute.Usage{ - // { - // Name: &armcompute.UsageName{ - // }, - // CurrentValue: to.Ptr[int32](17), - // Limit: to.Ptr[int64](19), - // Unit: to.Ptr("Count"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachine_live_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachine_live_test.go index c8a520dd53bd..23ed8feaa963 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachine_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachine_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimage_live_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimage_live_test.go index e5d614ec5353..68ddbe0f93c9 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimage_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimage_live_test.go @@ -14,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimages_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimages_client.go index 15df55e25ab7..3b86e259e1a7 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimages_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimages_client.go @@ -48,7 +48,7 @@ func NewVirtualMachineExtensionImagesClient(subscriptionID string, credential az // Get - Gets a virtual machine extension image. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - options - VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get // method. @@ -102,7 +102,7 @@ func (client *VirtualMachineExtensionImagesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,7 +120,7 @@ func (client *VirtualMachineExtensionImagesClient) getHandleResponse(resp *http. // ListTypes - Gets a list of virtual machine extension image types. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - options - VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes // method. @@ -166,7 +166,7 @@ func (client *VirtualMachineExtensionImagesClient) listTypesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +184,7 @@ func (client *VirtualMachineExtensionImagesClient) listTypesHandleResponse(resp // ListVersions - Gets a list of virtual machine extension image versions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - options - VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions // method. @@ -243,7 +243,7 @@ func (client *VirtualMachineExtensionImagesClient) listVersionsCreateRequest(ctx if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimages_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimages_client_example_test.go deleted file mode 100644 index 58fe272c8329..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineextensionimages_client_example_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. -// DO NOT EDIT. - -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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionImagesClient_Get_virtualMachineExtensionImageGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineExtensionImagesClient().Get(ctx, "aaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtensionImage = armcompute.VirtualMachineExtensionImage{ - // Name: to.Ptr("aaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key9885": to.Ptr("aaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineExtensionImageProperties{ - // ComputeRole: to.Ptr("aaaaaaaaaaaaaaaaa"), - // HandlerSchema: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // OperatingSystem: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // SupportsMultipleExtensions: to.Ptr(true), - // VMScaleSetEnabled: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_Get_MinimumSet_Gen.json -func ExampleVirtualMachineExtensionImagesClient_Get_virtualMachineExtensionImageGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineExtensionImagesClient().Get(ctx, "aaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aa", "aaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtensionImage = armcompute.VirtualMachineExtensionImage{ - // Name: to.Ptr("aaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionImagesClient_ListTypes_virtualMachineExtensionImageListTypesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineExtensionImagesClient().ListTypes(ctx, "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtensionImageArray = []*armcompute.VirtualMachineExtensionImage{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key9885": to.Ptr("aaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineExtensionImageProperties{ - // ComputeRole: to.Ptr("aaaaaaaaaaaaaaaaa"), - // HandlerSchema: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // OperatingSystem: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // SupportsMultipleExtensions: to.Ptr(true), - // VMScaleSetEnabled: to.Ptr(true), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListTypes_MinimumSet_Gen.json -func ExampleVirtualMachineExtensionImagesClient_ListTypes_virtualMachineExtensionImageListTypesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineExtensionImagesClient().ListTypes(ctx, "aaaa", "aa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtensionImageArray = []*armcompute.VirtualMachineExtensionImage{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaa"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionImagesClient_ListVersions_virtualMachineExtensionImageListVersionsMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineExtensionImagesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtensionImageArray = []*armcompute.VirtualMachineExtensionImage{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key9885": to.Ptr("aaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineExtensionImageProperties{ - // ComputeRole: to.Ptr("aaaaaaaaaaaaaaaaa"), - // HandlerSchema: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // OperatingSystem: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // SupportsMultipleExtensions: to.Ptr(true), - // VMScaleSetEnabled: to.Ptr(true), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExtensionImageExamples/VirtualMachineExtensionImage_ListVersions_MinimumSet_Gen.json -func ExampleVirtualMachineExtensionImagesClient_ListVersions_virtualMachineExtensionImageListVersionsMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineExtensionImagesClient().ListVersions(ctx, "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaa", &armcompute.VirtualMachineExtensionImagesClientListVersionsOptions{Filter: nil, - Top: nil, - Orderby: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtensionImageArray = []*armcompute.VirtualMachineExtensionImage{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaa"), - // }} -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineextensions_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachineextensions_client.go index 6739023f15d2..2f7c9b8e8cf4 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineextensions_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachineextensions_client.go @@ -47,7 +47,7 @@ func NewVirtualMachineExtensionsClient(subscriptionID string, credential azcore. // BeginCreateOrUpdate - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine where the extension should be created or updated. // - vmExtensionName - The name of the virtual machine extension. @@ -74,7 +74,7 @@ func (client *VirtualMachineExtensionsClient) BeginCreateOrUpdate(ctx context.Co // CreateOrUpdate - The operation to create or update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, options *VirtualMachineExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineExtensionsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *VirtualMachineExtensionsClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { @@ -132,7 +132,7 @@ func (client *VirtualMachineExtensionsClient) createOrUpdateCreateRequest(ctx co // BeginDelete - The operation to delete the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine where the extension should be deleted. // - vmExtensionName - The name of the virtual machine extension. @@ -158,7 +158,7 @@ func (client *VirtualMachineExtensionsClient) BeginDelete(ctx context.Context, r // Delete - The operation to delete the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, options *VirtualMachineExtensionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineExtensionsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *VirtualMachineExtensionsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ func (client *VirtualMachineExtensionsClient) deleteCreateRequest(ctx context.Co // Get - The operation to get the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine containing the extension. // - vmExtensionName - The name of the virtual machine extension. @@ -268,7 +268,7 @@ func (client *VirtualMachineExtensionsClient) getCreateRequest(ctx context.Conte if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +286,7 @@ func (client *VirtualMachineExtensionsClient) getHandleResponse(resp *http.Respo // List - The operation to get all extensions of a Virtual Machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine containing the extension. // - options - VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List @@ -336,7 +336,7 @@ func (client *VirtualMachineExtensionsClient) listCreateRequest(ctx context.Cont if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +354,7 @@ func (client *VirtualMachineExtensionsClient) listHandleResponse(resp *http.Resp // BeginUpdate - The operation to update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine where the extension should be updated. // - vmExtensionName - The name of the virtual machine extension. @@ -381,7 +381,7 @@ func (client *VirtualMachineExtensionsClient) BeginUpdate(ctx context.Context, r // Update - The operation to update the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineExtensionsClient) update(ctx context.Context, resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtensionUpdate, options *VirtualMachineExtensionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineExtensionsClient.BeginUpdate" @@ -427,7 +427,7 @@ func (client *VirtualMachineExtensionsClient) updateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineextensions_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachineextensions_client_example_test.go deleted file mode 100644 index 5f810c904c43..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineextensions_client_example_test.go +++ /dev/null @@ -1,439 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_BeginCreateOrUpdate_virtualMachineExtensionCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineExtensionsClient().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]any{}, - Publisher: to.Ptr("extPublisher"), - Settings: map[string]any{}, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtension = armcompute.VirtualMachineExtension{ - // Name: to.Ptr("myVMExtension"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), - // 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]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("extPublisher"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_BeginCreateOrUpdate_virtualMachineExtensionCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineExtensionsClient().BeginCreateOrUpdate(ctx, "rgcompute", "myVM", "myVMExtension", armcompute.VirtualMachineExtension{ - Location: to.Ptr("westus"), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtension = armcompute.VirtualMachineExtension{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), - // Location: to.Ptr("westus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineExtensionsClient().BeginUpdate(ctx, "myResourceGroup", "myVM", "myVMExtension", armcompute.VirtualMachineExtensionUpdate{ - Properties: &armcompute.VirtualMachineExtensionUpdateProperties{ - Type: to.Ptr("extType"), - AutoUpgradeMinorVersion: to.Ptr(true), - ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ - SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), - SourceVault: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), - }, - }, - Publisher: to.Ptr("extPublisher"), - Settings: map[string]any{ - "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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtension = armcompute.VirtualMachineExtension{ - // Name: to.Ptr("myVMExtension"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("extType"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), - // SourceVault: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("extPublisher"), - // Settings: map[string]any{ - // "UserName": "xyz@microsoft.com", - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_BeginDelete_virtualMachineExtensionDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineExtensionsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Delete_MinimumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_BeginDelete_virtualMachineExtensionDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineExtensionsClient().BeginDelete(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_Get_virtualMachineExtensionGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineExtensionsClient().Get(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", &armcompute.VirtualMachineExtensionsClientGetOptions{Expand: to.Ptr("aaaaaa")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtension = armcompute.VirtualMachineExtension{ - // Name: to.Ptr("myVMExtension"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), - // 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]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("extPublisher"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_Get_MinimumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_Get_virtualMachineExtensionGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineExtensionsClient().Get(ctx, "rgcompute", "myVM", "myVMExtension", &armcompute.VirtualMachineExtensionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtension = armcompute.VirtualMachineExtension{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), - // Location: to.Ptr("westus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MaximumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_List_virtualMachineExtensionListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineExtensionsClient().List(ctx, "rgcompute", "aaaaaaaaaaaaa", &armcompute.VirtualMachineExtensionsClientListOptions{Expand: to.Ptr("aaaaaaaaaaaaaaaaa")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtensionsListResult = armcompute.VirtualMachineExtensionsListResult{ - // Value: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("myVMExtension"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/myVMExtension"), - // 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]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("extPublisher"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachineExtension_List_MinimumSet_Gen.json -func ExampleVirtualMachineExtensionsClient_List_virtualMachineExtensionListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineExtensionsClient().List(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineExtensionsClientListOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineExtensionsListResult = armcompute.VirtualMachineExtensionsListResult{ - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineimage_live_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachineimage_live_test.go index 6749560786a6..5f7632001037 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineimage_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachineimage_live_test.go @@ -14,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineimages_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachineimages_client.go index a19afb223ee0..a201d34558eb 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineimages_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachineimages_client.go @@ -48,7 +48,7 @@ func NewVirtualMachineImagesClient(subscriptionID string, credential azcore.Toke // Get - Gets a virtual machine image. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - publisherName - A valid image publisher. // - offer - A valid image publisher offer. @@ -110,7 +110,7 @@ func (client *VirtualMachineImagesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,7 +128,7 @@ func (client *VirtualMachineImagesClient) getHandleResponse(resp *http.Response) // List - Gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - publisherName - A valid image publisher. // - offer - A valid image publisher offer. @@ -194,7 +194,7 @@ func (client *VirtualMachineImagesClient) listCreateRequest(ctx context.Context, if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *VirtualMachineImagesClient) listHandleResponse(resp *http.Response // ListByEdgeZone - Gets a list of all virtual machine image versions for the specified edge zone // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - edgeZone - The name of the edge zone. // - options - VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone @@ -259,7 +259,7 @@ func (client *VirtualMachineImagesClient) listByEdgeZoneCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +277,7 @@ func (client *VirtualMachineImagesClient) listByEdgeZoneHandleResponse(resp *htt // ListOffers - Gets a list of virtual machine image offers for the specified location and publisher. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - publisherName - A valid image publisher. // - options - VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers @@ -324,7 +324,7 @@ func (client *VirtualMachineImagesClient) listOffersCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +342,7 @@ func (client *VirtualMachineImagesClient) listOffersHandleResponse(resp *http.Re // ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - options - VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers // method. @@ -384,7 +384,7 @@ func (client *VirtualMachineImagesClient) listPublishersCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +402,7 @@ func (client *VirtualMachineImagesClient) listPublishersHandleResponse(resp *htt // ListSKUs - Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - publisherName - A valid image publisher. // - offer - A valid image publisher offer. @@ -454,7 +454,7 @@ func (client *VirtualMachineImagesClient) listSKUsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineimages_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachineimages_client_example_test.go deleted file mode 100644 index 6e4c41c64399..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineimages_client_example_test.go +++ /dev/null @@ -1,408 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MaximumSet_Gen.json -func ExampleVirtualMachineImagesClient_Get_virtualMachineImageGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().Get(ctx, "aaaaaa", "aaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImage = armcompute.VirtualMachineImage{ - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaaa"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("aaaaa"), - // Tags: map[string]*string{ - // "key6817": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineImageProperties{ - // AutomaticOSUpgradeProperties: &armcompute.AutomaticOSUpgradeProperties{ - // AutomaticOSUpgradeSupported: to.Ptr(true), - // }, - // DataDiskImages: []*armcompute.DataDiskImage{ - // { - // Lun: to.Ptr[int32](17), - // }}, - // Disallowed: &armcompute.DisallowedConfiguration{ - // VMDiskType: to.Ptr(armcompute.VMDiskTypesNone), - // }, - // Features: []*armcompute.VirtualMachineImageFeature{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Value: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // }}, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypesV1), - // ImageDeprecationStatus: &armcompute.ImageDeprecationStatus{ - // AlternativeOption: &armcompute.AlternativeOption{ - // Type: to.Ptr(armcompute.AlternativeTypeOffer), - // Value: to.Ptr("aaaaaaa"), - // }, - // ImageState: to.Ptr(armcompute.ImageStateScheduledForDeprecation), - // ScheduledDeprecationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-13T00:00:00.000Z"); return t}()), - // }, - // OSDiskImage: &armcompute.OSDiskImage{ - // OperatingSystem: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // Plan: &armcompute.PurchasePlan{ - // Name: to.Ptr("aaaaaaaaa"), - // Product: to.Ptr("aaaaaaaaaaaaaa"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_Get_MinimumSet_Gen.json -func ExampleVirtualMachineImagesClient_Get_virtualMachineImageGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().Get(ctx, "aaaaaaaaaaaa", "aaaaaaaaaaa", "aa", "aaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImage = armcompute.VirtualMachineImage{ - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaaa"), - // Location: to.Ptr("aaaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MaximumSet_Gen.json -func ExampleVirtualMachineImagesClient_List_virtualMachineImageListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key7868": to.Ptr("aaaaa"), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_List_MinimumSet_Gen.json -func ExampleVirtualMachineImagesClient_List_virtualMachineImageListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().List(ctx, "aaaaaaa", "aaaaaaaaaaa", "aaaaaaaaaa", "aaaaaa", &armcompute.VirtualMachineImagesClientListOptions{Expand: nil, - Top: nil, - Orderby: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MaximumSet_Gen.json -func ExampleVirtualMachineImagesClient_ListOffers_virtualMachineImageListOffersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().ListOffers(ctx, "aaaaaaa", "aaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key7868": to.Ptr("aaaaa"), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListOffers_MinimumSet_Gen.json -func ExampleVirtualMachineImagesClient_ListOffers_virtualMachineImageListOffersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().ListOffers(ctx, "aaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MaximumSet_Gen.json -func ExampleVirtualMachineImagesClient_ListPublishers_virtualMachineImageListPublishersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().ListPublishers(ctx, "aaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key7868": to.Ptr("aaaaa"), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListPublishers_MinimumSet_Gen.json -func ExampleVirtualMachineImagesClient_ListPublishers_virtualMachineImageListPublishersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().ListPublishers(ctx, "aaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MaximumSet_Gen.json -func ExampleVirtualMachineImagesClient_ListSKUs_virtualMachineImageListSkusMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().ListSKUs(ctx, "aaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key7868": to.Ptr("aaaaa"), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImage_ListSkus_MinimumSet_Gen.json -func ExampleVirtualMachineImagesClient_ListSKUs_virtualMachineImageListSkusMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().ListSKUs(ctx, "aaaa", "aaaaaaaaaaaaa", "aaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MaximumSet_Gen.json -func ExampleVirtualMachineImagesClient_ListByEdgeZone_virtualMachineImagesEdgeZoneListByEdgeZoneMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().ListByEdgeZone(ctx, "WestUS", "microsoftlosangeles1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VMImagesInEdgeZoneListResult = armcompute.VMImagesInEdgeZoneListResult{ - // Value: []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("/Subscriptions/5ece5940-d962-4dad-a98f-ca9ac0f021a5/Providers/Microsoft.Compute/Locations/westus/Publishers/CANONICAL/ArtifactTypes/VMImage/Offers/UBUNTUSERVER/Skus/18_04-LTS-GEN2/Versions/18.04.202107200"), - // Name: to.Ptr("18.04.202107200"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("microsoftlosangeles1"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("WestUS"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListByEdgeZone_MinimumSet_Gen.json -func ExampleVirtualMachineImagesClient_ListByEdgeZone_virtualMachineImagesEdgeZoneListByEdgeZoneMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesClient().ListByEdgeZone(ctx, "WestUS", "microsoftlosangeles1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VMImagesInEdgeZoneListResult = armcompute.VMImagesInEdgeZoneListResult{ - // Value: []*armcompute.VirtualMachineImageResource{ - // }, - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineimagesedgezone_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachineimagesedgezone_client.go index fb12e032a289..cade53b667e6 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineimagesedgezone_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachineimagesedgezone_client.go @@ -48,7 +48,7 @@ func NewVirtualMachineImagesEdgeZoneClient(subscriptionID string, credential azc // Get - Gets a virtual machine image in an edge zone. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - edgeZone - The name of the edge zone. // - publisherName - A valid image publisher. @@ -115,7 +115,7 @@ func (client *VirtualMachineImagesEdgeZoneClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -133,7 +133,7 @@ func (client *VirtualMachineImagesEdgeZoneClient) getHandleResponse(resp *http.R // List - Gets a list of all virtual machine image versions for the specified location, edge zone, publisher, offer, and SKU. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - edgeZone - The name of the edge zone. // - publisherName - A valid image publisher. @@ -204,7 +204,7 @@ func (client *VirtualMachineImagesEdgeZoneClient) listCreateRequest(ctx context. if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -222,7 +222,7 @@ func (client *VirtualMachineImagesEdgeZoneClient) listHandleResponse(resp *http. // ListOffers - Gets a list of virtual machine image offers for the specified location, edge zone and publisher. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - edgeZone - The name of the edge zone. // - publisherName - A valid image publisher. @@ -274,7 +274,7 @@ func (client *VirtualMachineImagesEdgeZoneClient) listOffersCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,7 +292,7 @@ func (client *VirtualMachineImagesEdgeZoneClient) listOffersHandleResponse(resp // ListPublishers - Gets a list of virtual machine image publishers for the specified Azure location and edge zone. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - edgeZone - The name of the edge zone. // - options - VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers @@ -339,7 +339,7 @@ func (client *VirtualMachineImagesEdgeZoneClient) listPublishersCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -357,7 +357,7 @@ func (client *VirtualMachineImagesEdgeZoneClient) listPublishersHandleResponse(r // ListSKUs - Gets a list of virtual machine image SKUs for the specified location, edge zone, publisher, and offer. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The name of a supported Azure region. // - edgeZone - The name of the edge zone. // - publisherName - A valid image publisher. @@ -414,7 +414,7 @@ func (client *VirtualMachineImagesEdgeZoneClient) listSKUsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineimagesedgezone_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachineimagesedgezone_client_example_test.go deleted file mode 100644 index 4c1fedfa3c88..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineimagesedgezone_client_example_test.go +++ /dev/null @@ -1,344 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MaximumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_Get_virtualMachineImagesEdgeZoneGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().Get(ctx, "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImage = armcompute.VirtualMachineImage{ - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaaa"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("aaaaa"), - // Tags: map[string]*string{ - // "key6817": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineImageProperties{ - // AutomaticOSUpgradeProperties: &armcompute.AutomaticOSUpgradeProperties{ - // AutomaticOSUpgradeSupported: to.Ptr(true), - // }, - // DataDiskImages: []*armcompute.DataDiskImage{ - // { - // Lun: to.Ptr[int32](17), - // }}, - // Disallowed: &armcompute.DisallowedConfiguration{ - // VMDiskType: to.Ptr(armcompute.VMDiskTypesNone), - // }, - // Features: []*armcompute.VirtualMachineImageFeature{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Value: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // }}, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypesV1), - // OSDiskImage: &armcompute.OSDiskImage{ - // OperatingSystem: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // Plan: &armcompute.PurchasePlan{ - // Name: to.Ptr("aaaaaaaaa"), - // Product: to.Ptr("aaaaaaaaaaaaaa"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_Get_MinimumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_Get_virtualMachineImagesEdgeZoneGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().Get(ctx, "aaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaa", "aaaaaaaaaaaaaaaaaa", "aa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImage = armcompute.VirtualMachineImage{ - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaaa"), - // Location: to.Ptr("aaaaa"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MaximumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_List_virtualMachineImagesEdgeZoneListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key7868": to.Ptr("aaaaa"), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_List_MinimumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_List_virtualMachineImagesEdgeZoneListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().List(ctx, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaa", "aaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineImagesEdgeZoneClientListOptions{Expand: nil, - Top: nil, - Orderby: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MaximumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_ListOffers_virtualMachineImagesEdgeZoneListOffersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListOffers(ctx, "aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key7868": to.Ptr("aaaaa"), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListOffers_MinimumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_ListOffers_virtualMachineImagesEdgeZoneListOffersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListOffers(ctx, "aaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MaximumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_ListPublishers_virtualMachineImagesEdgeZoneListPublishersMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListPublishers(ctx, "aaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key7868": to.Ptr("aaaaa"), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListPublishers_MinimumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_ListPublishers_virtualMachineImagesEdgeZoneListPublishersMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListPublishers(ctx, "aaaa", "aaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MaximumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_ListSKUs_virtualMachineImagesEdgeZoneListSkusMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListSKUs(ctx, "aaaaaaaaaaaa", "aaaaa", "aaaaaaaaaaaa", "aaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key7868": to.Ptr("aaaaa"), - // }, - // }} -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineImageExamples/VirtualMachineImagesEdgeZone_ListSkus_MinimumSet_Gen.json -func ExampleVirtualMachineImagesEdgeZoneClient_ListSKUs_virtualMachineImagesEdgeZoneListSkusMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineImagesEdgeZoneClient().ListSKUs(ctx, "aaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaa", "aaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineImageResourceArray = []*armcompute.VirtualMachineImageResource{ - // { - // ID: to.Ptr("aaaaaaaaaaa"), - // Name: to.Ptr("aaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }} -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineruncommands_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachineruncommands_client.go index 9746d696a061..d4c813624520 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineruncommands_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachineruncommands_client.go @@ -47,7 +47,7 @@ func NewVirtualMachineRunCommandsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - The operation to create or update the run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine where the run command should be created or updated. // - runCommandName - The name of the virtual machine run command. @@ -74,7 +74,7 @@ func (client *VirtualMachineRunCommandsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - The operation to create or update the run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineRunCommandsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *VirtualMachineRunCommandsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} if err := runtime.MarshalAsJSON(req, runCommand); err != nil { @@ -132,7 +132,7 @@ func (client *VirtualMachineRunCommandsClient) createOrUpdateCreateRequest(ctx c // BeginDelete - The operation to delete the run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine where the run command should be deleted. // - runCommandName - The name of the virtual machine run command. @@ -158,7 +158,7 @@ func (client *VirtualMachineRunCommandsClient) BeginDelete(ctx context.Context, // Delete - The operation to delete the run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, options *VirtualMachineRunCommandsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineRunCommandsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *VirtualMachineRunCommandsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} return req, nil @@ -213,7 +213,7 @@ func (client *VirtualMachineRunCommandsClient) deleteCreateRequest(ctx context.C // Get - Gets specific run command for a subscription in a location. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The location upon which run commands is queried. // - commandID - The command id. // - options - VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get @@ -260,7 +260,7 @@ func (client *VirtualMachineRunCommandsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} return req, nil @@ -278,7 +278,7 @@ func (client *VirtualMachineRunCommandsClient) getHandleResponse(resp *http.Resp // GetByVirtualMachine - The operation to get the run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine containing the run command. // - runCommandName - The name of the virtual machine run command. @@ -333,7 +333,7 @@ func (client *VirtualMachineRunCommandsClient) getByVirtualMachineCreateRequest( if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} return req, nil @@ -350,7 +350,7 @@ func (client *VirtualMachineRunCommandsClient) getByVirtualMachineHandleResponse // NewListPager - Lists all available run commands for a subscription in a location. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The location upon which run commands is queried. // - options - VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager // method. @@ -393,7 +393,7 @@ func (client *VirtualMachineRunCommandsClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} return req, nil @@ -410,7 +410,7 @@ func (client *VirtualMachineRunCommandsClient) listHandleResponse(resp *http.Res // NewListByVirtualMachinePager - The operation to get all run commands of a Virtual Machine. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine containing the run command. // - options - VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager @@ -461,7 +461,7 @@ func (client *VirtualMachineRunCommandsClient) listByVirtualMachineCreateRequest if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} return req, nil @@ -479,7 +479,7 @@ func (client *VirtualMachineRunCommandsClient) listByVirtualMachineHandleRespons // BeginUpdate - The operation to update the run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine where the run command should be updated. // - runCommandName - The name of the virtual machine run command. @@ -506,7 +506,7 @@ func (client *VirtualMachineRunCommandsClient) BeginUpdate(ctx context.Context, // Update - The operation to update the run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineRunCommandsClient) update(ctx context.Context, resourceGroupName string, vmName string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineRunCommandsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineRunCommandsClient.BeginUpdate" @@ -552,7 +552,7 @@ func (client *VirtualMachineRunCommandsClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} if err := runtime.MarshalAsJSON(req, runCommand); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachineruncommands_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachineruncommands_client_example_test.go deleted file mode 100644 index 3624df2f0069..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachineruncommands_client_example_test.go +++ /dev/null @@ -1,452 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineRunCommandsClient().NewListPager("SoutheastAsia", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RunCommandListResult = armcompute.RunCommandListResult{ - // Value: []*armcompute.RunCommandDocumentBase{ - // { - // Description: to.Ptr("Configure the machine to enable remote PowerShell."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("EnableRemotePS"), - // Label: to.Ptr("Enable remote PowerShell"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // { - // Description: to.Ptr("Shows detailed information for the IP address, subnet mask and default gateway for each adapter bound to TCP/IP."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("IPConfig"), - // Label: to.Ptr("List IP configuration"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // { - // Description: to.Ptr("Custom multiline PowerShell script should be defined in script property. Optional parameters can be set in parameters property."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("RunPowerShellScript"), - // Label: to.Ptr("Executes a PowerShell script"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // { - // Description: to.Ptr("Custom multiline shell script should be defined in script property. Optional parameters can be set in parameters property."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("RunShellScript"), - // Label: to.Ptr("Executes a Linux shell script"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // { - // Description: to.Ptr("Get the configuration of all network interfaces."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("ifconfig"), - // Label: to.Ptr("List network configuration"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // { - // Description: to.Ptr("Checks if the local Administrator account is disabled, and if so enables it."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("EnableAdminAccount"), - // Label: to.Ptr("Enable administrator account"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // { - // Description: to.Ptr("Reset built-in Administrator account password."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("ResetAccountPassword"), - // Label: to.Ptr("Reset built-in Administrator account password"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // { - // Description: to.Ptr("Checks registry settings and domain policy settings. Suggests policy actions if machine is part of a domain or modifies the settings to default values."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("RDPSettings"), - // Label: to.Ptr("Verify RDP Listener Settings"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // { - // Description: to.Ptr("Sets the default or user specified port number for Remote Desktop connections. Enables firewall rule for inbound access to the port."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("SetRDPPort"), - // Label: to.Ptr("Set Remote Desktop port"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // { - // Description: to.Ptr("Removes the SSL certificate tied to the RDP listener and restores the RDP listerner security to default. Use this script if you see any issues with the certificate."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("ResetRDPCert"), - // Label: to.Ptr("Restore RDP Authentication mode to defaults"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineRunCommandsClient().Get(ctx, "SoutheastAsia", "RunPowerShellScript", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RunCommandDocument = armcompute.RunCommandDocument{ - // Description: to.Ptr("Custom multiline PowerShell script should be defined in script property. Optional parameters can be set in parameters property."), - // Schema: to.Ptr("http://schema.management.azure.com/schemas/2016-11-17/runcommands.json"), - // ID: to.Ptr("RunPowerShellScript"), - // Label: to.Ptr("Executes a PowerShell script"), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // Parameters: []*armcompute.RunCommandParameterDefinition{ - // { - // Name: to.Ptr("arg1"), - // Type: to.Ptr("string"), - // DefaultValue: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("arg2"), - // Type: to.Ptr("string"), - // DefaultValue: to.Ptr("value2"), - // }}, - // Script: []*string{ - // to.Ptr("param("), - // to.Ptr(" [string]$arg1,"), - // to.Ptr(" [string]$arg2"), - // to.Ptr(")"), - // to.Ptr("Write-Host This is a sample script with parameters $arg1 $arg2")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineRunCommandsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", "myRunCommand", armcompute.VirtualMachineRunCommand{ - Location: to.Ptr("West US"), - Properties: &armcompute.VirtualMachineRunCommandProperties{ - AsyncExecution: to.Ptr(false), - ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI"), - OutputBlobManagedIdentity: &armcompute.RunCommandManagedIdentity{ - ClientID: to.Ptr("22d35efb-0c99-4041-8c5b-6d24db33a69a"), - }, - OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - 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{ - ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/scriptURI"), - }, - TimeoutInSeconds: to.Ptr[int32](3600), - TreatFailureAsDeploymentFailure: to.Ptr(false), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ - // Name: to.Ptr("myRunCommand"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/runCommands"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/runCommands/myRunCommand"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armcompute.VirtualMachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // Parameters: []*armcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armcompute.VirtualMachineRunCommandScriptSource{ - // ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1"), - // }, - // TimeoutInSeconds: to.Ptr[int32](3600), - // TreatFailureAsDeploymentFailure: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineRunCommandsClient().BeginUpdate(ctx, "myResourceGroup", "myVM", "myRunCommand", armcompute.VirtualMachineRunCommandUpdate{ - Properties: &armcompute.VirtualMachineRunCommandProperties{ - AsyncExecution: to.Ptr(false), - ErrorBlobManagedIdentity: &armcompute.RunCommandManagedIdentity{ - ObjectID: to.Ptr("4231e4d2-33e4-4e23-96b2-17888afa6072"), - }, - ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/outputUri"), - 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! ; Remove-Item C: est estFile.txt"), - }, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ - // Name: to.Ptr("myRunCommand"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/runCommands"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/runCommands/myRunCommand"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armcompute.VirtualMachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // Parameters: []*armcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armcompute.VirtualMachineRunCommandScriptSource{ - // Script: to.Ptr("Write-Host Hello World! ; Remove-Item C: est estFile.txt"), - // }, - // TimeoutInSeconds: to.Ptr[int32](3600), - // TreatFailureAsDeploymentFailure: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineRunCommandsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineRunCommandsClient().GetByVirtualMachine(ctx, "myResourceGroup", "myVM", "myRunCommand", &armcompute.VirtualMachineRunCommandsClientGetByVirtualMachineOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ - // Name: to.Ptr("myRunCommand"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/runCommands"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/runCommands/myRunCommand"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armcompute.VirtualMachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // Parameters: []*armcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armcompute.VirtualMachineRunCommandScriptSource{ - // Script: to.Ptr("Write-Host Hello World! ; Remove-Item C: est estFile.txt"), - // }, - // TimeoutInSeconds: to.Ptr[int32](3600), - // TreatFailureAsDeploymentFailure: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineRunCommandsClient().NewListByVirtualMachinePager("myResourceGroup", "myVM", &armcompute.VirtualMachineRunCommandsClientListByVirtualMachineOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineRunCommandsListResult = armcompute.VirtualMachineRunCommandsListResult{ - // Value: []*armcompute.VirtualMachineRunCommand{ - // { - // Name: to.Ptr("myRunCommand"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/runCommands"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/runCommands/myRunCommand"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armcompute.VirtualMachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // Parameters: []*armcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armcompute.VirtualMachineRunCommandScriptSource{ - // Script: to.Ptr("Write-Host Hello World!"), - // }, - // TimeoutInSeconds: to.Ptr[int32](0), - // TreatFailureAsDeploymentFailure: to.Ptr(false), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachines_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachines_client.go index 17e04017b88b..137611345867 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachines_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachines_client.go @@ -48,7 +48,7 @@ func NewVirtualMachinesClient(subscriptionID string, credential azcore.TokenCred // BeginAssessPatches - Assess patches on the VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches @@ -74,7 +74,7 @@ func (client *VirtualMachinesClient) BeginAssessPatches(ctx context.Context, res // AssessPatches - Assess patches on the VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) assessPatches(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginAssessPatchesOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginAssessPatches" @@ -116,7 +116,7 @@ func (client *VirtualMachinesClient) assessPatchesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,7 +125,7 @@ func (client *VirtualMachinesClient) assessPatchesCreateRequest(ctx context.Cont // BeginAttachDetachDataDisks - Attach and detach data disks to/from the virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - parameters - Parameters supplied to the attach and detach data disks operation on the virtual machine. @@ -152,7 +152,7 @@ func (client *VirtualMachinesClient) BeginAttachDetachDataDisks(ctx context.Cont // AttachDetachDataDisks - Attach and detach data disks to/from the virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) attachDetachDataDisks(ctx context.Context, resourceGroupName string, vmName string, parameters AttachDetachDataDisksRequest, options *VirtualMachinesClientBeginAttachDetachDataDisksOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginAttachDetachDataDisks" @@ -194,7 +194,7 @@ func (client *VirtualMachinesClient) attachDetachDataDisksCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -207,7 +207,7 @@ func (client *VirtualMachinesClient) attachDetachDataDisksCreateRequest(ctx cont // similar VMs. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - parameters - Parameters supplied to the Capture Virtual Machine operation. @@ -235,7 +235,7 @@ func (client *VirtualMachinesClient) BeginCapture(ctx context.Context, resourceG // VMs. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) capture(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, options *VirtualMachinesClientBeginCaptureOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginCapture" @@ -277,7 +277,7 @@ func (client *VirtualMachinesClient) captureCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -290,7 +290,7 @@ func (client *VirtualMachinesClient) captureCreateRequest(ctx context.Context, r // before invoking this operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks @@ -316,7 +316,7 @@ func (client *VirtualMachinesClient) BeginConvertToManagedDisks(ctx context.Cont // before invoking this operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) convertToManagedDisks(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginConvertToManagedDisksOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginConvertToManagedDisks" @@ -358,7 +358,7 @@ func (client *VirtualMachinesClient) convertToManagedDisksCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -368,7 +368,7 @@ func (client *VirtualMachinesClient) convertToManagedDisksCreateRequest(ctx cont // during virtual machine creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - parameters - Parameters supplied to the Create Virtual Machine operation. @@ -395,7 +395,7 @@ func (client *VirtualMachinesClient) BeginCreateOrUpdate(ctx context.Context, re // virtual machine creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachine, options *VirtualMachinesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginCreateOrUpdate" @@ -437,7 +437,7 @@ func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -456,7 +456,7 @@ func (client *VirtualMachinesClient) createOrUpdateCreateRequest(ctx context.Con // resources that this virtual machine uses. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate @@ -482,7 +482,7 @@ func (client *VirtualMachinesClient) BeginDeallocate(ctx context.Context, resour // that this virtual machine uses. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) deallocate(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeallocateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginDeallocate" @@ -524,7 +524,7 @@ func (client *VirtualMachinesClient) deallocateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.Hibernate != nil { reqQP.Set("hibernate", strconv.FormatBool(*options.Hibernate)) } @@ -536,7 +536,7 @@ func (client *VirtualMachinesClient) deallocateCreateRequest(ctx context.Context // BeginDelete - The operation to delete a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete @@ -561,7 +561,7 @@ func (client *VirtualMachinesClient) BeginDelete(ctx context.Context, resourceGr // Delete - The operation to delete a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) deleteOperation(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginDelete" @@ -603,7 +603,7 @@ func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.ForceDeletion != nil { reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) } @@ -619,7 +619,7 @@ func (client *VirtualMachinesClient) deleteCreateRequest(ctx context.Context, re // [https://docs.microsoft.com/azure/virtual-machines/linux/capture-image]. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize @@ -665,7 +665,7 @@ func (client *VirtualMachinesClient) generalizeCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -674,7 +674,7 @@ func (client *VirtualMachinesClient) generalizeCreateRequest(ctx context.Context // Get - Retrieves information about the model view or the instance view of a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. @@ -723,7 +723,7 @@ func (client *VirtualMachinesClient) getCreateRequest(ctx context.Context, resou if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -741,7 +741,7 @@ func (client *VirtualMachinesClient) getHandleResponse(resp *http.Response) (Vir // BeginInstallPatches - Installs patches on the VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - installPatchesInput - Input for InstallPatches as directly received by the API @@ -768,7 +768,7 @@ func (client *VirtualMachinesClient) BeginInstallPatches(ctx context.Context, re // InstallPatches - Installs patches on the VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) installPatches(ctx context.Context, resourceGroupName string, vmName string, installPatchesInput VirtualMachineInstallPatchesParameters, options *VirtualMachinesClientBeginInstallPatchesOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginInstallPatches" @@ -810,7 +810,7 @@ func (client *VirtualMachinesClient) installPatchesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, installPatchesInput); err != nil { @@ -822,7 +822,7 @@ func (client *VirtualMachinesClient) installPatchesCreateRequest(ctx context.Con // InstanceView - Retrieves information about the run-time state of a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView @@ -869,7 +869,7 @@ func (client *VirtualMachinesClient) instanceViewCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -887,7 +887,7 @@ func (client *VirtualMachinesClient) instanceViewHandleResponse(resp *http.Respo // NewListPager - Lists all of the virtual machines in the specified resource group. Use the nextLink property in the response // to get the next page of virtual machines. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - options - VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager // method. @@ -936,7 +936,7 @@ func (client *VirtualMachinesClient) listCreateRequest(ctx context.Context, reso if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -954,7 +954,7 @@ func (client *VirtualMachinesClient) listHandleResponse(resp *http.Response) (Vi // NewListAllPager - Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response // to get the next page of virtual machines. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - options - VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager // method. func (client *VirtualMachinesClient) NewListAllPager(options *VirtualMachinesClientListAllOptions) *runtime.Pager[VirtualMachinesClientListAllResponse] { @@ -998,7 +998,7 @@ func (client *VirtualMachinesClient) listAllCreateRequest(ctx context.Context, o if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.StatusOnly != nil { reqQP.Set("statusOnly", *options.StatusOnly) } @@ -1018,7 +1018,7 @@ func (client *VirtualMachinesClient) listAllHandleResponse(resp *http.Response) // NewListAvailableSizesPager - Lists all available virtual machine sizes to which the specified virtual machine can be resized. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager @@ -1067,7 +1067,7 @@ func (client *VirtualMachinesClient) listAvailableSizesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1084,7 +1084,7 @@ func (client *VirtualMachinesClient) listAvailableSizesHandleResponse(resp *http // NewListByLocationPager - Gets all the virtual machines under the specified subscription for the specified location. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The location for which virtual machines under the subscription are queried. // - options - VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager // method. @@ -1127,7 +1127,7 @@ func (client *VirtualMachinesClient) listByLocationCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1145,7 +1145,7 @@ func (client *VirtualMachinesClient) listByLocationHandleResponse(resp *http.Res // BeginPerformMaintenance - The operation to perform maintenance on a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance @@ -1170,7 +1170,7 @@ func (client *VirtualMachinesClient) BeginPerformMaintenance(ctx context.Context // PerformMaintenance - The operation to perform maintenance on a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) performMaintenance(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPerformMaintenanceOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginPerformMaintenance" @@ -1212,18 +1212,17 @@ func (client *VirtualMachinesClient) performMaintenanceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginPowerOff - The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same -// provisioned resources. You are still charged for this virtual machine. NOTE: This operation is -// not allowed on a virtual machine that is being deallocated or has already been deallocated. +// provisioned resources. You are still charged for this virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff @@ -1246,11 +1245,10 @@ func (client *VirtualMachinesClient) BeginPowerOff(ctx context.Context, resource } // PowerOff - The operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same provisioned -// resources. You are still charged for this virtual machine. NOTE: This operation is -// not allowed on a virtual machine that is being deallocated or has already been deallocated. +// resources. You are still charged for this virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) powerOff(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginPowerOffOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginPowerOff" @@ -1292,7 +1290,7 @@ func (client *VirtualMachinesClient) powerOffCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.SkipShutdown != nil { reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) } @@ -1304,7 +1302,7 @@ func (client *VirtualMachinesClient) powerOffCreateRequest(ctx context.Context, // BeginReapply - The operation to reapply a virtual machine's state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply @@ -1329,7 +1327,7 @@ func (client *VirtualMachinesClient) BeginReapply(ctx context.Context, resourceG // Reapply - The operation to reapply a virtual machine's state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) reapply(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReapplyOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginReapply" @@ -1371,7 +1369,7 @@ func (client *VirtualMachinesClient) reapplyCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1380,7 +1378,7 @@ func (client *VirtualMachinesClient) reapplyCreateRequest(ctx context.Context, r // BeginRedeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy @@ -1405,7 +1403,7 @@ func (client *VirtualMachinesClient) BeginRedeploy(ctx context.Context, resource // Redeploy - Shuts down the virtual machine, moves it to a new node, and powers it back on. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) redeploy(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRedeployOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginRedeploy" @@ -1447,7 +1445,7 @@ func (client *VirtualMachinesClient) redeployCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1460,7 +1458,7 @@ func (client *VirtualMachinesClient) redeployCreateRequest(ctx context.Context, // will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage @@ -1489,7 +1487,7 @@ func (client *VirtualMachinesClient) BeginReimage(ctx context.Context, resourceG // will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) reimage(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginReimageOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginReimage" @@ -1531,7 +1529,7 @@ func (client *VirtualMachinesClient) reimageCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -1546,7 +1544,7 @@ func (client *VirtualMachinesClient) reimageCreateRequest(ctx context.Context, r // BeginRestart - The operation to restart a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart @@ -1571,7 +1569,7 @@ func (client *VirtualMachinesClient) BeginRestart(ctx context.Context, resourceG // Restart - The operation to restart a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) restart(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginRestart" @@ -1613,7 +1611,7 @@ func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1622,7 +1620,7 @@ func (client *VirtualMachinesClient) restartCreateRequest(ctx context.Context, r // RetrieveBootDiagnosticsData - The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData @@ -1669,7 +1667,7 @@ func (client *VirtualMachinesClient) retrieveBootDiagnosticsDataCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.SasURIExpirationTimeInMinutes != nil { reqQP.Set("sasUriExpirationTimeInMinutes", strconv.FormatInt(int64(*options.SasURIExpirationTimeInMinutes), 10)) } @@ -1690,7 +1688,7 @@ func (client *VirtualMachinesClient) retrieveBootDiagnosticsDataHandleResponse(r // BeginRunCommand - Run command on the VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - parameters - Parameters supplied to the Run command operation. @@ -1717,7 +1715,7 @@ func (client *VirtualMachinesClient) BeginRunCommand(ctx context.Context, resour // RunCommand - Run command on the VM. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) runCommand(ctx context.Context, resourceGroupName string, vmName string, parameters RunCommandInput, options *VirtualMachinesClientBeginRunCommandOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginRunCommand" @@ -1759,7 +1757,7 @@ func (client *VirtualMachinesClient) runCommandCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1771,7 +1769,7 @@ func (client *VirtualMachinesClient) runCommandCreateRequest(ctx context.Context // SimulateEviction - The operation to simulate the eviction of spot virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction @@ -1817,7 +1815,7 @@ func (client *VirtualMachinesClient) simulateEvictionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1826,7 +1824,7 @@ func (client *VirtualMachinesClient) simulateEvictionCreateRequest(ctx context.C // BeginStart - The operation to start a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - options - VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart @@ -1851,7 +1849,7 @@ func (client *VirtualMachinesClient) BeginStart(ctx context.Context, resourceGro // Start - The operation to start a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) start(ctx context.Context, resourceGroupName string, vmName string, options *VirtualMachinesClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginStart" @@ -1893,7 +1891,7 @@ func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1902,7 +1900,7 @@ func (client *VirtualMachinesClient) startCreateRequest(ctx context.Context, res // BeginUpdate - The operation to update a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmName - The name of the virtual machine. // - parameters - Parameters supplied to the Update Virtual Machine operation. @@ -1928,7 +1926,7 @@ func (client *VirtualMachinesClient) BeginUpdate(ctx context.Context, resourceGr // Update - The operation to update a virtual machine. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachinesClient) update(ctx context.Context, resourceGroupName string, vmName string, parameters VirtualMachineUpdate, options *VirtualMachinesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachinesClient.BeginUpdate" @@ -1970,7 +1968,7 @@ func (client *VirtualMachinesClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachines_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachines_client_example_test.go deleted file mode 100644 index 2703cf47a99e..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachines_client_example_test.go +++ /dev/null @@ -1,10070 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachinesClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineListResult = armcompute.VirtualMachineListResult{ - // Value: []*armcompute.VirtualMachine{ - // { - // Name: to.Ptr("{virtualMachineName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "RG": to.Ptr("rg"), - // "testTag": to.Ptr("1"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // AvailabilitySet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("Foo12"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("Test"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("2012-R2-Datacenter"), - // Version: to.Ptr("4.127.20170406"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("test"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](127), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // Vhd: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), - // }, - // }, - // }, - // VMID: to.Ptr("{vmId}"), - // }, - // }, - // { - // Name: to.Ptr("{virtualMachineName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "RG": to.Ptr("rg"), - // "testTag": to.Ptr("1"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // AvailabilitySet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("Foo12"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("Test"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("2012-R2-Datacenter"), - // Version: to.Ptr("4.127.20170406"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("test"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](127), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // Vhd: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), - // }, - // }, - // }, - // VMID: to.Ptr("{vmId}"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Capture_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginCapture_virtualMachineCaptureMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineCaptureResult = armcompute.VirtualMachineCaptureResult{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Schema: to.Ptr("aaaaa"), - // ContentVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Parameters: map[string]any{ - // }, - // Resources: []any{ - // map[string]any{ - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Capture_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_BeginCapture_virtualMachineCaptureMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCapture(ctx, "rgcompute", "aaaaaaaaaaaaa", 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineCaptureResult = armcompute.VirtualMachineCaptureResult{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingAssessmentModeOfImageDefault.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createALinuxVmWithAPatchSettingAssessmentModeOfImageDefault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // PatchSettings: &armcompute.LinuxPatchSettings{ - // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeImageDefault), - // }, - // ProvisionVMAgent: to.Ptr(true), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithAutomaticByPlatformSettings.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createALinuxVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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.LinuxPatchAssessmentModeAutomaticByPlatform), - AutomaticByPlatformSettings: &armcompute.LinuxVMGuestPatchAutomaticByPlatformSettings{ - BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - RebootSetting: to.Ptr(armcompute.LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever), - }, - PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeAutomaticByPlatform), - }, - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // PatchSettings: &armcompute.LinuxPatchSettings{ - // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeAutomaticByPlatform), - // AutomaticByPlatformSettings: &armcompute.LinuxVMGuestPatchAutomaticByPlatformSettings{ - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(true), - // RebootSetting: to.Ptr(armcompute.LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever), - // }, - // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeAutomaticByPlatform), - // }, - // ProvisionVMAgent: to.Ptr(true), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModeOfImageDefault.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createALinuxVmWithAPatchSettingPatchModeOfImageDefault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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{ - PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), - }, - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // PatchSettings: &armcompute.LinuxPatchSettings{ - // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeImageDefault), - // }, - // ProvisionVMAgent: to.Ptr(true), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_LinuxVmWithPatchSettingModesOfAutomaticByPlatform.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createALinuxVmWithAPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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.LinuxPatchAssessmentModeAutomaticByPlatform), - PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeAutomaticByPlatform), - }, - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // PatchSettings: &armcompute.LinuxPatchSettings{ - // AssessmentMode: to.Ptr(armcompute.LinuxPatchAssessmentModeAutomaticByPlatform), - // PatchMode: to.Ptr(armcompute.LinuxVMGuestPatchModeAutomaticByPlatform), - // }, - // ProvisionVMAgent: to.Ptr(true), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACommunityGalleryImage.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmFromACommunityGalleryImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - CommunityGalleryImageID: to.Ptr("/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName"), - }, - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // CommunityGalleryImageID: to.Ptr("/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("71aa3d5a-d73d-4970-9182-8580433b2865"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASharedGalleryImage.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmFromASharedGalleryImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - SharedGalleryImageID: to.Ptr("/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName"), - }, - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // SharedGalleryImageID: to.Ptr("/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("71aa3d5a-d73d-4970-9182-8580433b2865"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskControllerType.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithDiskControllerType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), - }, - }, - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD4V3), - }, - 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"), - }, - ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - Enable: to.Ptr(true), - }, - }, - UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - AutomaticallyApprove: to.Ptr(true), - }, - UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - AutomaticallyApprove: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), - 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), - }, - }, - }, - UserData: to.Ptr("U29tZSBDdXN0b20gRGF0YQ=="), - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD4V3), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - // Enable: to.Ptr(true), - // }, - // }, - // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithHibernationEnabled.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithHibernationEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ - Location: to.Ptr("eastus2euap"), - Properties: &armcompute.VirtualMachineProperties{ - AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - HibernationEnabled: to.Ptr(true), - }, - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), - }, - }, - 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("{vm-name}"), - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("2019-Datacenter"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("vmOSdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("{vm-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.VirtualMachineProperties{ - // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - // HibernationEnabled: to.Ptr(true), - // }, - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("{vm-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("2019-Datacenter"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("vmOSdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithProxyAgentSettings.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithProxyAgentSettingsOfEnabledAndMode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - ProxyAgentSettings: &armcompute.ProxyAgentSettings{ - Enabled: to.Ptr(true), - Mode: to.Ptr(armcompute.ModeEnforce), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("2019-Datacenter"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.SecurityProfile{ - // ProxyAgentSettings: &armcompute.ProxyAgentSettings{ - // Enabled: to.Ptr(true), - // Mode: to.Ptr(armcompute.ModeEnforce), - // }, - // }, - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("2019-Datacenter"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUefiSettings.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithUefiSettingsOfSecureBootAndVTpm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), - UefiSettings: &armcompute.UefiSettings{ - SecureBootEnabled: to.Ptr(true), - VTpmEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("windowsserver-gen2preview-preview"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("windows10-tvm"), - Version: to.Ptr("18363.592.2001092016"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.SecurityProfile{ - // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), - // UefiSettings: &armcompute.UefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // VTpmEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("windowsserver-gen2preview-preview"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("windows10-tvm"), - // Version: to.Ptr("18363.592.2001092016"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithUserData.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithUserData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), - }, - }, - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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("{vm-name}"), - }, - StorageProfile: &armcompute.StorageProfile{ - 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("vmOSdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("{vm-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("{vm-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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("vmOSdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithVMSizeProperties.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithVmSizeProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), - }, - }, - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD4V3), - VMSizeProperties: &armcompute.VMSizeProperties{ - VCPUsAvailable: to.Ptr[int32](1), - VCPUsPerCore: to.Ptr[int32](1), - }, - }, - 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{ - 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), - }, - }, - }, - UserData: to.Ptr("U29tZSBDdXN0b20gRGF0YQ=="), - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD4V3), - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](1), - // VCPUsPerCore: to.Ptr[int32](1), - // }, - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionIdentity.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithEncryptionIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Identity: &armcompute.VirtualMachineIdentity{ - Type: to.Ptr(armcompute.ResourceIdentityTypeUserAssigned), - UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}, - }, - }, - 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"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - EncryptionIdentity: &armcompute.EncryptionIdentity{ - UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("2019-Datacenter"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Identity: &armcompute.VirtualMachineIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": &armcompute.UserAssignedIdentitiesValue{ - // }, - // }, - // }, - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.SecurityProfile{ - // EncryptionIdentity: &armcompute.EncryptionIdentity{ - // UserAssignedIdentityResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), - // }, - // }, - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("2019-Datacenter"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfiguration.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithNetworkInterfaceConfiguration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - NetworkProfile: &armcompute.NetworkProfile{ - NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), - NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ - { - Name: to.Ptr("{nic-config-name}"), - Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ - { - Name: to.Ptr("{ip-config-name}"), - Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ - Primary: to.Ptr(true), - PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ - Name: to.Ptr("{publicIP-config-name}"), - Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDetach), - PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodStatic), - }, - SKU: &armcompute.PublicIPAddressSKU{ - Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), - Tier: to.Ptr(armcompute.PublicIPAddressSKUTierGlobal), - }, - }, - }, - }}, - Primary: to.Ptr(true), - }, - }}, - }, - OSProfile: &armcompute.OSProfile{ - AdminPassword: to.Ptr("{your-password}"), - AdminUsername: to.Ptr("{your-username}"), - ComputerName: to.Ptr("myVM"), - }, - StorageProfile: &armcompute.StorageProfile{ - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/toBeCreatedNetworkInterface"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithNetworkInterfaceConfigurationDnsSettings.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithNetworkInterfaceConfigurationWithPublicIpAddressDnsSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - NetworkProfile: &armcompute.NetworkProfile{ - NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), - NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ - { - Name: to.Ptr("{nic-config-name}"), - Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - IPConfigurations: []*armcompute.VirtualMachineNetworkInterfaceIPConfiguration{ - { - Name: to.Ptr("{ip-config-name}"), - Properties: &armcompute.VirtualMachineNetworkInterfaceIPConfigurationProperties{ - Primary: to.Ptr(true), - PublicIPAddressConfiguration: &armcompute.VirtualMachinePublicIPAddressConfiguration{ - Name: to.Ptr("{publicIP-config-name}"), - Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ - DeleteOption: to.Ptr(armcompute.DeleteOptionsDetach), - DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ - DomainNameLabel: to.Ptr("aaaaa"), - DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesTenantReuse), - }, - PublicIPAllocationMethod: to.Ptr(armcompute.PublicIPAllocationMethodStatic), - }, - SKU: &armcompute.PublicIPAddressSKU{ - Name: to.Ptr(armcompute.PublicIPAddressSKUNameBasic), - Tier: to.Ptr(armcompute.PublicIPAddressSKUTierGlobal), - }, - }, - }, - }}, - Primary: to.Ptr(true), - }, - }}, - }, - OSProfile: &armcompute.OSProfile{ - AdminPassword: to.Ptr("{your-password}"), - AdminUsername: to.Ptr("{your-username}"), - ComputerName: to.Ptr("myVM"), - }, - StorageProfile: &armcompute.StorageProfile{ - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/toBeCreatedNetworkInterface"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithCustomerManagedKeys.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithSecurityTypeConfidentialVmWithCustomerManagedKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2as_v5")), - }, - 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"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), - UefiSettings: &armcompute.UefiSettings{ - SecureBootEnabled: to.Ptr(true), - VTpmEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("2019-datacenter-cvm"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("windows-cvm"), - Version: to.Ptr("17763.2183.2109130127"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - SecurityProfile: &armcompute.VMDiskSecurityProfile{ - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesDiskWithVMGuestState), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2as_v5")), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.SecurityProfile{ - // SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), - // UefiSettings: &armcompute.UefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // VTpmEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("2019-datacenter-cvm"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("windows-cvm"), - // Version: to.Ptr("17763.2183.2109130127"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // SecurityProfile: &armcompute.VMDiskSecurityProfile{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesDiskWithVMGuestState), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - // }, - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithSecurityTypeConfidentialVmWithNonPersistedTpmSecurityEncryptionType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2es_v5")), - }, - 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"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), - UefiSettings: &armcompute.UefiSettings{ - SecureBootEnabled: to.Ptr(false), - VTpmEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("2022-datacenter-cvm"), - Publisher: to.Ptr("UbuntuServer"), - SKU: to.Ptr("linux-cvm"), - Version: to.Ptr("17763.2183.2109130127"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - SecurityProfile: &armcompute.VMDiskSecurityProfile{ - SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesNonPersistedTPM), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2es_v5")), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.SecurityProfile{ - // SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), - // UefiSettings: &armcompute.UefiSettings{ - // SecureBootEnabled: to.Ptr(false), - // VTpmEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("2022-datacenter-cvm"), - // Publisher: to.Ptr("UbuntuServer"), - // SKU: to.Ptr("linux-cvm"), - // Version: to.Ptr("17763.2183.2109130127"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // SecurityProfile: &armcompute.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesNonPersistedTPM), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - // }, - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSecurityTypeConfidentialVM.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithSecurityTypeConfidentialVmWithPlatformManagedKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2as_v5")), - }, - 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"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), - UefiSettings: &armcompute.UefiSettings{ - SecureBootEnabled: to.Ptr(true), - VTpmEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("2019-datacenter-cvm"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("windows-cvm"), - Version: to.Ptr("17763.2183.2109130127"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - SecurityProfile: &armcompute.VMDiskSecurityProfile{ - SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesDiskWithVMGuestState), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypes("Standard_DC2as_v5")), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.SecurityProfile{ - // SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), - // UefiSettings: &armcompute.UefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // VTpmEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("2019-datacenter-cvm"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("windows-cvm"), - // Version: to.Ptr("17763.2183.2109130127"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // SecurityProfile: &armcompute.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesDiskWithVMGuestState), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - // }, - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingAssessmentModeOfImageDefault.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithAPatchSettingAssessmentModeOfImageDefault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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"), - WindowsConfiguration: &armcompute.WindowsConfiguration{ - EnableAutomaticUpdates: to.Ptr(true), - PatchSettings: &armcompute.PatchSettings{ - AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), - }, - ProvisionVMAgent: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - 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.StorageAccountTypesPremiumLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // PatchSettings: &armcompute.PatchSettings{ - // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeImageDefault), - // }, - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByOS.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByOs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - NetworkProfile: &armcompute.NetworkProfile{ - NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - { - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - Properties: &armcompute.NetworkInterfaceReferenceProperties{ - Primary: to.Ptr(true), - }, - }}, - }, - OSProfile: &armcompute.OSProfile{ - AdminPassword: to.Ptr("{your-password}"), - AdminUsername: to.Ptr("{your-username}"), - ComputerName: to.Ptr("myVM"), - WindowsConfiguration: &armcompute.WindowsConfiguration{ - EnableAutomaticUpdates: to.Ptr(true), - PatchSettings: &armcompute.PatchSettings{ - PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByOS), - }, - ProvisionVMAgent: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - 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.StorageAccountTypesPremiumLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // PatchSettings: &armcompute.PatchSettings{ - // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByOS), - // }, - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithAutomaticByPlatformSettings.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndAutomaticByPlatformSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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"), - WindowsConfiguration: &armcompute.WindowsConfiguration{ - EnableAutomaticUpdates: to.Ptr(true), - PatchSettings: &armcompute.PatchSettings{ - AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeAutomaticByPlatform), - AutomaticByPlatformSettings: &armcompute.WindowsVMGuestPatchAutomaticByPlatformSettings{ - BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(false), - RebootSetting: to.Ptr(armcompute.WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever), - }, - PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), - }, - ProvisionVMAgent: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - 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.StorageAccountTypesPremiumLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // PatchSettings: &armcompute.PatchSettings{ - // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeAutomaticByPlatform), - // AutomaticByPlatformSettings: &armcompute.WindowsVMGuestPatchAutomaticByPlatformSettings{ - // BypassPlatformSafetyChecksOnUserSchedule: to.Ptr(false), - // RebootSetting: to.Ptr(armcompute.WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever), - // }, - // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), - // }, - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfAutomaticByPlatformAndEnableHotPatchingTrue.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithAPatchSettingPatchModeOfAutomaticByPlatformAndEnableHotpatchingSetToTrue() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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"), - WindowsConfiguration: &armcompute.WindowsConfiguration{ - EnableAutomaticUpdates: to.Ptr(true), - PatchSettings: &armcompute.PatchSettings{ - EnableHotpatching: to.Ptr(true), - PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), - }, - ProvisionVMAgent: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - 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.StorageAccountTypesPremiumLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // PatchSettings: &armcompute.PatchSettings{ - // EnableHotpatching: to.Ptr(true), - // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), - // }, - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModeOfManual.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithAPatchSettingPatchModeOfManual() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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"), - WindowsConfiguration: &armcompute.WindowsConfiguration{ - EnableAutomaticUpdates: to.Ptr(true), - PatchSettings: &armcompute.PatchSettings{ - PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), - }, - ProvisionVMAgent: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - 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.StorageAccountTypesPremiumLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // PatchSettings: &armcompute.PatchSettings{ - // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), - // }, - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WindowsVmWithPatchSettingModesOfAutomaticByPlatform.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAWindowsVmWithPatchSettingsPatchModeAndAssessmentModeSetToAutomaticByPlatform() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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"), - WindowsConfiguration: &armcompute.WindowsConfiguration{ - EnableAutomaticUpdates: to.Ptr(true), - PatchSettings: &armcompute.PatchSettings{ - AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeAutomaticByPlatform), - PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), - }, - ProvisionVMAgent: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - 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.StorageAccountTypesPremiumLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // PatchSettings: &armcompute.PatchSettings{ - // AssessmentMode: to.Ptr(armcompute.WindowsPatchAssessmentModeAutomaticByPlatform), - // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeAutomaticByPlatform), - // }, - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_CustomImageVmFromAnUnmanagedGeneralizedOsImage.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createACustomImageVmFromAnUnmanagedGeneralizedOsImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - Image: &armcompute.VirtualHardDisk{ - URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"), - }, - OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - Vhd: &armcompute.VirtualHardDisk{ - URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // Image: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("https://{existing-storage-account-name}.blob.core.windows.net/system/Microsoft.Compute/Images/vhds/{existing-generalized-os-image-blob-name}.vhd"), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // Vhd: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"), - // }, - // }, - // }, - // VMID: to.Ptr("926cd555-a07c-4ff5-b214-4aa4dd09d79b"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_PlatformImageVmWithUnmanagedOsAndDataDisks.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAPlatformImageVmWithUnmanagedOsAndDataDisks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vm-name}", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - 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), - Vhd: &armcompute.VirtualHardDisk{ - URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd"), - }, - }, - { - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](1), - Vhd: &armcompute.VirtualHardDisk{ - URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd"), - }, - }}, - 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), - Vhd: &armcompute.VirtualHardDisk{ - URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Name: to.Ptr("dataDisk0"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](0), - // Vhd: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk0.vhd"), - // }, - // }, - // { - // Name: to.Ptr("dataDisk1"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](1), - // Vhd: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk1.vhd"), - // }, - // }}, - // 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), - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // Vhd: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"), - // }, - // }, - // }, - // VMID: to.Ptr("5230a749-2f68-4830-900b-702182d32e63"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromACustomImage.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmFromACustomImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), - }, - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("71aa3d5a-d73d-4970-9182-8580433b2865"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromAGeneralizedSharedImage.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmFromAGeneralizedSharedImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"), - }, - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("71aa3d5a-d73d-4970-9182-8580433b2865"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_FromASpecializedSharedImage.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmFromASpecializedSharedImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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), - }, - }}, - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"), - }, - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("71aa3d5a-d73d-4970-9182-8580433b2865"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_InAVmssWithCustomerAssignedPlatformFaultDomain.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmInAVirtualMachineScaleSetWithCustomerAssignedPlatformFaultDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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"), - }, - PlatformFaultDomain: to.Ptr[int32](1), - StorageProfile: &armcompute.StorageProfile{ - 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), - }, - }, - }, - VirtualMachineScaleSet: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}"), - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // PlatformFaultDomain: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VirtualMachineScaleSet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myExistingFlexVmss"), - // }, - // VMID: to.Ptr("7cce54f2-ecd3-4ddd-a8d9-50984faa3918"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_InAnAvailabilitySet.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmInAnAvailabilitySet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - AvailabilitySet: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}"), - }, - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // AvailabilitySet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/NSGEXISTINGAS"), - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithApplicationProfile.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithApplicationProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - ApplicationProfile: &armcompute.ApplicationProfile{ - GalleryApplications: []*armcompute.VMGalleryApplication{ - { - ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), - EnableAutomaticUpgrade: to.Ptr(false), - Order: to.Ptr[int32](1), - PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), - Tags: to.Ptr("myTag1"), - TreatFailureAsDeploymentFailure: to.Ptr(false), - }, - { - PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), - }}, - }, - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("{image_offer}"), - Publisher: to.Ptr("{image_publisher}"), - SKU: to.Ptr("{image_sku}"), - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), - // Order: to.Ptr[int32](1), - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), - // Tags: to.Ptr("myTag1"), - // }, - // { - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), - // }}, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: 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{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("e0de9b84-a506-4b95-9623-00a425d05c90"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDiskEncryptionSetResource.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithDiskEncryptionSetResourceIdInTheOsDiskAndDataDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - { - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](0), - ManagedDisk: &armcompute.ManagedDiskParameters{ - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - { - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](1), - ManagedDisk: &armcompute.ManagedDiskParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}"), - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }}, - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // { - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}"), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }}, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskencryptionset-name}"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("71aa3d5a-d73d-4970-9182-8580433b2865"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEncryptionAtHost.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithHostEncryptionUsingEncryptionAtHostProperty() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - }, - 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"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - EncryptionAtHost: to.Ptr(true), - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SecurityProfile: &armcompute.SecurityProfile{ - // EncryptionAtHost: to.Ptr(true), - // }, - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithScheduledEventsProfile.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithScheduledEventsProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), - }, - }, - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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"), - }, - ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - Enable: to.Ptr(true), - }, - }, - UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - AutomaticallyApprove: to.Ptr(true), - }, - UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - AutomaticallyApprove: to.Ptr(true), - }, - }, - ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ - Enable: to.Ptr(true), - NotBeforeTimeout: to.Ptr("PT15M"), - }, - TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ - Enable: to.Ptr(true), - NotBeforeTimeout: to.Ptr("PT10M"), - }, - }, - StorageProfile: &armcompute.StorageProfile{ - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - // Enable: to.Ptr(true), - // }, - // }, - // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // }, - // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("PT15M"), - // }, - // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("PT10M"), - // }, - // }, - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithAMarketplaceImagePlan.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithAMarketplaceImagePlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithExtensionsTimeBudget.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithAnExtensionsTimeBudget() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), - }, - }, - ExtensionsTimeBudget: to.Ptr("PT30M"), - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // ExtensionsTimeBudget: to.Ptr("PT30M"), - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithBootDiagnostics.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithBootDiagnostics() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - StorageURI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net"), - }, - }, - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithDataDisksFromSourceResource.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithDataDisksUsingCopyAndRestoreOptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - 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.DiskCreateOptionTypesCopy), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](0), - SourceResource: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}"), - }, - }, - { - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesCopy), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](1), - SourceResource: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}"), - }, - }, - { - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesRestore), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](2), - SourceResource: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}"), - }, - }}, - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesCopy), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // SourceResource: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}"), - // }, - // }, - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesCopy), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // SourceResource: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}"), - // }, - // }, - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesRestore), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](2), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // SourceResource: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}"), - // }, - // }}, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("3906fef9-a1e5-4b83-a8a8-540858b41df0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithEmptyDataDisks.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithEmptyDataDisks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - 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), - }, - { - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](1), - }}, - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }}, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("3906fef9-a1e5-4b83-a8a8-540858b41df0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsCacheDisk.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithEphemeralOsDiskProvisioningInCacheDiskUsingPlacementProperty() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - DiffDiskSettings: &armcompute.DiffDiskSettings{ - Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), - }, - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), - // }, - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - DiffDiskSettings: &armcompute.DiffDiskSettings{ - Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - Placement: to.Ptr(armcompute.DiffDiskPlacementNvmeDisk), - }, - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcompute.DiffDiskPlacementNvmeDisk), - // }, - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDiskUsingDiffDiskPlacementAsResourceDisk.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithEphemeralOsDiskProvisioningInResourceDiskUsingPlacementProperty() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - DiffDiskSettings: &armcompute.DiffDiskSettings{ - Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - Placement: to.Ptr(armcompute.DiffDiskPlacementResourceDisk), - }, - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcompute.DiffDiskPlacementResourceDisk), - // }, - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithADiffOsDisk.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithEphemeralOsDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - DiffDiskSettings: &armcompute.DiffDiskSettings{ - Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - }, - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // }, - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithManagedBootDiagnostics.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithManagedBootDiagnostics() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - BootDiagnostics: &armcompute.BootDiagnostics{ - Enabled: to.Ptr(true), - }, - }, - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("676420ba-7a24-4bfe-80bd-9c841ee184fa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPasswordAuthentication.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithPasswordAuthentication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("b248db33-62ba-4d2d-b791-811e075ee0f5"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithPremiumStorage.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithPremiumStorage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - 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.StorageAccountTypesPremiumLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("a149cd25-409f-41af-8088-275f5486bc93"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithSshAuthentication.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createAVmWithSshAuthentication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineProperties{ - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - }, - 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{ - AdminUsername: to.Ptr("{your-username}"), - ComputerName: to.Ptr("myVM"), - LinuxConfiguration: &armcompute.LinuxConfiguration{ - DisablePasswordAuthentication: 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"), - }}, - }, - }, - }, - StorageProfile: &armcompute.StorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("{image_offer}"), - Publisher: to.Ptr("{image_publisher}"), - SKU: to.Ptr("{image_sku}"), - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: 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{ - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesLinux), - // }, - // }, - // VMID: to.Ptr("e0de9b84-a506-4b95-9623-00a425d05c90"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Create_WithCapacityReservation.json -func ExampleVirtualMachinesClient_BeginCreateOrUpdate_createOrUpdateAVmWithCapacityReservation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myVM", armcompute.VirtualMachine{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineProperties{ - CapacityReservation: &armcompute.CapacityReservationProfile{ - CapacityReservationGroup: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"), - }, - }, - HardwareProfile: &armcompute.HardwareProfile{ - VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - }, - 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{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.OSDisk{ - Name: to.Ptr("myVMosdisk"), - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.ManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // CapacityReservation: &armcompute.CapacityReservationProfile{ - // CapacityReservationGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS1V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("myVMosdisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("5c0d55a7-c407-4ed6-bf7d-ddb810267c85"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Update_DetachDataDiskUsingToBeDetachedProperty.json -func ExampleVirtualMachinesClient_BeginUpdate_updateAVmByDetachingDataDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // ToBeDetached: to.Ptr(true), - // }, - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("3906fef9-a1e5-4b83-a8a8-540858b41df0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Update_ForceDetachDataDisk.json -func ExampleVirtualMachinesClient_BeginUpdate_updateAVmByForceDetachingDataDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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), - DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), - 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), - }, - }, - }, - }, - }, &armcompute.VirtualMachinesClientBeginUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("westus"), - // 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/nsgExistingNic"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // ToBeDetached: to.Ptr(true), - // }, - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("3906fef9-a1e5-4b83-a8a8-540858b41df0"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get.json -func ExampleVirtualMachinesClient_Get_getAVirtualMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: to.Ptr(armcompute.InstanceViewTypesUserData)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Etag: to.Ptr("\"1\""), - // ManagedBy: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{MyVmss}"), - // Properties: &armcompute.VirtualMachineProperties{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), - // Order: to.Ptr[int32](1), - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), - // Tags: to.Ptr("myTag1"), - // }, - // { - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), - // }}, - // }, - // AvailabilitySet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/my-AvailabilitySet"), - // }, - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://{myStorageAccount}.blob.core.windows.net"), - // }, - // }, - // ExtensionsTimeBudget: to.Ptr("PT50M"), - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS3V2), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{myNIC}"), - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(false), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/proximityPlacementGroups/my-ppg01"), - // }, - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Name: to.Ptr("myDataDisk0"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](30), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk0"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }, - // { - // Name: to.Ptr("myDataDisk1"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - // DiskSizeGB: to.Ptr[int32](100), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk1"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }}, - // 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("myOsDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), - // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - // VMID: to.Ptr("0f47b100-583c-48e3-a4c0-aefc2c9bbcc1"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("CustomScriptExtension-DSC"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), - // Location: to.Ptr("west us"), - // Tags: map[string]*string{ - // "displayName": to.Ptr("CustomScriptExtension-DSC"), - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("CustomScriptExtension"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("1.9"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_AutoPlacedOnDedicatedHostGroup.json -func ExampleVirtualMachinesClient_Get_getAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardD2SV3), - // }, - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup"), - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{myNIC}"), - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(false), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // 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("myOsDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // VMID: to.Ptr("0f47b100-583c-48e3-a4c0-aefc2c9bbcc1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithDiskControllerType.json -func ExampleVirtualMachinesClient_Get_getAVirtualMachineWithDiskControllerTypeProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: to.Ptr(armcompute.InstanceViewTypesUserData)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), - // Order: to.Ptr[int32](1), - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), - // Tags: to.Ptr("myTag1"), - // }, - // { - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), - // }}, - // }, - // AvailabilitySet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/my-AvailabilitySet"), - // }, - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://{myStorageAccount}.blob.core.windows.net"), - // }, - // }, - // ExtensionsTimeBudget: to.Ptr("PT50M"), - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS3V2), - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](1), - // VCPUsPerCore: to.Ptr[int32](1), - // }, - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{myNIC}"), - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(false), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Name: to.Ptr("myDataDisk0"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](30), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk0"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }, - // { - // Name: to.Ptr("myDataDisk1"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - // DiskSizeGB: to.Ptr[int32](100), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk1"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }}, - // DiskControllerType: to.Ptr(armcompute.DiskControllerTypesNVMe), - // 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("myOsDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - // VMID: to.Ptr("0f47b100-583c-48e3-a4c0-aefc2c9bbcc1"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("CustomScriptExtension-DSC"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), - // Location: to.Ptr("west us"), - // Tags: map[string]*string{ - // "displayName": to.Ptr("CustomScriptExtension-DSC"), - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("CustomScriptExtension"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("1.9"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_WithVMSizeProperties.json -func ExampleVirtualMachinesClient_Get_getAVirtualMachineWithVmSizeProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachinesClient().Get(ctx, "myResourceGroup", "myVM", &armcompute.VirtualMachinesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachine = armcompute.VirtualMachine{ - // Name: to.Ptr("myVM"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), - // Order: to.Ptr[int32](1), - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), - // Tags: to.Ptr("myTag1"), - // }, - // { - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), - // }}, - // }, - // AvailabilitySet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/my-AvailabilitySet"), - // }, - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // StorageURI: to.Ptr("http://{myStorageAccount}.blob.core.windows.net"), - // }, - // }, - // ExtensionsTimeBudget: to.Ptr("PT50M"), - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardDS3V2), - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](1), - // VCPUsPerCore: to.Ptr[int32](1), - // }, - // }, - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{myNIC}"), - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerName: to.Ptr("myVM"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(false), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Name: to.Ptr("myDataDisk0"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](30), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk0"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }, - // { - // Name: to.Ptr("myDataDisk1"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - // DiskSizeGB: to.Ptr[int32](100), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myDataDisk1"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }}, - // 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("myOsDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - // VMID: to.Ptr("0f47b100-583c-48e3-a4c0-aefc2c9bbcc1"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("CustomScriptExtension-DSC"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), - // Location: to.Ptr("west us"), - // Tags: map[string]*string{ - // "displayName": to.Ptr("CustomScriptExtension-DSC"), - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("CustomScriptExtension"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("1.9"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceView.json -func ExampleVirtualMachinesClient_InstanceView_getVirtualMachineInstanceView() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachinesClient().InstanceView(ctx, "myResourceGroup", "myVM", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstanceView = armcompute.VirtualMachineInstanceView{ - // BootDiagnostics: &armcompute.BootDiagnosticsInstanceView{ - // ConsoleScreenshotBlobURI: to.Ptr("https://{myStorageAccount}.blob.core.windows.net/bootdiagnostics-myOsDisk/myOsDisk.screenshot.bmp"), - // SerialConsoleLogBlobURI: to.Ptr("https://{myStorageAccount}.blob.core.windows.net/bootdiagnostics-myOsDisk/myOsDisk.serialconsole.log"), - // }, - // ComputerName: to.Ptr("myVM"), - // Disks: []*armcompute.DiskInstanceView{ - // { - // Name: to.Ptr("myOsDisk"), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-14T21:29:47.477Z"); return t}()), - // }}, - // }, - // { - // Name: to.Ptr("myDataDisk0"), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-14T21:29:47.461Z"); return t}()), - // }}, - // }}, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypeV1), - // IsVMInStandbyPool: to.Ptr(false), - // OSName: to.Ptr("Windows Server 2016 Datacenter"), - // OSVersion: to.Ptr("Microsoft Windows NT 10.0.14393.0"), - // PatchStatus: &armcompute.VirtualMachinePatchStatus{ - // AvailablePatchSummary: &armcompute.AvailablePatchSummary{ - // AssessmentActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), - // CriticalAndSecurityPatchCount: to.Ptr[int32](1), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), - // OtherPatchCount: to.Ptr[int32](2), - // RebootPending: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), - // Status: to.Ptr(armcompute.PatchOperationStatusSucceeded), - // }, - // ConfigurationStatuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("PatchModeConfigurationState/Ready"), - // DisplayStatus: to.Ptr("Status_PatchModeConfigurationState_Ready"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), - // }, - // { - // Code: to.Ptr("AssessmentModeConfigurationState/Pending"), - // DisplayStatus: to.Ptr("Status_AssessmentModeConfigurationState_Pending"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), - // }}, - // LastPatchInstallationSummary: &armcompute.LastPatchInstallationSummary{ - // ExcludedPatchCount: to.Ptr[int32](1), - // FailedPatchCount: to.Ptr[int32](1), - // InstallationActivityID: to.Ptr("68f8b292-dfc2-4646-9981-33cc88631968"), - // InstalledPatchCount: to.Ptr[int32](1), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), - // MaintenanceWindowExceeded: to.Ptr(false), - // NotSelectedPatchCount: to.Ptr[int32](1), - // PendingPatchCount: to.Ptr[int32](1), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), - // Status: to.Ptr(armcompute.PatchOperationStatusSucceeded), - // }, - // }, - // PlatformFaultDomain: to.Ptr[int32](1), - // PlatformUpdateDomain: to.Ptr[int32](1), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-14T21:30:12.805Z"); return t}()), - // }, - // { - // Code: to.Ptr("PowerState/running"), - // DisplayStatus: to.Ptr("VM running"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // VMAgent: &armcompute.VirtualMachineAgentInstanceView{ - // ExtensionHandlers: []*armcompute.VirtualMachineExtensionHandlerInstanceView{ - // { - // Type: to.Ptr("Microsoft.Azure.Security.IaaSAntimalware"), - // Status: &armcompute.InstanceViewStatus{ - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Ready"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }, - // TypeHandlerVersion: to.Ptr("1.5.5.9"), - // }}, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Ready"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("GuestAgent is running and accepting new configurations."), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-10-14T23:11:22.000Z"); return t}()), - // }}, - // VMAgentVersion: to.Ptr("2.7.41491.949"), - // }, - // Extensions: []*armcompute.VirtualMachineExtensionInstanceView{ - // { - // Name: to.Ptr("IaaSAntiMalware-ext0"), - // Type: to.Ptr("Microsoft.Azure.Security.IaaSAntimalware"), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("Microsoft Antimalware enabled"), - // }}, - // TypeHandlerVersion: to.Ptr("1.5.5.9"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Get_InstanceViewAutoPlacedOnDedicatedHostGroup.json -func ExampleVirtualMachinesClient_InstanceView_getInstanceViewOfAVirtualMachinePlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachinesClient().InstanceView(ctx, "myResourceGroup", "myVM", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstanceView = armcompute.VirtualMachineInstanceView{ - // AssignedHost: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup/hosts/myHost"), - // ComputerName: to.Ptr("myVM"), - // Disks: []*armcompute.DiskInstanceView{ - // { - // Name: to.Ptr("myOsDisk"), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-01T21:29:47.477Z"); return t}()), - // }}, - // }}, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypeV1), - // OSName: to.Ptr("Windows Server 2016 Datacenter"), - // OSVersion: to.Ptr("Microsoft Windows NT 10.0.14393.0"), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-01T21:30:12.805Z"); return t}()), - // }, - // { - // Code: to.Ptr("PowerState/running"), - // DisplayStatus: to.Ptr("VM running"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // VMAgent: &armcompute.VirtualMachineAgentInstanceView{ - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Ready"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("GuestAgent is running and accepting new configurations."), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-01T23:11:22.000Z"); return t}()), - // }}, - // VMAgentVersion: to.Ptr("2.7.41491.949"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginConvertToManagedDisks_virtualMachineConvertToManagedDisksMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ConvertToManagedDisks_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_BeginConvertToManagedDisks_virtualMachineConvertToManagedDisksMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginConvertToManagedDisks(ctx, "rgcompute", "aaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginDeallocate_virtualMachineDeallocateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Deallocate_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_BeginDeallocate_virtualMachineDeallocateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginDeallocate(ctx, "rgcompute", "aaaaaaaaaaaaaaaa", &armcompute.VirtualMachinesClientBeginDeallocateOptions{Hibernate: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_List_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_NewListPager_virtualMachineListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachinesClient().NewListPager("rgcompute", &armcompute.VirtualMachinesClientListOptions{Filter: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - Expand: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineListResult = armcompute.VirtualMachineListResult{ - // Value: []*armcompute.VirtualMachine{ - // { - // Name: to.Ptr("{virtualMachineName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Identity: &armcompute.VirtualMachineIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaa"), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "key5688": &armcompute.UserAssignedIdentitiesValue{ - // ClientID: to.Ptr("aaaaaaaaaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Plan: &armcompute.Plan{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // PromotionCode: to.Ptr("aaaaaaaaaaaaaa"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - // HibernationEnabled: to.Ptr(true), - // UltraSSDEnabled: to.Ptr(true), - // }, - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Order: to.Ptr[int32](4), - // PackageReferenceID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Tags: to.Ptr("aaaaa"), - // }}, - // }, - // AvailabilitySet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // BillingProfile: &armcompute.BillingProfile{ - // MaxPrice: to.Ptr[float64](26), - // }, - // CapacityReservation: &armcompute.CapacityReservationProfile{ - // CapacityReservationGroup: &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("aaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](7), - // VCPUsPerCore: to.Ptr[int32](14), - // }, - // }, - // Host: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // LicenseType: to.Ptr("aaaaaaaaaaaaaaa"), - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersion("2022-05-01")), - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ - // { - // Name: to.Ptr("aaaaaaaa"), - // Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ - // DNSServers: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // 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("aaaaaaaa"), - // 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("aaaaaaaaaaaaaaaaaa"), - // Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ - // DomainNameLabel: to.Ptr("aaaaa"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](23), - // IPTags: []*armcompute.VirtualMachineIPTag{ - // { - // IPTagType: to.Ptr("aaaaa"), - // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // 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/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("Foo12"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("Test"), - // 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("aaaaaaaaaaaaaaaaaaaaaa"), - // KeyData: to.Ptr("aaa"), - // }}, - // }, - // }, - // RequireGuestProvisionSignal: to.Ptr(true), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ - // { - // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // 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("aaaaaaaaaaaaaaaaaaaaaa"), - // WinRM: &armcompute.WinRMConfiguration{ - // Listeners: []*armcompute.WinRMListener{ - // { - // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), - // }}, - // }, - // }, - // }, - // PlatformFaultDomain: to.Ptr[int32](8), - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("PT15M"), - // }, - // 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.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // CommunityGalleryImageID: to.Ptr("aaaa"), - // ExactVersion: to.Ptr("aaaaaaaaaaaaa"), - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaa"), - // SKU: to.Ptr("2012-R2-Datacenter"), - // Version: to.Ptr("4.127.20170406"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("test"), - // 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("aaaaaaaaa"), - // 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("aaaaaaaaaaaaa"), - // 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/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // SecurityProfile: &armcompute.VMDiskSecurityProfile{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), - // }, - // 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), - // }, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.683Z"); return t}()), - // UserData: to.Ptr("aaa"), - // VirtualMachineScaleSet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // VMID: to.Ptr("{vmId}"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("aaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key9428": to.Ptr("aaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("aaaaaaaa"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaa"), - // InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }}, - // Substatuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }}, - // TypeHandlerVersion: to.Ptr("aaaaaa"), - // }, - // ProtectedSettings: map[string]any{ - // }, - // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), - // SourceVault: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaa"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaa"), - // }, - // }}, - // Zones: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // { - // Name: to.Ptr("{virtualMachineName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Identity: &armcompute.VirtualMachineIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaa"), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "key5688": &armcompute.UserAssignedIdentitiesValue{ - // ClientID: to.Ptr("aaaaaaaaaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Plan: &armcompute.Plan{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // PromotionCode: to.Ptr("aaaaaaaaaaaaaa"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - // HibernationEnabled: to.Ptr(true), - // UltraSSDEnabled: to.Ptr(true), - // }, - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Order: to.Ptr[int32](4), - // PackageReferenceID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Tags: to.Ptr("aaaaa"), - // }}, - // }, - // AvailabilitySet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // BillingProfile: &armcompute.BillingProfile{ - // MaxPrice: to.Ptr[float64](26), - // }, - // CapacityReservation: &armcompute.CapacityReservationProfile{ - // CapacityReservationGroup: &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("aaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](7), - // VCPUsPerCore: to.Ptr[int32](14), - // }, - // }, - // Host: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // InstanceView: &armcompute.VirtualMachineInstanceView{ - // AssignedHost: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // BootDiagnostics: &armcompute.BootDiagnosticsInstanceView{ - // ConsoleScreenshotBlobURI: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // SerialConsoleLogBlobURI: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Status: &armcompute.InstanceViewStatus{ - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }, - // }, - // ComputerName: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Disks: []*armcompute.DiskInstanceView{ - // { - // Name: to.Ptr("a"), - // EncryptionSettings: []*armcompute.DiskEncryptionSettings{ - // { - // DiskEncryptionKey: &armcompute.KeyVaultSecretReference{ - // SecretURL: to.Ptr("aaaaaaaaa"), - // 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("aaaaaaaaaaaaa"), - // SourceVault: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // }, - // }}, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }}, - // }}, - // HyperVGeneration: to.Ptr(armcompute.HyperVGenerationTypeV1), - // IsVMInStandbyPool: to.Ptr(false), - // MaintenanceRedeployStatus: &armcompute.MaintenanceRedeployStatus{ - // IsCustomerInitiatedMaintenanceAllowed: to.Ptr(true), - // LastOperationMessage: to.Ptr("aa"), - // LastOperationResultCode: to.Ptr(armcompute.MaintenanceOperationResultCodeTypesNone), - // MaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.682Z"); return t}()), - // MaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.682Z"); return t}()), - // PreMaintenanceWindowEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.682Z"); return t}()), - // PreMaintenanceWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.682Z"); return t}()), - // }, - // OSName: to.Ptr("aaaaaaaaaaa"), - // OSVersion: to.Ptr("aaaaaaaaaaaaaa"), - // PatchStatus: &armcompute.VirtualMachinePatchStatus{ - // AvailablePatchSummary: &armcompute.AvailablePatchSummary{ - // AssessmentActivityID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // CriticalAndSecurityPatchCount: to.Ptr[int32](22), - // Error: &armcompute.APIError{ - // Code: to.Ptr("aaaaaa"), - // Innererror: &armcompute.InnerError{ - // Errordetail: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Exceptiontype: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Message: to.Ptr("aaa"), - // Target: to.Ptr("aaaaaaaaa"), - // Details: []*armcompute.APIErrorBase{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Message: to.Ptr("aaaaaaaaaaaaa"), - // Target: to.Ptr("aaaaaa"), - // }}, - // }, - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.683Z"); return t}()), - // OtherPatchCount: to.Ptr[int32](25), - // RebootPending: to.Ptr(true), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.682Z"); return t}()), - // Status: to.Ptr(armcompute.PatchOperationStatusUnknown), - // }, - // ConfigurationStatuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }}, - // LastPatchInstallationSummary: &armcompute.LastPatchInstallationSummary{ - // Error: &armcompute.APIError{ - // Code: to.Ptr("aaaaaa"), - // Innererror: &armcompute.InnerError{ - // Errordetail: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Exceptiontype: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Message: to.Ptr("aaa"), - // Target: to.Ptr("aaaaaaaaa"), - // Details: []*armcompute.APIErrorBase{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Message: to.Ptr("aaaaaaaaaaaaa"), - // Target: to.Ptr("aaaaaa"), - // }}, - // }, - // ExcludedPatchCount: to.Ptr[int32](1), - // FailedPatchCount: to.Ptr[int32](30), - // InstallationActivityID: to.Ptr("aaaaaa"), - // InstalledPatchCount: to.Ptr[int32](28), - // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.683Z"); return t}()), - // MaintenanceWindowExceeded: to.Ptr(true), - // NotSelectedPatchCount: to.Ptr[int32](20), - // PendingPatchCount: to.Ptr[int32](2), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.683Z"); return t}()), - // Status: to.Ptr(armcompute.PatchOperationStatusUnknown), - // }, - // }, - // PlatformFaultDomain: to.Ptr[int32](29), - // PlatformUpdateDomain: to.Ptr[int32](1), - // RdpThumbPrint: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }}, - // VMAgent: &armcompute.VirtualMachineAgentInstanceView{ - // ExtensionHandlers: []*armcompute.VirtualMachineExtensionHandlerInstanceView{ - // { - // Type: to.Ptr("aaaaa"), - // Status: &armcompute.InstanceViewStatus{ - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }, - // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // }}, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }}, - // VMAgentVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // VMHealth: &armcompute.VirtualMachineHealthStatus{ - // Status: &armcompute.InstanceViewStatus{ - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }, - // }, - // Extensions: []*armcompute.VirtualMachineExtensionInstanceView{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }}, - // Substatuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }}, - // TypeHandlerVersion: to.Ptr("aaaaaa"), - // }}, - // }, - // LicenseType: to.Ptr("aaaaaaaaaaaaaa"), - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersion("2022-05-01")), - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ - // { - // Name: to.Ptr("aaaaaaaa"), - // Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ - // DNSServers: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // 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("aaaaaaaa"), - // 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("aaaaaaaaaaaaaaaaaa"), - // Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ - // DomainNameLabel: to.Ptr("aaaaa"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](23), - // IPTags: []*armcompute.VirtualMachineIPTag{ - // { - // IPTagType: to.Ptr("aaaaa"), - // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // 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/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("Foo12"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("Test"), - // CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // 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("aaaaaaaaaaaaaaaaaaaaaa"), - // KeyData: to.Ptr("aaa"), - // }}, - // }, - // }, - // RequireGuestProvisionSignal: to.Ptr(true), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ - // { - // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // 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("aaaaaaaaaaaaaaaaaaaa"), - // WinRM: &armcompute.WinRMConfiguration{ - // Listeners: []*armcompute.WinRMListener{ - // { - // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), - // }}, - // }, - // }, - // }, - // PlatformFaultDomain: to.Ptr[int32](11), - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("PT15M"), - // }, - // 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.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("aaaaaaaa"), - // CommunityGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ExactVersion: to.Ptr("aa"), - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // SKU: to.Ptr("2012-R2-Datacenter"), - // Version: to.Ptr("4.127.20170406"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("test"), - // 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("aaaaaaaaa"), - // 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("aaaaaaaaaaaaa"), - // 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/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // SecurityProfile: &armcompute.VMDiskSecurityProfile{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), - // }, - // 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), - // }, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.685Z"); return t}()), - // UserData: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // VirtualMachineScaleSet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // VMID: to.Ptr("{vmId}"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("aaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key9428": to.Ptr("aaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("aaaaaaaa"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaa"), - // InstanceView: &armcompute.VirtualMachineExtensionInstanceView{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }}, - // Substatuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("aaa"), - // DisplayStatus: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.657Z"); return t}()), - // }}, - // TypeHandlerVersion: to.Ptr("aaaaaa"), - // }, - // ProtectedSettings: map[string]any{ - // }, - // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), - // SourceVault: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaa"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaa"), - // }, - // }}, - // Zones: []*string{ - // to.Ptr("aaaaaa")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_List_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_NewListPager_virtualMachineListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachinesClient().NewListPager("rgcompute", &armcompute.VirtualMachinesClientListOptions{Filter: nil, - Expand: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineListResult = armcompute.VirtualMachineListResult{ - // Value: []*armcompute.VirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), - // Location: to.Ptr("eastus"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), - // Location: to.Ptr("eastus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_NewListAllPager_virtualMachineListAllMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachinesClient().NewListAllPager(&armcompute.VirtualMachinesClientListAllOptions{StatusOnly: to.Ptr("aaaaaa"), - Filter: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - Expand: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineListResult = armcompute.VirtualMachineListResult{ - // Value: []*armcompute.VirtualMachine{ - // { - // Name: to.Ptr("{virtualMachineName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Identity: &armcompute.VirtualMachineIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaa"), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "key5688": &armcompute.UserAssignedIdentitiesValue{ - // ClientID: to.Ptr("aaaaaaaaaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Plan: &armcompute.Plan{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // PromotionCode: to.Ptr("aaaaaaaaaaaaaa"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - // HibernationEnabled: to.Ptr(true), - // UltraSSDEnabled: to.Ptr(true), - // }, - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Order: to.Ptr[int32](4), - // PackageReferenceID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Tags: to.Ptr("aaaaa"), - // }}, - // }, - // AvailabilitySet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // BillingProfile: &armcompute.BillingProfile{ - // MaxPrice: to.Ptr[float64](26), - // }, - // CapacityReservation: &armcompute.CapacityReservationProfile{ - // CapacityReservationGroup: &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("aaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](7), - // VCPUsPerCore: to.Ptr[int32](14), - // }, - // }, - // Host: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // LicenseType: to.Ptr("aaaaaaaaaaaaaaa"), - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersion("2022-05-01")), - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ - // { - // Name: to.Ptr("aaaaaaaa"), - // Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ - // DNSServers: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // 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("aaaaaaaa"), - // 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("aaaaaaaaaaaaaaaaaa"), - // Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ - // DomainNameLabel: to.Ptr("aaaaa"), - // DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesTenantReuse), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](23), - // IPTags: []*armcompute.VirtualMachineIPTag{ - // { - // IPTagType: to.Ptr("aaaaa"), - // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // 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/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("Foo12"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("Test"), - // 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("aaaaaaaaaaaaaaaaaaaaaa"), - // KeyData: to.Ptr("aaa"), - // }}, - // }, - // }, - // RequireGuestProvisionSignal: to.Ptr(true), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ - // { - // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // 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("aaaaaaaaaaaaaaaaaaaaaa"), - // WinRM: &armcompute.WinRMConfiguration{ - // Listeners: []*armcompute.WinRMListener{ - // { - // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), - // }}, - // }, - // }, - // }, - // PlatformFaultDomain: to.Ptr[int32](8), - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("PT15M"), - // }, - // 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.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // CommunityGalleryImageID: to.Ptr("aaaa"), - // ExactVersion: to.Ptr("aaaaaaaaaaaaa"), - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaa"), - // SKU: to.Ptr("2012-R2-Datacenter"), - // Version: to.Ptr("4.127.20170406"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("test"), - // 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("aaaaaaaaa"), - // 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("aaaaaaaaaaaaa"), - // 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/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // SecurityProfile: &armcompute.VMDiskSecurityProfile{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), - // }, - // 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), - // }, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.683Z"); return t}()), - // UserData: to.Ptr("aaa"), - // VirtualMachineScaleSet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // VMID: to.Ptr("{vmId}"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("aaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key9428": to.Ptr("aaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("aaaaaaaa"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaa"), - // ProtectedSettings: map[string]any{ - // }, - // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), - // SourceVault: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaa"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaa"), - // }, - // }}, - // Zones: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // { - // Name: to.Ptr("{virtualMachineName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Identity: &armcompute.VirtualMachineIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaa"), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "key5688": &armcompute.UserAssignedIdentitiesValue{ - // ClientID: to.Ptr("aaaaaaaaaaa"), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // }, - // }, - // }, - // Plan: &armcompute.Plan{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // PromotionCode: to.Ptr("aaaaaaaaaaaaaa"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineProperties{ - // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - // HibernationEnabled: to.Ptr(true), - // UltraSSDEnabled: to.Ptr(true), - // }, - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Order: to.Ptr[int32](4), - // PackageReferenceID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Tags: to.Ptr("aaaaa"), - // }}, - // }, - // AvailabilitySet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // BillingProfile: &armcompute.BillingProfile{ - // MaxPrice: to.Ptr[float64](26), - // }, - // CapacityReservation: &armcompute.CapacityReservationProfile{ - // CapacityReservationGroup: &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("aaaaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSize: to.Ptr(armcompute.VirtualMachineSizeTypesStandardA0), - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](7), - // VCPUsPerCore: to.Ptr[int32](14), - // }, - // }, - // Host: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // LicenseType: to.Ptr("aaaaaaaaaaaaaa"), - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersion("2022-05-01")), - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineNetworkInterfaceConfiguration{ - // { - // Name: to.Ptr("aaaaaaaa"), - // Properties: &armcompute.VirtualMachineNetworkInterfaceConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armcompute.VirtualMachineNetworkInterfaceDNSSettingsConfiguration{ - // DNSServers: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa")}, - // }, - // 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("aaaaaaaa"), - // 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("aaaaaaaaaaaaaaaaaa"), - // Properties: &armcompute.VirtualMachinePublicIPAddressConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DNSSettings: &armcompute.VirtualMachinePublicIPAddressDNSSettingsConfiguration{ - // DomainNameLabel: to.Ptr("aaaaa"), - // DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesSubscriptionReuse), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](23), - // IPTags: []*armcompute.VirtualMachineIPTag{ - // { - // IPTagType: to.Ptr("aaaaa"), - // Tag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }}, - // 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/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"), - // Properties: &armcompute.NetworkInterfaceReferenceProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("Foo12"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("Test"), - // CustomData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // 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("aaaaaaaaaaaaaaaaaaaaaa"), - // KeyData: to.Ptr("aaa"), - // }}, - // }, - // }, - // RequireGuestProvisionSignal: to.Ptr(true), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // AdditionalUnattendContent: []*armcompute.AdditionalUnattendContent{ - // { - // ComponentName: to.Ptr("Microsoft-Windows-Shell-Setup"), - // Content: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // 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("aaaaaaaaaaaaaaaaaaaa"), - // WinRM: &armcompute.WinRMConfiguration{ - // Listeners: []*armcompute.WinRMListener{ - // { - // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), - // }}, - // }, - // }, - // }, - // PlatformFaultDomain: to.Ptr[int32](11), - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("PT15M"), - // }, - // 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.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("aaaaaaaa"), - // CommunityGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ExactVersion: to.Ptr("aa"), - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // SKU: to.Ptr("2012-R2-Datacenter"), - // Version: to.Ptr("4.127.20170406"), - // }, - // OSDisk: &armcompute.OSDisk{ - // Name: to.Ptr("test"), - // 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("aaaaaaaaa"), - // 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("aaaaaaaaaaaaa"), - // 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/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f"), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // SecurityProfile: &armcompute.VMDiskSecurityProfile{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), - // }, - // 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), - // }, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-14T16:43:41.685Z"); return t}()), - // UserData: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // VirtualMachineScaleSet: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // VMID: to.Ptr("{vmId}"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("aaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaaaaa"), - // Tags: map[string]*string{ - // "key9428": to.Ptr("aaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("aaaaaaaa"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaa"), - // ProtectedSettings: map[string]any{ - // }, - // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), - // SourceVault: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaa"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaa"), - // }, - // }}, - // Zones: []*string{ - // to.Ptr("aaaaaa")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_ListAll_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_NewListAllPager_virtualMachineListAllMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachinesClient().NewListAllPager(&armcompute.VirtualMachinesClientListAllOptions{StatusOnly: nil, - Filter: nil, - Expand: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineListResult = armcompute.VirtualMachineListResult{ - // Value: []*armcompute.VirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), - // Location: to.Ptr("eastus"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{virtualMachineName}"), - // Location: to.Ptr("eastus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachinesClient().NewListAvailableSizesPager("myResourceGroup", "myVmName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineSizeListResult = armcompute.VirtualMachineSizeListResult{ - // Value: []*armcompute.VirtualMachineSize{ - // { - // Name: to.Ptr("Standard_A1_V2"), - // MaxDataDiskCount: to.Ptr[int32](2), - // MemoryInMB: to.Ptr[int32](2048), - // NumberOfCores: to.Ptr[int32](1), - // OSDiskSizeInMB: to.Ptr[int32](1047552), - // ResourceDiskSizeInMB: to.Ptr[int32](10240), - // }, - // { - // Name: to.Ptr("Standard_A2_V2"), - // MaxDataDiskCount: to.Ptr[int32](4), - // MemoryInMB: to.Ptr[int32](4096), - // NumberOfCores: to.Ptr[int32](2), - // OSDiskSizeInMB: to.Ptr[int32](1047552), - // ResourceDiskSizeInMB: to.Ptr[int32](20480), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginPowerOff_virtualMachinePowerOffMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PowerOff_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_BeginPowerOff_virtualMachinePowerOffMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginPowerOff(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachinesClientBeginPowerOffOptions{SkipShutdown: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Restart_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginRestart_virtualMachineRestartMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Restart_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_BeginRestart_virtualMachineRestartMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginRestart(ctx, "rgcompute", "aaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Start_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginStart_virtualMachineStartMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Start_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_BeginStart_virtualMachineStartMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginStart(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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginRedeploy_virtualMachineRedeployMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Redeploy_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_BeginRedeploy_virtualMachineRedeployMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginRedeploy(ctx, "rgcompute", "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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Reimage_NonEphemeralVMs.json -func ExampleVirtualMachinesClient_BeginReimage_reimageANonEphemeralVirtualMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginReimage(ctx, "myResourceGroup", "myVMName", &armcompute.VirtualMachinesClientBeginReimageOptions{Parameters: &armcompute.VirtualMachineReimageParameters{ - ExactVersion: to.Ptr("aaaaaa"), - OSProfile: &armcompute.OSProfileProvisioningData{ - AdminPassword: to.Ptr("{your-password}"), - CustomData: to.Ptr("{your-custom-data}"), - }, - 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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_Reimage.json -func ExampleVirtualMachinesClient_BeginReimage_reimageAVirtualMachine() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachinesClient().RetrieveBootDiagnosticsData(ctx, "ResourceGroup", "VMName", &armcompute.VirtualMachinesClientRetrieveBootDiagnosticsDataOptions{SasURIExpirationTimeInMinutes: to.Ptr[int32](60)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RetrieveBootDiagnosticsDataResult = armcompute.RetrieveBootDiagnosticsDataResult{ - // ConsoleScreenshotBlobURI: to.Ptr("https://storageuri/vm.screenshot.bmp?{sasKey}"), - // SerialConsoleLogBlobURI: to.Ptr("https://storageuri/vm.serialconsole.log?{sasKey}"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginPerformMaintenance_virtualMachinePerformMaintenanceMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_PerformMaintenance_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_BeginPerformMaintenance_virtualMachinePerformMaintenanceMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginPerformMaintenance(ctx, "rgcompute", "aaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewVirtualMachinesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineAssessPatchesResult = armcompute.VirtualMachineAssessPatchesResult{ - // AssessmentActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), - // AvailablePatches: []*armcompute.VirtualMachineSoftwarePatchProperties{ - // { - // Name: to.Ptr("Definition Update for Windows Defender Antivirus - KB2267602 (Definition 1.279.1373.0)"), - // ActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), - // AssessmentState: to.Ptr(armcompute.PatchAssessmentStateAvailable), - // Classifications: []*string{ - // to.Ptr("Definition Updates")}, - // KbID: to.Ptr("2267602"), - // LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:18:45.283Z"); return t}()), - // PatchID: to.Ptr("35428702-5784-4ba4-a6e0-5222258b5411"), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), - // RebootBehavior: to.Ptr(armcompute.VMGuestPatchRebootBehaviorNeverReboots), - // Version: to.Ptr(""), - // }, - // { - // Name: to.Ptr("Windows Malicious Software Removal Tool x64 - October 2018 (KB890830)"), - // ActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), - // AssessmentState: to.Ptr(armcompute.PatchAssessmentStateAvailable), - // Classifications: []*string{ - // to.Ptr("Update Rollups")}, - // KbID: to.Ptr("890830"), - // LastModifiedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:18:45.283Z"); return t}()), - // PatchID: to.Ptr("39f9cdd1-795c-4d0e-8c0a-73ab3f31746d"), - // PublishedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-11-07T00:00:00.000Z"); return t}()), - // RebootBehavior: to.Ptr(armcompute.VMGuestPatchRebootBehaviorCanRequestReboot), - // Version: to.Ptr(""), - // }}, - // CriticalAndSecurityPatchCount: to.Ptr[int32](1), - // OtherPatchCount: to.Ptr[int32](2), - // RebootPending: to.Ptr(true), - // StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), - // Status: to.Ptr(armcompute.PatchOperationStatusSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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.053Z"); 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstallPatchesResult = armcompute.VirtualMachineInstallPatchesResult{ - // ExcludedPatchCount: to.Ptr[int32](0), - // FailedPatchCount: to.Ptr[int32](0), - // InstallationActivityID: to.Ptr("68f8b292-dfc2-4646-9781-33cc88631968"), - // InstalledPatchCount: to.Ptr[int32](3), - // MaintenanceWindowExceeded: to.Ptr(false), - // NotSelectedPatchCount: to.Ptr[int32](0), - // Patches: []*armcompute.PatchInstallationDetail{ - // { - // Name: to.Ptr("Definition Update for Windows Defender Antivirus - KB2267602 (Definition 1.279.1373.0)"), - // Classifications: []*string{ - // to.Ptr("Definition Updates")}, - // InstallationState: to.Ptr(armcompute.PatchInstallationStateInstalled), - // KbID: to.Ptr("2267602"), - // PatchID: to.Ptr("35428702-5784-4ba4-a6e0-5222258b5411"), - // Version: to.Ptr(""), - // }, - // { - // Name: to.Ptr("Windows Malicious Software Removal Tool x64 - October 2018 (KB890830)"), - // Classifications: []*string{ - // to.Ptr("Update Rollups")}, - // InstallationState: to.Ptr(armcompute.PatchInstallationStatePending), - // KbID: to.Ptr("890830"), - // PatchID: to.Ptr("39f9cdd1-795c-4d0e-8c0a-73ab3f31746d"), - // Version: to.Ptr(""), - // }}, - // PendingPatchCount: to.Ptr[int32](2), - // RebootStatus: to.Ptr(armcompute.VMGuestPatchRebootStatusCompleted), - // StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-24T21:02:04.255Z"); return t}()), - // Status: to.Ptr(armcompute.PatchOperationStatusSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MaximumSet_Gen.json -func ExampleVirtualMachinesClient_BeginAttachDetachDataDisks_virtualMachineAttachDetachDataDisksMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginAttachDetachDataDisks(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaa", armcompute.AttachDetachDataDisksRequest{ - DataDisksToAttach: []*armcompute.DataDisksToAttach{ - { - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - Lun: to.Ptr[int32](1), - WriteAcceleratorEnabled: to.Ptr(true), - }, - { - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDetach), - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), - Lun: to.Ptr[int32](2), - WriteAcceleratorEnabled: to.Ptr(false), - }}, - DataDisksToDetach: []*armcompute.DataDisksToDetach{ - { - DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x"), - }, - { - DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z"), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageProfile = armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDelete), - // DiskSizeGB: to.Ptr[int32](30), - // 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("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // WriteAcceleratorEnabled: to.Ptr(true), - // }, - // { - // Name: to.Ptr("vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - // DeleteOption: to.Ptr(armcompute.DiskDeleteOptionTypesDetach), - // DiskSizeGB: to.Ptr[int32](100), - // Lun: to.Ptr[int32](2), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // WriteAcceleratorEnabled: 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("myOsDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineExamples/VirtualMachine_AttachDetachDataDisks_MinimumSet_Gen.json -func ExampleVirtualMachinesClient_BeginAttachDetachDataDisks_virtualMachineAttachDetachDataDisksMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().BeginAttachDetachDataDisks(ctx, "rgcompute", "azure-vm", armcompute.AttachDetachDataDisksRequest{ - DataDisksToAttach: []*armcompute.DataDisksToAttach{ - { - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - }}, - DataDisksToDetach: []*armcompute.DataDisksToDetach{ - { - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x"), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageProfile = armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - // DiskSizeGB: to.Ptr[int32](30), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }}, - // 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("myOsDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachinesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RunCommandResult = armcompute.RunCommandResult{ - // Value: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ComponentStatus/StdOut/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("This is a sample script with parameters value1 value2"), - // }, - // { - // Code: to.Ptr("ComponentStatus/StdErr/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr(""), - // }}, - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescaleset_live_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescaleset_live_test.go index f315bb9fbec9..a5106567f437 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescaleset_live_test.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachinescaleset_live_test.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v6" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v7" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetextensions_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetextensions_client.go index dd9977933249..203e506463e0 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetextensions_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetextensions_client.go @@ -47,7 +47,7 @@ func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string, credential // BeginCreateOrUpdate - The operation to create or update an extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set where the extension should be create or updated. // - vmssExtensionName - The name of the VM scale set extension. @@ -74,7 +74,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) BeginCreateOrUpdate(ctx co // CreateOrUpdate - The operation to create or update an extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, options *VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate" @@ -120,7 +120,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { @@ -132,7 +132,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) createOrUpdateCreateReques // BeginDelete - The operation to delete the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set where the extension should be deleted. // - vmssExtensionName - The name of the VM scale set extension. @@ -158,7 +158,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) BeginDelete(ctx context.Co // Delete - The operation to delete the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, options *VirtualMachineScaleSetExtensionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetExtensionsClient.BeginDelete" @@ -204,7 +204,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -213,7 +213,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) deleteCreateRequest(ctx co // Get - The operation to get the extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set containing the extension. // - vmssExtensionName - The name of the VM scale set extension. @@ -268,7 +268,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) getCreateRequest(ctx conte if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) getHandleResponse(resp *ht // NewListPager - Gets a list of all extensions in a VM scale set. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set containing the extension. // - options - VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager @@ -333,7 +333,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) listCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) listHandleResponse(resp *h // BeginUpdate - The operation to update an extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set where the extension should be updated. // - vmssExtensionName - The name of the VM scale set extension. @@ -378,7 +378,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) BeginUpdate(ctx context.Co // Update - The operation to update an extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetExtensionsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate, options *VirtualMachineScaleSetExtensionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetExtensionsClient.BeginUpdate" @@ -424,7 +424,7 @@ func (client *VirtualMachineScaleSetExtensionsClient) updateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetextensions_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetextensions_client_example_test.go deleted file mode 100644 index 95c33a264e1c..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetextensions_client_example_test.go +++ /dev/null @@ -1,374 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_BeginCreateOrUpdate_virtualMachineScaleSetExtensionCreateOrUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().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]any{}, - ProvisionAfterExtensions: []*string{ - to.Ptr("aa")}, - Publisher: to.Ptr("{extension-Publisher}"), - Settings: map[string]any{}, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ - // ID: to.Ptr("aaaaaaaa"), - // Name: to.Ptr("{extension-name}"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - // Type: to.Ptr("{extension-Type}"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaa"), - // ProtectedSettings: map[string]any{ - // }, - // ProvisionAfterExtensions: []*string{ - // to.Ptr("aa")}, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("{extension-Publisher}"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("{handler-version}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_BeginCreateOrUpdate_virtualMachineScaleSetExtensionCreateOrUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().BeginCreateOrUpdate(ctx, "rgcompute", "aaaaaaaaaaa", "aaaaaaaaaaa", armcompute.VirtualMachineScaleSetExtension{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_BeginUpdate_virtualMachineScaleSetExtensionUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().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]any{}, - ProvisionAfterExtensions: []*string{ - to.Ptr("aa")}, - Publisher: to.Ptr("{extension-Publisher}"), - Settings: map[string]any{}, - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ - // ID: to.Ptr("aaaaaaaa"), - // Name: to.Ptr("{extension-name}"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - // Type: to.Ptr("{extension-Type}"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaa"), - // ProtectedSettings: map[string]any{ - // }, - // ProvisionAfterExtensions: []*string{ - // to.Ptr("aa")}, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("{extension-Publisher}"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("{handler-version}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Update_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_BeginUpdate_virtualMachineScaleSetExtensionUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aa", armcompute.VirtualMachineScaleSetExtensionUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_BeginDelete_virtualMachineScaleSetExtensionDeleteMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Delete_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_BeginDelete_virtualMachineScaleSetExtensionDeleteMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().BeginDelete(ctx, "rgcompute", "aaaa", "aaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_Get_virtualMachineScaleSetExtensionGetMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().Get(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetExtensionsClientGetOptions{Expand: to.Ptr("aaaaaaa")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ - // ID: to.Ptr("aaaaaaaa"), - // Name: to.Ptr("{extension-name}"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - // Type: to.Ptr("{extension-Type}"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaa"), - // ProtectedSettings: map[string]any{ - // }, - // ProvisionAfterExtensions: []*string{ - // to.Ptr("aa")}, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("{extension-Publisher}"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("{handler-version}"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_Get_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_Get_virtualMachineScaleSetExtensionGetMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetExtensionsClient().Get(ctx, "rgcompute", "a", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetExtensionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetExtension = armcompute.VirtualMachineScaleSetExtension{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_NewListPager_virtualMachineScaleSetExtensionListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetExtensionsClient().NewListPager("rgcompute", "aaaaaaaaaaaaaaaaaaaa", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetExtensionListResult = armcompute.VirtualMachineScaleSetExtensionListResult{ - // Value: []*armcompute.VirtualMachineScaleSetExtension{ - // { - // ID: to.Ptr("aaaaaaaa"), - // Name: to.Ptr("{extension-name}"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - // Type: to.Ptr("{extension-Type}"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaa"), - // ProtectedSettings: map[string]any{ - // }, - // ProvisionAfterExtensions: []*string{ - // to.Ptr("aa")}, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("{extension-Publisher}"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("{handler-version}"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetExtension_List_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetExtensionsClient_NewListPager_virtualMachineScaleSetExtensionListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetExtensionsClient().NewListPager("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetExtensionListResult = armcompute.VirtualMachineScaleSetExtensionListResult{ - // Value: []*armcompute.VirtualMachineScaleSetExtension{ - // { - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetrollingupgrades_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetrollingupgrades_client.go index fa892351f3c4..019bc9c05df3 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetrollingupgrades_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetrollingupgrades_client.go @@ -47,7 +47,7 @@ func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string, crede // BeginCancel - Cancels the current virtual machine scale set rolling upgrade. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel @@ -72,7 +72,7 @@ func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginCancel(ctx conte // Cancel - Cancels the current virtual machine scale set rolling upgrade. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetRollingUpgradesClient) cancel(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginCancel" @@ -114,7 +114,7 @@ func (client *VirtualMachineScaleSetRollingUpgradesClient) cancelCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,7 +123,7 @@ func (client *VirtualMachineScaleSetRollingUpgradesClient) cancelCreateRequest(c // GetLatest - Gets the status of the latest virtual machine scale set rolling upgrade. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest @@ -170,7 +170,7 @@ func (client *VirtualMachineScaleSetRollingUpgradesClient) getLatestCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,7 +190,7 @@ func (client *VirtualMachineScaleSetRollingUpgradesClient) getLatestHandleRespon // are not affected. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters @@ -217,7 +217,7 @@ func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartExtensionUp // are not affected. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade" @@ -259,7 +259,7 @@ func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgrade return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *VirtualMachineScaleSetRollingUpgradesClient) startExtensionUpgrade // affected. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the @@ -297,7 +297,7 @@ func (client *VirtualMachineScaleSetRollingUpgradesClient) BeginStartOSUpgrade(c // affected. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetRollingUpgradesClient) startOSUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade" @@ -339,7 +339,7 @@ func (client *VirtualMachineScaleSetRollingUpgradesClient) startOSUpgradeCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetrollingupgrades_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetrollingupgrades_client_example_test.go deleted file mode 100644 index d0d07c228671..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetrollingupgrades_client_example_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. -// DO NOT EDIT. - -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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetRollingUpgradesClient_BeginCancel_virtualMachineScaleSetRollingUpgradeCancelMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_Cancel_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetRollingUpgradesClient_BeginCancel_virtualMachineScaleSetRollingUpgradeCancelMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().BeginCancel(ctx, "rgcompute", "aaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetRollingUpgradesClient_BeginStartOSUpgrade_virtualMachineScaleSetRollingUpgradeStartOsUpgradeMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_StartOSUpgrade_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetRollingUpgradesClient_BeginStartOSUpgrade_virtualMachineScaleSetRollingUpgradeStartOsUpgradeMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().BeginStartOSUpgrade(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetRollingUpgradesClient_GetLatest_virtualMachineScaleSetRollingUpgradeGetLatestMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().GetLatest(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RollingUpgradeStatusInfo = armcompute.RollingUpgradeStatusInfo{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // ID: to.Ptr("aaaaaaaaaa"), - // Location: to.Ptr("aaaaaa"), - // Tags: map[string]*string{ - // "key8533": to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.RollingUpgradeStatusInfoProperties{ - // Error: &armcompute.APIError{ - // Code: to.Ptr("aaaaaaa"), - // Innererror: &armcompute.InnerError{ - // Errordetail: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Exceptiontype: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Message: to.Ptr("aaaaaaaaa"), - // Target: to.Ptr("aaaaaaa"), - // Details: []*armcompute.APIErrorBase{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Message: to.Ptr("aa"), - // Target: to.Ptr("aaaa"), - // }}, - // }, - // Policy: &armcompute.RollingUpgradePolicy{ - // EnableCrossZoneUpgrade: to.Ptr(true), - // MaxBatchInstancePercent: to.Ptr[int32](49), - // MaxSurge: to.Ptr(true), - // MaxUnhealthyInstancePercent: to.Ptr[int32](81), - // MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), - // PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), - // PrioritizeUnhealthyInstances: to.Ptr(true), - // RollbackFailedInstancesOnPolicyBreach: to.Ptr(true), - // }, - // Progress: &armcompute.RollingUpgradeProgressInfo{ - // FailedInstanceCount: to.Ptr[int32](25), - // InProgressInstanceCount: to.Ptr[int32](20), - // PendingInstanceCount: to.Ptr[int32](27), - // SuccessfulInstanceCount: to.Ptr[int32](6), - // }, - // RunningStatus: &armcompute.RollingUpgradeRunningStatus{ - // Code: to.Ptr(armcompute.RollingUpgradeStatusCodeRollingForward), - // LastAction: to.Ptr(armcompute.RollingUpgradeActionTypeStart), - // LastActionTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:06:23.362Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:06:23.362Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetRollingUpgrade_GetLatest_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetRollingUpgradesClient_GetLatest_virtualMachineScaleSetRollingUpgradeGetLatestMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetRollingUpgradesClient().GetLatest(ctx, "rgcompute", "aaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RollingUpgradeStatusInfo = armcompute.RollingUpgradeStatusInfo{ - // ID: to.Ptr("aaaaaaaaaa"), - // Location: to.Ptr("aaaaaa"), - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesets_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesets_client.go index cd16192460ed..d691d44e8a4b 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesets_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesets_client.go @@ -49,7 +49,7 @@ func NewVirtualMachineScaleSetsClient(subscriptionID string, credential azcore.T // scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade @@ -75,7 +75,7 @@ func (client *VirtualMachineScaleSetsClient) BeginApproveRollingUpgrade(ctx cont // set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) approveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginApproveRollingUpgrade" @@ -117,7 +117,7 @@ func (client *VirtualMachineScaleSetsClient) approveRollingUpgradeCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.VMInstanceIDs != nil { @@ -132,7 +132,7 @@ func (client *VirtualMachineScaleSetsClient) approveRollingUpgradeCreateRequest( // ConvertToSinglePlacementGroup - Converts SinglePlacementGroup property to false for a existing virtual machine scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the virtual machine scale set to create or update. // - parameters - The input object for ConvertToSinglePlacementGroup API. @@ -179,7 +179,7 @@ func (client *VirtualMachineScaleSetsClient) convertToSinglePlacementGroupCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -191,7 +191,7 @@ func (client *VirtualMachineScaleSetsClient) convertToSinglePlacementGroupCreate // BeginCreateOrUpdate - Create or update a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set to create or update. // - parameters - The scale set object. @@ -217,7 +217,7 @@ func (client *VirtualMachineScaleSetsClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Create or update a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSet, options *VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginCreateOrUpdate" @@ -259,7 +259,7 @@ func (client *VirtualMachineScaleSetsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -279,7 +279,7 @@ func (client *VirtualMachineScaleSetsClient) createOrUpdateCreateRequest(ctx con // scale set deallocates. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate @@ -306,7 +306,7 @@ func (client *VirtualMachineScaleSetsClient) BeginDeallocate(ctx context.Context // scale set deallocates. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) deallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeallocateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginDeallocate" @@ -348,7 +348,7 @@ func (client *VirtualMachineScaleSetsClient) deallocateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.Hibernate != nil { reqQP.Set("hibernate", strconv.FormatBool(*options.Hibernate)) } @@ -366,7 +366,7 @@ func (client *VirtualMachineScaleSetsClient) deallocateCreateRequest(ctx context // BeginDelete - Deletes a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete @@ -391,7 +391,7 @@ func (client *VirtualMachineScaleSetsClient) BeginDelete(ctx context.Context, re // Delete - Deletes a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginDelete" @@ -433,7 +433,7 @@ func (client *VirtualMachineScaleSetsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.ForceDeletion != nil { reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) } @@ -445,7 +445,7 @@ func (client *VirtualMachineScaleSetsClient) deleteCreateRequest(ctx context.Con // BeginDeleteInstances - Deletes virtual machines in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - vmInstanceIDs - A list of virtual machine instance IDs from the VM scale set. @@ -471,7 +471,7 @@ func (client *VirtualMachineScaleSetsClient) BeginDeleteInstances(ctx context.Co // DeleteInstances - Deletes virtual machines in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) deleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginDeleteInstancesOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginDeleteInstances" @@ -513,7 +513,7 @@ func (client *VirtualMachineScaleSetsClient) deleteInstancesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.ForceDeletion != nil { reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) } @@ -529,7 +529,7 @@ func (client *VirtualMachineScaleSetsClient) deleteInstancesCreateRequest(ctx co // service fabric virtual machine scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - platformUpdateDomain - The platform update domain for which a manual recovery walk is requested @@ -577,7 +577,7 @@ func (client *VirtualMachineScaleSetsClient) forceRecoveryServiceFabricPlatformU return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.PlacementGroupID != nil { reqQP.Set("placementGroupId", *options.PlacementGroupID) } @@ -602,7 +602,7 @@ func (client *VirtualMachineScaleSetsClient) forceRecoveryServiceFabricPlatformU // Get - Display information about a virtual machine scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get @@ -652,7 +652,7 @@ func (client *VirtualMachineScaleSetsClient) getCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -670,7 +670,7 @@ func (client *VirtualMachineScaleSetsClient) getHandleResponse(resp *http.Respon // GetInstanceView - Gets the status of a VM scale set instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView @@ -717,7 +717,7 @@ func (client *VirtualMachineScaleSetsClient) getInstanceViewCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -734,7 +734,7 @@ func (client *VirtualMachineScaleSetsClient) getInstanceViewHandleResponse(resp // NewGetOSUpgradeHistoryPager - Gets list of OS upgrades on a VM scale set instance. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager @@ -782,7 +782,7 @@ func (client *VirtualMachineScaleSetsClient) getOSUpgradeHistoryCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -799,7 +799,7 @@ func (client *VirtualMachineScaleSetsClient) getOSUpgradeHistoryHandleResponse(r // NewListPager - Gets a list of all VM scale sets under a resource group. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - options - VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager // method. @@ -842,7 +842,7 @@ func (client *VirtualMachineScaleSetsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -861,7 +861,7 @@ func (client *VirtualMachineScaleSetsClient) listHandleResponse(resp *http.Respo // nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is // null to fetch all the VM Scale Sets. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - options - VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager // method. func (client *VirtualMachineScaleSetsClient) NewListAllPager(options *VirtualMachineScaleSetsClientListAllOptions) *runtime.Pager[VirtualMachineScaleSetsClientListAllResponse] { @@ -899,7 +899,7 @@ func (client *VirtualMachineScaleSetsClient) listAllCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -916,7 +916,7 @@ func (client *VirtualMachineScaleSetsClient) listAllHandleResponse(resp *http.Re // NewListByLocationPager - Gets all the VM scale sets under the specified subscription for the specified location. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The location for which VM scale sets under the subscription are queried. // - options - VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager // method. @@ -959,7 +959,7 @@ func (client *VirtualMachineScaleSetsClient) listByLocationCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -977,7 +977,7 @@ func (client *VirtualMachineScaleSetsClient) listByLocationHandleResponse(resp * // NewListSKUsPager - Gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances // allowed for each SKU. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager @@ -1025,7 +1025,7 @@ func (client *VirtualMachineScaleSetsClient) listSKUsCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1045,7 +1045,7 @@ func (client *VirtualMachineScaleSetsClient) listSKUsHandleResponse(resp *http.R // details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance @@ -1072,7 +1072,7 @@ func (client *VirtualMachineScaleSetsClient) BeginPerformMaintenance(ctx context // details: https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) performMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginPerformMaintenance" @@ -1114,7 +1114,7 @@ func (client *VirtualMachineScaleSetsClient) performMaintenanceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.VMInstanceIDs != nil { @@ -1128,11 +1128,10 @@ func (client *VirtualMachineScaleSetsClient) performMaintenanceCreateRequest(ctx // BeginPowerOff - Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached // and you are getting charged for the resources. Instead, use deallocate to release resources and -// avoid charges. Additionally, this operation is not allowed on virtual machines in a VM scale set that are being deallocated -// or have already been deallocated. +// avoid charges. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff @@ -1156,11 +1155,10 @@ func (client *VirtualMachineScaleSetsClient) BeginPowerOff(ctx context.Context, // PowerOff - Power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and // you are getting charged for the resources. Instead, use deallocate to release resources and -// avoid charges. Additionally, this operation is not allowed on virtual machines in a VM scale set that are being deallocated -// or have already been deallocated. +// avoid charges. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) powerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginPowerOffOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginPowerOff" @@ -1202,7 +1200,7 @@ func (client *VirtualMachineScaleSetsClient) powerOffCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.SkipShutdown != nil { reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) } @@ -1220,7 +1218,7 @@ func (client *VirtualMachineScaleSetsClient) powerOffCreateRequest(ctx context.C // BeginReapply - Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply @@ -1246,7 +1244,7 @@ func (client *VirtualMachineScaleSetsClient) BeginReapply(ctx context.Context, r // Reapply - Reapplies the Virtual Machine Scale Set Virtual Machine Profile to the Virtual Machine Instances // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) reapply(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReapplyOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginReapply" @@ -1288,7 +1286,7 @@ func (client *VirtualMachineScaleSetsClient) reapplyCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1298,7 +1296,7 @@ func (client *VirtualMachineScaleSetsClient) reapplyCreateRequest(ctx context.Co // them back on. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy @@ -1324,7 +1322,7 @@ func (client *VirtualMachineScaleSetsClient) BeginRedeploy(ctx context.Context, // back on. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) redeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRedeployOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginRedeploy" @@ -1366,7 +1364,7 @@ func (client *VirtualMachineScaleSetsClient) redeployCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.VMInstanceIDs != nil { @@ -1383,7 +1381,7 @@ func (client *VirtualMachineScaleSetsClient) redeployCreateRequest(ctx context.C // reset to initial state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage @@ -1410,7 +1408,7 @@ func (client *VirtualMachineScaleSetsClient) BeginReimage(ctx context.Context, r // reset to initial state. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) reimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginReimage" @@ -1452,7 +1450,7 @@ func (client *VirtualMachineScaleSetsClient) reimageCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.VMScaleSetReimageInput != nil { @@ -1468,7 +1466,7 @@ func (client *VirtualMachineScaleSetsClient) reimageCreateRequest(ctx context.Co // is only supported for managed disks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll @@ -1494,7 +1492,7 @@ func (client *VirtualMachineScaleSetsClient) BeginReimageAll(ctx context.Context // is only supported for managed disks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) reimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginReimageAllOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginReimageAll" @@ -1536,7 +1534,7 @@ func (client *VirtualMachineScaleSetsClient) reimageAllCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.VMInstanceIDs != nil { @@ -1551,7 +1549,7 @@ func (client *VirtualMachineScaleSetsClient) reimageAllCreateRequest(ctx context // BeginRestart - Restarts one or more virtual machines in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart @@ -1576,7 +1574,7 @@ func (client *VirtualMachineScaleSetsClient) BeginRestart(ctx context.Context, r // Restart - Restarts one or more virtual machines in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) restart(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginRestart" @@ -1618,7 +1616,7 @@ func (client *VirtualMachineScaleSetsClient) restartCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.VMInstanceIDs != nil { @@ -1633,7 +1631,7 @@ func (client *VirtualMachineScaleSetsClient) restartCreateRequest(ctx context.Co // BeginSetOrchestrationServiceState - Changes ServiceState property for a given service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the virtual machine scale set to create or update. // - parameters - The input object for SetOrchestrationServiceState API. @@ -1659,7 +1657,7 @@ func (client *VirtualMachineScaleSetsClient) BeginSetOrchestrationServiceState(c // SetOrchestrationServiceState - Changes ServiceState property for a given service // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceState(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters OrchestrationServiceStateInput, options *VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState" @@ -1701,7 +1699,7 @@ func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceStateCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1713,7 +1711,7 @@ func (client *VirtualMachineScaleSetsClient) setOrchestrationServiceStateCreateR // BeginStart - Starts one or more virtual machines in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart @@ -1738,7 +1736,7 @@ func (client *VirtualMachineScaleSetsClient) BeginStart(ctx context.Context, res // Start - Starts one or more virtual machines in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) start(ctx context.Context, resourceGroupName string, vmScaleSetName string, options *VirtualMachineScaleSetsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginStart" @@ -1780,7 +1778,7 @@ func (client *VirtualMachineScaleSetsClient) startCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.VMInstanceIDs != nil { @@ -1795,7 +1793,7 @@ func (client *VirtualMachineScaleSetsClient) startCreateRequest(ctx context.Cont // BeginUpdate - Update a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set to create or update. // - parameters - The scale set object. @@ -1821,7 +1819,7 @@ func (client *VirtualMachineScaleSetsClient) BeginUpdate(ctx context.Context, re // Update - Update a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, parameters VirtualMachineScaleSetUpdate, options *VirtualMachineScaleSetsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginUpdate" @@ -1863,7 +1861,7 @@ func (client *VirtualMachineScaleSetsClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -1881,7 +1879,7 @@ func (client *VirtualMachineScaleSetsClient) updateCreateRequest(ctx context.Con // BeginUpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - vmInstanceIDs - A list of virtual machine instance IDs from the VM scale set. @@ -1907,7 +1905,7 @@ func (client *VirtualMachineScaleSetsClient) BeginUpdateInstances(ctx context.Co // UpdateInstances - Upgrades one or more virtual machines to the latest SKU set in the VM scale set model. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetsClient) updateInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, options *VirtualMachineScaleSetsClientBeginUpdateInstancesOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetsClient.BeginUpdateInstances" @@ -1949,7 +1947,7 @@ func (client *VirtualMachineScaleSetsClient) updateInstancesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, vmInstanceIDs); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesets_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesets_client_example_test.go deleted file mode 100644 index 761d6a09e89f..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesets_client_example_test.go +++ /dev/null @@ -1,11363 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListByLocationPager("eastus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetListResult = armcompute.VirtualMachineScaleSetListResult{ - // Value: []*armcompute.VirtualMachineScaleSet{ - // { - // Name: to.Ptr("{virtualMachineScaleSetName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), - // Overprovision: to.Ptr(false), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(false), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // EnableAutomaticOSUpgrade: to.Ptr(false), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("myNic"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("myIPConfig"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // Primary: to.Ptr(true), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), - // }, - // }, - // }}, - // NetworkSecurityGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), - // }, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerNamePrefix: to.Ptr("{virtualMachineScaleSetName}"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("databricks"), - // Publisher: to.Ptr("azuredatabricks"), - // SKU: to.Ptr("databricksworker"), - // Version: to.Ptr("3.15.2"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2s_v3"), - // Capacity: to.Ptr[int64](4), - // Tier: to.Ptr("Standard"), - // }, - // }, - // { - // Name: to.Ptr("{virtualMachineScaleSetName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue2"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), - // Overprovision: to.Ptr(false), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(false), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // EnableAutomaticOSUpgrade: to.Ptr(false), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("myNic1"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("myIPConfig"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // Primary: to.Ptr(true), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), - // }, - // }, - // }}, - // NetworkSecurityGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), - // }, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerNamePrefix: to.Ptr("{virtualMachineScaleSetName}"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("databricks"), - // Publisher: to.Ptr("azuredatabricks"), - // SKU: to.Ptr("databricksworker"), - // Version: to.Ptr("3.15.2"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2s_v3"), - // Capacity: to.Ptr[int64](4), - // Tier: to.Ptr("Standard"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsSuppressFailuresEnabled.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAVmssWithAnExtensionThatHasSuppressFailuresEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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]any{}, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // 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://nsgdiagnostic.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]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("{handler-version}"), - // }, - // }}, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProtectedSettingsFromKeyVault.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAVmssWithAnExtensionWithProtectedSettingsFromKeyVault() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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), - ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ - SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), - SourceVault: &armcompute.SubResource{ - ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), - }, - }, - Publisher: to.Ptr("{extension-Publisher}"), - Settings: map[string]any{}, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // 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://nsgdiagnostic.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), - // ProtectedSettingsFromKeyVault: &armcompute.KeyVaultSecretReference{ - // SecretURL: to.Ptr("https://kvName.vault.azure.net/secrets/secretName/79b88b3a6f5440ffb2e73e44a0db712e"), - // SourceVault: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/a53f7094-a16c-47af-abe4-b05c05d0d79a/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/kvName"), - // }, - // }, - // Publisher: to.Ptr("{extension-Publisher}"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("{handler-version}"), - // }, - // }}, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_CustomImageFromAnUnmanagedGeneralizedOsImage.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createACustomImageScaleSetFromAnUnmanagedGeneralizedOsImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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{ - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Name: to.Ptr("osDisk"), - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - Image: &armcompute.VirtualHardDisk{ - URI: to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d6e9ab29-f8c9-4792-978c-ae2c07b98f17"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("osDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // Image: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("https://{existing-storage-account-name}.blob.core.windows.net/system/Microsoft.Compute/Images/vhds/{existing-generalized-os-image-blob-name}.vhd"), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_PlatformImageWithUnmanagedOsDisks.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAPlatformImageScaleSetWithUnmanagedOsDisks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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{ - Name: to.Ptr("osDisk"), - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - VhdContainers: []*string{ - to.Ptr("http://{existing-storage-account-name-0}.blob.core.windows.net/vhdContainer"), - to.Ptr("http://{existing-storage-account-name-1}.blob.core.windows.net/vhdContainer"), - to.Ptr("http://{existing-storage-account-name-2}.blob.core.windows.net/vhdContainer"), - to.Ptr("http://{existing-storage-account-name-3}.blob.core.windows.net/vhdContainer"), - to.Ptr("http://{existing-storage-account-name-4}.blob.core.windows.net/vhdContainer")}, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("77b7df9a-32fe-45e3-8911-60ac9c9b9c64"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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{ - // Name: to.Ptr("osDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // VhdContainers: []*string{ - // to.Ptr("http://{existing-storage-account-name}.blob.core.windows.net/vhds")}, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromACustomImage.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetFromACustomImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromAGeneralizedSharedImage.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetFromAGeneralizedSharedImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"), - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromASpecializedSharedImage.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetFromASpecializedSharedImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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), - }, - }}, - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"), - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithDisableTcpStateTrackingNetworkInterface.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWhereNicConfigHasDisableTcpStateTrackingProperty() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - { - Name: to.Ptr("{nicConfig1-name}"), - Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - DisableTCPStateTracking: to.Ptr(true), - EnableAcceleratedNetworking: to.Ptr(true), - 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), - }, - }, - { - Name: to.Ptr("{nicConfig2-name}"), - Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - DisableTCPStateTracking: to.Ptr(false), - EnableAcceleratedNetworking: to.Ptr(false), - EnableIPForwarding: to.Ptr(false), - IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - { - Name: to.Ptr("{nicConfig2-name}"), - Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - Primary: to.Ptr(true), - PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - Subnet: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"), - }, - }, - }}, - Primary: to.Ptr(false), - }, - }}, - }, - OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - AdminPassword: to.Ptr("{your-password}"), - AdminUsername: to.Ptr("{your-username}"), - ComputerNamePrefix: to.Ptr("{vmss-name}"), - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{nicConfig1-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{nicConfig1-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("{nicConfig2-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DisableTCPStateTracking: to.Ptr(false), - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableFpga: to.Ptr(false), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{nicConfig2-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"), - // }, - // }, - // }}, - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithApplicationProfile.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithApplicationProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - ApplicationProfile: &armcompute.ApplicationProfile{ - GalleryApplications: []*armcompute.VMGalleryApplication{ - { - ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), - EnableAutomaticUpgrade: to.Ptr(false), - Order: to.Ptr[int32](1), - PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), - Tags: to.Ptr("myTag1"), - TreatFailureAsDeploymentFailure: to.Ptr(true), - }, - { - PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), - }}, - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("ffb27c5c-39a5-4d4e-b307-b32598689813"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), - // Order: to.Ptr[int32](1), - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), - // Tags: to.Ptr("myTag1"), - // }, - // { - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), - // }}, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskControllerType.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithDiskControllerType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - Enable: to.Ptr(true), - }, - }, - UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - AutomaticallyApprove: to.Ptr(true), - }, - UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - AutomaticallyApprove: to.Ptr(true), - }, - }, - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - HardwareProfile: &armcompute.VirtualMachineScaleSetHardwareProfile{ - VMSizeProperties: &armcompute.VMSizeProperties{ - VCPUsAvailable: to.Ptr[int32](1), - VCPUsPerCore: to.Ptr[int32](1), - }, - }, - 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{ - DiskControllerType: to.Ptr("NVMe"), - 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), - }, - }, - }, - UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - // Enable: to.Ptr(true), - // }, - // }, - // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // }, - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // 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://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // HardwareProfile: &armcompute.VirtualMachineScaleSetHardwareProfile{ - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](1), - // VCPUsPerCore: to.Ptr[int32](1), - // }, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // DiskControllerType: to.Ptr("NVMe"), - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiskEncryptionSetResource.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithDiskEncryptionSetResourceInOsDiskAndDataDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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{ - DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - { - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](0), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }}, - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_DS1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // { - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }}, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithFpgaNetworkInterface.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithFpgaNetworkInterfaces() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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), - }, - }, - { - Name: to.Ptr("{fpgaNic-Name}"), - Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - EnableAcceleratedNetworking: to.Ptr(false), - EnableFpga: to.Ptr(true), - EnableIPForwarding: to.Ptr(false), - IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - { - Name: to.Ptr("{fpgaNic-Name}"), - Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - Primary: to.Ptr(true), - PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - Subnet: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}"), - }, - }, - }}, - Primary: to.Ptr(false), - }, - }}, - }, - OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - AdminPassword: to.Ptr("{your-password}"), - AdminUsername: to.Ptr("{your-username}"), - ComputerNamePrefix: to.Ptr("{vmss-name}"), - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("{fpgaNic-Name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableFpga: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{fpgaNic-Name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name}"), - // }, - // }, - // }}, - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEncryptionAtHost.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithHostEncryptionUsingEncryptionAtHostProperty() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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}"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - EncryptionAtHost: to.Ptr(true), - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_DS1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // SecurityProfile: &armcompute.SecurityProfile{ - // EncryptionAtHost: to.Ptr(true), - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DS1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_FromWithNetworkInterfaceWithDnsSettings.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithNetworkInterfacesWithPublicIpAddressDnsSettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - { - Name: to.Ptr("{nicConfig1-name}"), - Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - AuxiliaryMode: to.Ptr(armcompute.NetworkInterfaceAuxiliaryModeAcceleratedConnections), - AuxiliarySKU: to.Ptr(armcompute.NetworkInterfaceAuxiliarySKUA1), - DisableTCPStateTracking: to.Ptr(true), - EnableAcceleratedNetworking: to.Ptr(true), - 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), - }, - }, - { - Name: to.Ptr("{nicConfig2-name}"), - Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - DisableTCPStateTracking: to.Ptr(false), - EnableAcceleratedNetworking: to.Ptr(false), - EnableIPForwarding: to.Ptr(false), - IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - { - Name: to.Ptr("{nicConfig2-name}"), - Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - Primary: to.Ptr(true), - PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ - Name: to.Ptr("publicip"), - Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - DomainNameLabel: to.Ptr("vmsstestlabel01"), - DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesNoReuse), - }, - IdleTimeoutInMinutes: to.Ptr[int32](10), - }, - }, - Subnet: &armcompute.APIEntityReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"), - }, - }, - }}, - Primary: to.Ptr(false), - }, - }}, - }, - OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - AdminPassword: to.Ptr("{your-password}"), - AdminUsername: to.Ptr("{your-username}"), - ComputerNamePrefix: to.Ptr("{vmss-name}"), - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"), - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("afa2afa8-9e49-48fb-9d18-c86323b5d064"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{nicConfig1-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // AuxiliaryMode: to.Ptr(armcompute.NetworkInterfaceAuxiliaryModeAcceleratedConnections), - // AuxiliarySKU: to.Ptr(armcompute.NetworkInterfaceAuxiliarySKUA1), - // DisableTCPStateTracking: to.Ptr(true), - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{nicConfig1-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ - // Name: to.Ptr("publicip"), - // Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - // DomainNameLabel: to.Ptr("vmsstestlabel01"), - // DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesTenantReuse), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](10), - // }, - // }, - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }, - // { - // Name: to.Ptr("{nicConfig2-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DisableTCPStateTracking: to.Ptr(false), - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableFpga: to.Ptr(false), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{nicConfig2-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // Primary: to.Ptr(true), - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/{existing-virtual-network-name}/subnets/{existing-fpga-subnet-name2}"), - // }, - // }, - // }}, - // Primary: to.Ptr(false), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"), - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithOSImageScheduledEventEnabled.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithOsImageScheduledEventsEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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}"), - }, - ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ - Enable: to.Ptr(true), - NotBeforeTimeout: to.Ptr("PT15M"), - }, - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - // OSImageNotificationProfile: &armcompute.OSImageNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("PT15M"), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithProxyAgentSettings.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithProxyAgentSettingsOfEnabledAndMode() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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}"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - ProxyAgentSettings: &armcompute.ProxyAgentSettings{ - Enabled: to.Ptr(true), - Mode: to.Ptr(armcompute.ModeEnforce), - }, - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("2019-Datacenter"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D2s_v3"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // SecurityProfile: &armcompute.SecurityProfile{ - // ProxyAgentSettings: &armcompute.ProxyAgentSettings{ - // Enabled: to.Ptr(true), - // Mode: to.Ptr(armcompute.ModeEnforce), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("2019-Datacenter"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2s_v3"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMCreationPolicy.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithResilientVmCreationEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(false), - ResiliencyPolicy: &armcompute.ResiliencyPolicy{ - ResilientVMCreationPolicy: &armcompute.ResilientVMCreationPolicy{ - Enabled: to.Ptr(true), - }, - }, - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(false), - // ProvisioningState: to.Ptr("Succeeded"), - // ResiliencyPolicy: &armcompute.ResiliencyPolicy{ - // ResilientVMCreationPolicy: &armcompute.ResilientVMCreationPolicy{ - // Enabled: to.Ptr(true), - // }, - // }, - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithResilientVMDeletionPolicy.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithResilientVmDeletionEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(false), - ResiliencyPolicy: &armcompute.ResiliencyPolicy{ - ResilientVMDeletionPolicy: &armcompute.ResilientVMDeletionPolicy{ - Enabled: to.Ptr(true), - }, - }, - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(false), - // ProvisioningState: to.Ptr("Succeeded"), - // ResiliencyPolicy: &armcompute.ResiliencyPolicy{ - // ResilientVMDeletionPolicy: &armcompute.ResilientVMDeletionPolicy{ - // Enabled: to.Ptr(true), - // }, - // }, - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityPostureReference.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithSecurityPostureReference() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("eastus2euap"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - UpgradePolicy: &armcompute.UpgradePolicy{ - AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - EnableAutomaticOSUpgrade: to.Ptr(true), - }, - Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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}"), - }, - SecurityPostureReference: &armcompute.SecurityPostureReference{ - ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("2022-Datacenter"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Name: to.Ptr("osDisk"), - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_A1"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d12ccb3d-ab15-4794-9836-c4196392e9f2"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // EnableAutomaticOSUpgrade: to.Ptr(true), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // SecurityPostureReference: &armcompute.SecurityPostureReference{ - // ID: to.Ptr("/CommunityGalleries/{communityGalleryName}/securityPostures/{securityPostureName}/versions/{major.minor.patch}|{major.*}|latest"), - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("2022-Datacenter"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("osDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_A1"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVM.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithSecurityTypeAsConfidentialVm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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}"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), - UefiSettings: &armcompute.UefiSettings{ - SecureBootEnabled: to.Ptr(true), - VTpmEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("2019-datacenter-cvm"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("windows-cvm"), - Version: to.Ptr("17763.2183.2109130127"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - SecurityProfile: &armcompute.VMDiskSecurityProfile{ - SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_DC2as_v5"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // SecurityProfile: &armcompute.SecurityProfile{ - // SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), - // UefiSettings: &armcompute.UefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // VTpmEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("2019-datacenter-cvm"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("windows-cvm"), - // Version: to.Ptr("17763.2183.2109130127"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // SecurityProfile: &armcompute.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesVMGuestStateOnly), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DC2as_v5"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSecurityTypeConfidentialVMWithNonPersistedTPM.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithSecurityTypeAsConfidentialVmAndNonPersistedTpmSecurityEncryptionType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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}"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), - UefiSettings: &armcompute.UefiSettings{ - SecureBootEnabled: to.Ptr(false), - VTpmEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("2022-datacenter-cvm"), - Publisher: to.Ptr("UbuntuServer"), - SKU: to.Ptr("linux-cvm"), - Version: to.Ptr("17763.2183.2109130127"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - SecurityProfile: &armcompute.VMDiskSecurityProfile{ - SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesNonPersistedTPM), - }, - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_DC2es_v5"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // SecurityProfile: &armcompute.SecurityProfile{ - // SecurityType: to.Ptr(armcompute.SecurityTypesConfidentialVM), - // UefiSettings: &armcompute.UefiSettings{ - // SecureBootEnabled: to.Ptr(false), - // VTpmEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("2022-datacenter-cvm"), - // Publisher: to.Ptr("UbuntuServer"), - // SKU: to.Ptr("linux-cvm"), - // Version: to.Ptr("17763.2183.2109130127"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // SecurityProfile: &armcompute.VMDiskSecurityProfile{ - // SecurityEncryptionType: to.Ptr(armcompute.SecurityEncryptionTypesNonPersistedTPM), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DC2es_v5"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithServiceArtifactReference.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithServiceArtifactReference() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("eastus2euap"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - UpgradePolicy: &armcompute.UpgradePolicy{ - AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - EnableAutomaticOSUpgrade: to.Ptr(true), - }, - Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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}"), - }, - ServiceArtifactReference: &armcompute.ServiceArtifactReference{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName"), - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("WindowsServer"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("2022-Datacenter"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Name: to.Ptr("osDisk"), - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_A1"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("eastus2euap"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("77b7df9a-32fe-45e3-8911-60ac9c9b9c64"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // EnableAutomaticOSUpgrade: to.Ptr(true), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ServiceArtifactReference: &armcompute.ServiceArtifactReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/myGalleryName/serviceArtifacts/serviceArtifactName/vmArtifactsProfiles/vmArtifactsProfilesName"), - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("2022-Datacenter"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("osDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_A1"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUefiSettings.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithUefiSettingsOfSecureBootAndVTpm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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}"), - }, - SecurityProfile: &armcompute.SecurityProfile{ - SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), - UefiSettings: &armcompute.UefiSettings{ - SecureBootEnabled: to.Ptr(true), - VTpmEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("windowsserver-gen2preview-preview"), - Publisher: to.Ptr("MicrosoftWindowsServer"), - SKU: to.Ptr("windows10-tvm"), - Version: to.Ptr("18363.592.2001092016"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D2s_v3"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // SecurityProfile: &armcompute.SecurityProfile{ - // SecurityType: to.Ptr(armcompute.SecurityTypesTrustedLaunch), - // UefiSettings: &armcompute.UefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // VTpmEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("windowsserver-gen2preview-preview"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SKU: to.Ptr("windows10-tvm"), - // Version: to.Ptr("18363.592.2001092016"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardSSDLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2s_v3"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAMarketplaceImagePlan.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithAMarketplaceImagePlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureApplicationGateway.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithAnAzureApplicationGateway() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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{ - ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{existing-application-gateway-name}/backendAddressPools/{existing-backend-address-pool-name}"), - }}, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("a0134477-b9d9-484b-b0e3-205c1c089ffa"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/nsgExistingAppGw/backendAddressPools/appGatewayBackendPool"), - // }}, - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAzureLoadBalancer.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithAnAzureLoadBalancer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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{ - LoadBalancerBackendAddressPools: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/backendAddressPools/{existing-backend-address-pool-name}"), - }}, - LoadBalancerInboundNatPools: []*armcompute.SubResource{ - { - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{existing-load-balancer-name}/inboundNatPools/{existing-nat-pool-name}"), - }}, - PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ - Name: to.Ptr("{vmss-name}"), - Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - PublicIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - }, - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("ec0b21ca-51ec-414b-9323-f236ffc21479"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/myLb/backendAddressPools/lbBackendPool"), - // }}, - // LoadBalancerInboundNatPools: []*armcompute.SubResource{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/myLb/inboundNatPools/lbNatPool"), - // }}, - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithAutomaticRepairs.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithAutomaticRepairsEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ - Enabled: to.Ptr(true), - GracePeriod: to.Ptr("PT10M"), - }, - Overprovision: to.Ptr(true), - ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - Enable: to.Ptr(true), - }, - }, - UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - AutomaticallyApprove: to.Ptr(true), - }, - UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - AutomaticallyApprove: to.Ptr(true), - }, - }, - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ - // Enabled: to.Ptr(true), - // GracePeriod: to.Ptr("PT10M"), - // }, - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - // Enable: to.Ptr(true), - // }, - // }, - // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // }, - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithBootDiagnostics.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithBootDiagnostics() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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"), - }, - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // 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://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithEmptyDataDisksOnEachVm.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithEmptyDataDisksOnEachVm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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{ - DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - { - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](0), - }, - { - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](1), - }}, - 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), - DiskSizeGB: to.Ptr[int32](512), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D2_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("8042c376-4690-4c47-9fa2-fbdad70e32fa"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }}, - // 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), - // DiskSizeGB: to.Ptr[int32](512), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacementAsNvmeDisk.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithEphemeralOsDiskProvisioningInNvmeDiskUsingPlacementProperty() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - DiffDiskSettings: &armcompute.DiffDiskSettings{ - Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - Placement: to.Ptr(armcompute.DiffDiskPlacementNvmeDisk), - }, - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_DS1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcompute.DiffDiskPlacementNvmeDisk), - // }, - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DS1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_CreateA_WithDiffOsDiskUsingDiffDiskPlacement.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithEphemeralOsDisksUsingPlacementProperty() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - DiffDiskSettings: &armcompute.DiffDiskSettings{ - Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - Placement: to.Ptr(armcompute.DiffDiskPlacementResourceDisk), - }, - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_DS1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcompute.DiffDiskPlacementResourceDisk), - // }, - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DS1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithDiffOsDisk.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithEphemeralOsDisks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Plan: &armcompute.Plan{ - Name: to.Ptr("windows2016"), - Product: to.Ptr("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - }, - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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("windows-data-science-vm"), - Publisher: to.Ptr("microsoft-ads"), - SKU: to.Ptr("windows2016"), - Version: to.Ptr("latest"), - }, - OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - DiffDiskSettings: &armcompute.DiffDiskSettings{ - Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - }, - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_DS1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Plan: &armcompute.Plan{ - // Name: to.Ptr("standard-data-science-vm"), - // Product: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("b9e23088-6ffc-46e0-9e02-b0a6eeef47db"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("standard-data-science-vm"), - // Publisher: to.Ptr("microsoft-ads"), - // SKU: to.Ptr("standard-data-science-vm"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // }, - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DS1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithExtensionsTimeBudget.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithExtensionTimeBudget() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - ExtensionsTimeBudget: to.Ptr("PT1H20M"), - 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]any{}, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // 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://nsgdiagnostic.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(false), - // Publisher: to.Ptr("{extension-Publisher}"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("{handler-version}"), - // }, - // }}, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithManagedBootDiagnostics.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithManagedBootDiagnostics() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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), - }, - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // }, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPasswordAuthentication.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithPasswordAuthentication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("ffb27c5c-39a5-4d4e-b307-b32598689813"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPremiumStorage.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithPremiumStorage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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.StorageAccountTypesPremiumLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("19fd38a2-f50a-42c6-9dc7-3f9cf3791225"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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.StorageAccountTypesPremiumLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_DS1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithPriorityMixPolicy.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithPriorityMixPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - OrchestrationMode: to.Ptr(armcompute.OrchestrationModeFlexible), - PlatformFaultDomainCount: to.Ptr[int32](1), - PriorityMixPolicy: &armcompute.PriorityMixPolicy{ - BaseRegularPriorityCount: to.Ptr[int32](10), - RegularPriorityPercentageAboveBase: to.Ptr[int32](50), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), - NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - { - Name: to.Ptr("{vmss-name}"), - Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - EnableAcceleratedNetworking: to.Ptr(false), - EnableIPForwarding: to.Ptr(true), - IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - { - Name: to.Ptr("{vmss-name}"), - Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{}, - LoadBalancerBackendAddressPools: []*armcompute.SubResource{}, - Primary: to.Ptr(true), - PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ - Name: to.Ptr("{vmss-name}"), - Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - IdleTimeoutInMinutes: to.Ptr[int32](15), - }, - }, - 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}"), - }, - Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesSpot), - StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - ImageReference: &armcompute.ImageReference{ - Offer: to.Ptr("0001-com-ubuntu-server-focal"), - Publisher: to.Ptr("Canonical"), - SKU: to.Ptr("20_04-lts-gen2"), - 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_A8m_v2"), - Capacity: to.Ptr[int64](2), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeFlexible), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // PriorityMixPolicy: &armcompute.PriorityMixPolicy{ - // BaseRegularPriorityCount: to.Ptr[int32](10), - // RegularPriorityPercentageAboveBase: to.Ptr[int32](50), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // ApplicationGatewayBackendAddressPools: []*armcompute.SubResource{ - // }, - // LoadBalancerBackendAddressPools: []*armcompute.SubResource{ - // }, - // Primary: to.Ptr(true), - // PublicIPAddressConfiguration: &armcompute.VirtualMachineScaleSetPublicIPAddressConfiguration{ - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - // IdleTimeoutInMinutes: to.Ptr[int32](15), - // }, - // }, - // 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}"), - // }, - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesSpot), - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("0001-com-ubuntu-server-focal"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("20_04-lts-gen2"), - // 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_A8m_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithScaleInPolicy.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithScaleInPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - ScaleInPolicy: &armcompute.ScaleInPolicy{ - ForceDeletion: to.Ptr(true), - Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ - to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesOldestVM)}, - }, - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // ScaleInPolicy: &armcompute.ScaleInPolicy{ - // ForceDeletion: to.Ptr(true), - // Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ - // to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesOldestVM)}, - // }, - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSkuProfile.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithSkuProfile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - OrchestrationMode: to.Ptr(armcompute.OrchestrationModeFlexible), - PriorityMixPolicy: &armcompute.PriorityMixPolicy{ - BaseRegularPriorityCount: to.Ptr[int32](4), - RegularPriorityPercentageAboveBase: to.Ptr[int32](50), - }, - SinglePlacementGroup: to.Ptr(false), - SKUProfile: &armcompute.SKUProfile{ - AllocationStrategy: to.Ptr(armcompute.AllocationStrategyCapacityOptimized), - VMSizes: []*armcompute.SKUProfileVMSize{ - { - Name: to.Ptr("Standard_D8s_v5"), - }, - { - Name: to.Ptr("Standard_E16s_v5"), - }, - { - Name: to.Ptr("Standard_D2s_v5"), - }}, - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - BillingProfile: &armcompute.BillingProfile{ - MaxPrice: to.Ptr[float64](-1), - }, - EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - 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}"), - }, - Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesSpot), - 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("Mix"), - Capacity: to.Ptr[int64](10), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeFlexible), - // PriorityMixPolicy: &armcompute.PriorityMixPolicy{ - // BaseRegularPriorityCount: to.Ptr[int32](4), - // RegularPriorityPercentageAboveBase: to.Ptr[int32](50), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(false), - // SKUProfile: &armcompute.SKUProfile{ - // AllocationStrategy: to.Ptr(armcompute.AllocationStrategyCapacityOptimized), - // VMSizes: []*armcompute.SKUProfileVMSize{ - // { - // Name: to.Ptr("Standard_D8s_v5"), - // }, - // { - // Name: to.Ptr("Standard_E16s_v5"), - // }, - // { - // Name: to.Ptr("Standard_D2s_v5"), - // }}, - // }, - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // BillingProfile: &armcompute.BillingProfile{ - // MaxPrice: to.Ptr[float64](-1), - // }, - // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesSpot), - // 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("Mix"), - // Capacity: to.Ptr[int64](10), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSpotRestorePolicy.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithSpotRestorePolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - SpotRestorePolicy: &armcompute.SpotRestorePolicy{ - Enabled: to.Ptr(true), - RestoreTimeout: to.Ptr("PT1H"), - }, - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - BillingProfile: &armcompute.BillingProfile{ - MaxPrice: to.Ptr[float64](-1), - }, - EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - 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}"), - }, - Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesSpot), - 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_A8m_v2"), - Capacity: to.Ptr[int64](2), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // SpotRestorePolicy: &armcompute.SpotRestorePolicy{ - // Enabled: to.Ptr(true), - // RestoreTimeout: to.Ptr("PT1H"), - // }, - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // BillingProfile: &armcompute.BillingProfile{ - // MaxPrice: to.Ptr[float64](-1), - // }, - // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesSpot), - // 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_A8m_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithSshAuthentication.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithSshAuthentication() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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{ - AdminUsername: to.Ptr("{your-username}"), - ComputerNamePrefix: to.Ptr("{vmss-name}"), - LinuxConfiguration: &armcompute.LinuxConfiguration{ - DisablePasswordAuthentication: 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"), - }}, - }, - }, - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("fb73af19-0090-467c-9ced-b00bceab1c45"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: 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{ - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("UbuntuServer"), - // Publisher: to.Ptr("Canonical"), - // SKU: to.Ptr("16.04-LTS"), - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithTerminateScheduledEventEnabled.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithTerminateScheduledEventsEnabled() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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}"), - }, - ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ - Enable: to.Ptr(true), - NotBeforeTimeout: to.Ptr("PT5M"), - }, - }, - 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"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("PT5M"), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithUserData.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithUserData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - 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), - }, - }, - }, - UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // 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://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMsInDifferentZones.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithVirtualMachinesInDifferentZones() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("centralus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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{ - DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - { - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](0), - }, - { - CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - DiskSizeGB: to.Ptr[int32](1023), - Lun: to.Ptr[int32](1), - }}, - 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), - DiskSizeGB: to.Ptr[int32](512), - ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - }, - }, - }, - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_A1_v2"), - Capacity: to.Ptr[int64](2), - Tier: to.Ptr("Standard"), - }, - Zones: []*string{ - to.Ptr("1"), - to.Ptr("3")}, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("centralus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(false), - // UniqueID: to.Ptr("8042c376-4690-4c47-9fa2-fbdad70e32fa"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // { - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](1023), - // Lun: to.Ptr[int32](1), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }}, - // 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), - // DiskSizeGB: to.Ptr[int32](512), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // }, - // }, - // }, - // ZoneBalance: to.Ptr(false), - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_A1_v2"), - // Capacity: to.Ptr[int64](2), - // Tier: to.Ptr("Standard"), - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("3")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithVMSizeProperties.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithVmSizeProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - HardwareProfile: &armcompute.VirtualMachineScaleSetHardwareProfile{ - VMSizeProperties: &armcompute.VMSizeProperties{ - VCPUsAvailable: to.Ptr[int32](1), - VCPUsPerCore: to.Ptr[int32](1), - }, - }, - 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), - }, - }, - }, - UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - }, - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // 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://nsgdiagnostic.blob.core.windows.net"), - // }, - // }, - // HardwareProfile: &armcompute.VirtualMachineScaleSetHardwareProfile{ - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](1), - // VCPUsPerCore: to.Ptr[int32](1), - // }, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithZonalPlatformFaultDomainAlignMode.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createAScaleSetWithZonalPlatformFaultDomainAlignModeAsAligned() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "{vmss-name}", armcompute.VirtualMachineScaleSet{ - Location: to.Ptr("westus"), - Properties: &armcompute.VirtualMachineScaleSetProperties{ - Overprovision: to.Ptr(true), - ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - Enable: to.Ptr(true), - }, - }, - UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - AutomaticallyApprove: to.Ptr(true), - }, - UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - AutomaticallyApprove: to.Ptr(true), - }, - }, - UpgradePolicy: &armcompute.UpgradePolicy{ - Mode: to.Ptr(armcompute.UpgradeModeManual), - }, - VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - 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), - }, - }, - }, - }, - ZonalPlatformFaultDomainAlignMode: to.Ptr(armcompute.ZonalPlatformFaultDomainAlignModeAligned), - }, - SKU: &armcompute.SKU{ - Name: to.Ptr("Standard_D1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // ScheduledEventsPolicy: &armcompute.ScheduledEventsPolicy{ - // ScheduledEventsAdditionalPublishingTargets: &armcompute.ScheduledEventsAdditionalPublishingTargets{ - // EventGridAndResourceGraph: &armcompute.EventGridAndResourceGraph{ - // Enable: to.Ptr(true), - // }, - // }, - // UserInitiatedReboot: &armcompute.UserInitiatedReboot{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // UserInitiatedRedeploy: &armcompute.UserInitiatedRedeploy{ - // AutomaticallyApprove: to.Ptr(true), - // }, - // }, - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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), - // }, - // }, - // }, - // }, - // ZonalPlatformFaultDomainAlignMode: to.Ptr(armcompute.ZonalPlatformFaultDomainAlignModeAligned), - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Create_WithCapacityReservation.json -func ExampleVirtualMachineScaleSetsClient_BeginCreateOrUpdate_createOrUpdateAScaleSetWithCapacityReservation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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{ - CapacityReservation: &armcompute.CapacityReservationProfile{ - CapacityReservationGroup: &armcompute.SubResource{ - ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"), - }, - }, - 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_DS1_v2"), - Capacity: to.Ptr[int64](3), - Tier: to.Ptr("Standard"), - }, - }, &armcompute.VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{vmss-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // Overprovision: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(true), - // UniqueID: to.Ptr("d053ec5a-8da6-495f-ab13-38216503c6d7"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // CapacityReservation: &armcompute.CapacityReservationProfile{ - // CapacityReservationGroup: &armcompute.SubResource{ - // ID: to.Ptr("subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"), - // }, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/nsgExistingVnet/subnets/nsgExistingSubnet"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // 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_DS1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginUpdate_virtualMachineScaleSetUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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.UserAssignedIdentitiesValue{ - "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), - OSRollingUpgradeDeferral: to.Ptr(true), - }, - Mode: to.Ptr(armcompute.UpgradeModeManual), - RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ - EnableCrossZoneUpgrade: to.Ptr(true), - MaxBatchInstancePercent: to.Ptr[int32](49), - MaxSurge: to.Ptr(true), - MaxUnhealthyInstancePercent: to.Ptr[int32](81), - MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), - PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), - PrioritizeUnhealthyInstances: to.Ptr(true), - RollbackFailedInstancesOnPolicyBreach: 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]any{}, - ProvisionAfterExtensions: []*string{ - to.Ptr("aa")}, - Publisher: to.Ptr("{extension-Publisher}"), - Settings: map[string]any{}, - 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{ - { - 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{ - { - 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), - DiffDiskSettings: &armcompute.DiffDiskSettings{ - Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), - }, - 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"), - }, - Zones: []*string{ - to.Ptr("1"), - to.Ptr("2"), - to.Ptr("3")}, - }, &armcompute.VirtualMachineScaleSetsClientBeginUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("{virtualMachineScaleSetName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key8425": to.Ptr("aaa"), - // }, - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Identity: &armcompute.VirtualMachineScaleSetIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "key3951": &armcompute.UserAssignedIdentitiesValue{ - // ClientID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PrincipalID: to.Ptr("aaaa"), - // }, - // }, - // }, - // Plan: &armcompute.Plan{ - // Name: to.Ptr("aaaaaaaaaa"), - // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // 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), - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeUniform), - // Overprovision: to.Ptr(true), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // 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), - // SpotRestorePolicy: &armcompute.SpotRestorePolicy{ - // Enabled: to.Ptr(true), - // RestoreTimeout: to.Ptr("aaaaaaaaaa"), - // }, - // UniqueID: to.Ptr("aaaaaaaa"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // DisableAutomaticRollback: to.Ptr(true), - // EnableAutomaticOSUpgrade: to.Ptr(true), - // OSRollingUpgradeDeferral: to.Ptr(true), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ - // EnableCrossZoneUpgrade: to.Ptr(true), - // MaxBatchInstancePercent: to.Ptr[int32](49), - // MaxSurge: to.Ptr(true), - // MaxUnhealthyInstancePercent: to.Ptr[int32](81), - // MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), - // PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), - // PrioritizeUnhealthyInstances: to.Ptr(true), - // }, - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("aaaaa"), - // Order: to.Ptr[int32](29), - // PackageReferenceID: to.Ptr("aaaaaaaaaa"), - // Tags: to.Ptr("aaaaaaaaaaa"), - // }}, - // }, - // BillingProfile: &armcompute.BillingProfile{ - // MaxPrice: to.Ptr[float64](-1), - // }, - // CapacityReservation: &armcompute.CapacityReservationProfile{ - // CapacityReservationGroup: &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("http://{existing-storage-account-name}.blob.core.windows.net"), - // }, - // }, - // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ - // ExtensionsTimeBudget: to.Ptr("PT1H20M"), - // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ - // { - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Name: to.Ptr("{extension-name}"), - // Type: to.Ptr("aaaaa"), - // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - // Type: to.Ptr("{extension-Type}"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaa"), - // ProtectedSettings: map[string]any{ - // }, - // ProvisionAfterExtensions: []*string{ - // to.Ptr("aa")}, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("{extension-Publisher}"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("{handler-version}"), - // }, - // }}, - // }, - // LicenseType: to.Ptr("aaaaaaaaaaaa"), - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // HealthProbe: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/disk123"), - // }, - // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("aaaaaaaa"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableFpga: to.Ptr(true), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // 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.VirtualMachineScaleSetPublicIPAddressConfiguration{ - // Name: to.Ptr("a"), - // Properties: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DNSSettings: &armcompute.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings{ - // DomainNameLabel: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // }, - // IdleTimeoutInMinutes: to.Ptr[int32](3), - // 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.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.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // 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), - // }}, - // }, - // }, - // }, - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), - // 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.VirtualMachineScaleSetStorageProfile{ - // 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"), - // ExactVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SharedGalleryImageID: to.Ptr("aaaaaa"), - // SKU: to.Ptr("2016-Datacenter"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("aaaaaaaaaaaaaaa"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), - // }, - // 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), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // VhdContainers: []*string{ - // to.Ptr("aa")}, - // WriteAcceleratorEnabled: to.Ptr(true), - // }, - // }, - // UserData: to.Ptr("aaaaaaaaaaaaa"), - // }, - // ZoneBalance: to.Ptr(true), - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // Zones: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Update_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginUpdate_virtualMachineScaleSetUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetUpdate{}, &armcompute.VirtualMachineScaleSetsClientBeginUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Location: to.Ptr("westus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithDiskControllerType.json -func ExampleVirtualMachineScaleSetsClient_Get_getVmScaleSetVmWithDiskControllerType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetsClient().Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: to.Ptr(armcompute.ExpandTypesForGetVMScaleSetsUserData)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("myVirtualMachineScaleSet"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVirtualMachineScaleSet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup"), - // }, - // Overprovision: to.Ptr(false), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(false), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // EnableAutomaticOSUpgrade: to.Ptr(false), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), - // Order: to.Ptr[int32](1), - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), - // Tags: to.Ptr("myTag1"), - // }, - // { - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), - // }}, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("myNic"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("myIPConfig"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // Primary: to.Ptr(true), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), - // }, - // }, - // }}, - // NetworkSecurityGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), - // }, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerNamePrefix: to.Ptr("myVirtualMachineScaleSet"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // }, - // DiskControllerType: to.Ptr("NVMe"), - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("databricks"), - // Publisher: to.Ptr("azuredatabricks"), - // SKU: to.Ptr("databricksworker"), - // Version: to.Ptr("3.15.2"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }, - // }, - // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2s_v3"), - // Capacity: to.Ptr[int64](4), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get.json -func ExampleVirtualMachineScaleSetsClient_Get_getAVirtualMachineScaleSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetsClient().Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("myVirtualMachineScaleSet"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVirtualMachineScaleSet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Etag: to.Ptr("\"1\""), - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup"), - // }, - // Overprovision: to.Ptr(false), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(false), - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // EnableAutomaticOSUpgrade: to.Ptr(false), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), - // Order: to.Ptr[int32](1), - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), - // Tags: to.Ptr("myTag1"), - // }, - // { - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), - // }}, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("myNic"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("myIPConfig"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // Primary: to.Ptr(true), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), - // }, - // }, - // }}, - // NetworkSecurityGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), - // }, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerNamePrefix: to.Ptr("myVirtualMachineScaleSet"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("databricks"), - // Publisher: to.Ptr("azuredatabricks"), - // SKU: to.Ptr("databricksworker"), - // Version: to.Ptr("3.15.2"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-09-27T01:03:40.313Z"); return t}()), - // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2s_v3"), - // Capacity: to.Ptr[int64](4), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_AutoPlacedOnDedicatedHostGroup.json -func ExampleVirtualMachineScaleSetsClient_Get_getAVirtualMachineScaleSetPlacedOnADedicatedHostGroupThroughAutomaticPlacement() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetsClient().Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("myVirtualMachineScaleSet"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVirtualMachineScaleSet"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup"), - // }, - // Overprovision: to.Ptr(false), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(false), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // EnableAutomaticOSUpgrade: to.Ptr(false), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("myNic"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("myIPConfig"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // Primary: to.Ptr(true), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), - // }, - // }, - // }}, - // NetworkSecurityGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), - // }, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerNamePrefix: to.Ptr("myVirtualMachineScaleSet"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("databricks"), - // Publisher: to.Ptr("azuredatabricks"), - // SKU: to.Ptr("databricksworker"), - // Version: to.Ptr("3.15.2"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }, - // }, - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2s_v3"), - // Capacity: to.Ptr[int64](4), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Get_WithUserData.json -func ExampleVirtualMachineScaleSetsClient_Get_getAVirtualMachineScaleSetWithUserData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetsClient().Get(ctx, "myResourceGroup", "myVirtualMachineScaleSet", &armcompute.VirtualMachineScaleSetsClientGetOptions{Expand: to.Ptr(armcompute.ExpandTypesForGetVMScaleSetsUserData)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSet = armcompute.VirtualMachineScaleSet{ - // Name: to.Ptr("myVirtualMachineScaleSet"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myVirtualMachineScaleSet"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(false), - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup"), - // }, - // Overprovision: to.Ptr(false), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // SinglePlacementGroup: to.Ptr(false), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // EnableAutomaticOSUpgrade: to.Ptr(false), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("https://mystorageaccount.blob.core.windows.net/configurations/settings.config"), - // Order: to.Ptr[int32](1), - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0"), - // Tags: to.Ptr("myTag1"), - // }, - // { - // PackageReferenceID: to.Ptr("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"), - // }}, - // }, - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("myNic"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("myIPConfig"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // Primary: to.Ptr(true), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), - // }, - // }, - // }}, - // NetworkSecurityGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), - // }, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerNamePrefix: to.Ptr("myVirtualMachineScaleSet"), - // LinuxConfiguration: &armcompute.LinuxConfiguration{ - // DisablePasswordAuthentication: to.Ptr(false), - // }, - // }, - // StorageProfile: &armcompute.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // Offer: to.Ptr("databricks"), - // Publisher: to.Ptr("azuredatabricks"), - // SKU: to.Ptr("databricksworker"), - // Version: to.Ptr("3.15.2"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }, - // }, - // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - // }, - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2s_v3"), - // Capacity: to.Ptr[int64](4), - // Tier: to.Ptr("Standard"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginDeallocate_virtualMachineScaleSetDeallocateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginDeallocate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginDeallocateOptions{Hibernate: 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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Deallocate_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginDeallocate_virtualMachineScaleSetDeallocateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginDeallocate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginDeallocateOptions{Hibernate: nil, - VMInstanceIDs: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginDeleteInstances_virtualMachineScaleSetDeleteInstancesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_DeleteInstances_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginDeleteInstances_virtualMachineScaleSetDeleteInstancesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginDeleteInstances(ctx, "rgcompute", "aaaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetVMInstanceRequiredIDs{ - InstanceIDs: []*string{ - to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - }, &armcompute.VirtualMachineScaleSetsClientBeginDeleteInstancesOptions{ForceDeletion: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_GetInstanceView_virtualMachineScaleSetGetInstanceViewMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetsClient().GetInstanceView(ctx, "rgcompute", "aaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetInstanceView = armcompute.VirtualMachineScaleSetInstanceView{ - // OrchestrationServices: []*armcompute.OrchestrationServiceSummary{ - // { - // ServiceName: to.Ptr(armcompute.OrchestrationServiceNamesAutomaticRepairs), - // ServiceState: to.Ptr(armcompute.OrchestrationServiceStateNotRunning), - // }}, - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T12:58:26.526Z"); return t}()), - // }}, - // VirtualMachine: &armcompute.VirtualMachineScaleSetInstanceViewStatusesSummary{ - // StatusesSummary: []*armcompute.VirtualMachineStatusCodeCount{ - // { - // Code: to.Ptr("aa"), - // Count: to.Ptr[int32](21), - // }}, - // }, - // Extensions: []*armcompute.VirtualMachineScaleSetVMExtensionsSummary{ - // { - // Name: to.Ptr("aaaaaaaaaaa"), - // StatusesSummary: []*armcompute.VirtualMachineStatusCodeCount{ - // { - // Code: to.Ptr("aa"), - // Count: to.Ptr[int32](21), - // }}, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetInstanceView_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_GetInstanceView_virtualMachineScaleSetGetInstanceViewMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetsClient().GetInstanceView(ctx, "rgcompute", "aaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetInstanceView = armcompute.VirtualMachineScaleSetInstanceView{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewListPager_virtualMachineScaleSetListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListPager("rgcompute", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetListResult = armcompute.VirtualMachineScaleSetListResult{ - // Value: []*armcompute.VirtualMachineScaleSet{ - // { - // Name: to.Ptr("{virtualMachineScaleSetName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Identity: &armcompute.VirtualMachineScaleSetIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "key3951": &armcompute.UserAssignedIdentitiesValue{ - // ClientID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PrincipalID: to.Ptr("aaaa"), - // }, - // }, - // }, - // Plan: &armcompute.Plan{ - // Name: to.Ptr("aaaaaaaaaa"), - // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - // HibernationEnabled: to.Ptr(true), - // UltraSSDEnabled: to.Ptr(true), - // }, - // AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ - // Enabled: to.Ptr(true), - // GracePeriod: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(true), - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeUniform), - // Overprovision: to.Ptr(true), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // ScaleInPolicy: &armcompute.ScaleInPolicy{ - // ForceDeletion: to.Ptr(true), - // Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ - // to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesDefault)}, - // }, - // SinglePlacementGroup: to.Ptr(true), - // SpotRestorePolicy: &armcompute.SpotRestorePolicy{ - // Enabled: to.Ptr(true), - // RestoreTimeout: to.Ptr("aaaaaaaaaa"), - // }, - // UniqueID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // DisableAutomaticRollback: to.Ptr(true), - // EnableAutomaticOSUpgrade: to.Ptr(true), - // OSRollingUpgradeDeferral: to.Ptr(true), - // UseRollingUpgradePolicy: to.Ptr(true), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ - // EnableCrossZoneUpgrade: to.Ptr(true), - // MaxBatchInstancePercent: to.Ptr[int32](49), - // MaxSurge: to.Ptr(true), - // MaxUnhealthyInstancePercent: to.Ptr[int32](81), - // MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), - // PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), - // PrioritizeUnhealthyInstances: to.Ptr(true), - // RollbackFailedInstancesOnPolicyBreach: to.Ptr(true), - // }, - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("aaaaa"), - // Order: to.Ptr[int32](29), - // PackageReferenceID: to.Ptr("aaaaaaaaaa"), - // Tags: to.Ptr("aaaaaaaaaaa"), - // }}, - // }, - // BillingProfile: &armcompute.BillingProfile{ - // MaxPrice: to.Ptr[float64](4), - // }, - // CapacityReservation: &armcompute.CapacityReservationProfile{ - // CapacityReservationGroup: &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("aaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ - // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ - // { - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Name: to.Ptr("aa"), - // Type: to.Ptr("aaaaa"), - // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - // Type: to.Ptr("aaaaaaaa"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ProtectedSettings: map[string]any{ - // }, - // ProvisionAfterExtensions: []*string{ - // to.Ptr("aaaaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("aaaaaaaaaaaaa"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }}, - // }, - // LicenseType: to.Ptr("aaaa"), - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // HealthProbe: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), - // }, - // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("myNic"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableFpga: to.Ptr(true), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("myIPConfig"), - // 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/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), - // }, - // }, - // }}, - // NetworkSecurityGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), - // }, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerNamePrefix: to.Ptr("{virtualMachineScaleSetName}"), - // CustomData: to.Ptr("aaaaaaaaaaaaaaaaaa"), - // 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"), - // }}, - // }, - // }, - // 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), - // EnableHotpatching: to.Ptr(true), - // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), - // }, - // ProvisionVMAgent: to.Ptr(true), - // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // WinRM: &armcompute.WinRMConfiguration{ - // Listeners: []*armcompute.WinRMListener{ - // { - // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), - // }}, - // }, - // }, - // }, - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), - // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("aa"), - // }, - // }, - // 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.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("aaaaaaaaaa"), - // ExactVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // Offer: to.Ptr("databricks"), - // Publisher: to.Ptr("azuredatabricks"), - // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // SKU: to.Ptr("databricksworker"), - // Version: to.Ptr("3.15.2"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), - // }, - // DiskSizeGB: to.Ptr[int32](30), - // Image: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), - // }, - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaa"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // VhdContainers: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")}, - // WriteAcceleratorEnabled: to.Ptr(true), - // }, - // }, - // UserData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // ZoneBalance: to.Ptr(true), - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2s_v3"), - // Capacity: to.Ptr[int64](4), - // Tier: to.Ptr("Standard"), - // }, - // Zones: []*string{ - // to.Ptr("aaaaaaa")}, - // }, - // { - // Name: to.Ptr("{virtualMachineScaleSetName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}1"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // }, - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Identity: &armcompute.VirtualMachineScaleSetIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "key3951": &armcompute.UserAssignedIdentitiesValue{ - // ClientID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PrincipalID: to.Ptr("aaaa"), - // }, - // }, - // }, - // Plan: &armcompute.Plan{ - // Name: to.Ptr("aaaaaaaaaa"), - // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - // HibernationEnabled: to.Ptr(true), - // UltraSSDEnabled: to.Ptr(true), - // }, - // AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ - // Enabled: to.Ptr(true), - // GracePeriod: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(true), - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeUniform), - // Overprovision: to.Ptr(true), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // ScaleInPolicy: &armcompute.ScaleInPolicy{ - // ForceDeletion: to.Ptr(true), - // Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ - // to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesDefault)}, - // }, - // SinglePlacementGroup: to.Ptr(true), - // SpotRestorePolicy: &armcompute.SpotRestorePolicy{ - // Enabled: to.Ptr(true), - // RestoreTimeout: to.Ptr("aaaaaaaaaa"), - // }, - // UniqueID: to.Ptr("aaaaa"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // DisableAutomaticRollback: to.Ptr(true), - // EnableAutomaticOSUpgrade: to.Ptr(true), - // OSRollingUpgradeDeferral: to.Ptr(true), - // UseRollingUpgradePolicy: to.Ptr(true), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeAutomatic), - // RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ - // EnableCrossZoneUpgrade: to.Ptr(true), - // MaxBatchInstancePercent: to.Ptr[int32](49), - // MaxSurge: to.Ptr(true), - // MaxUnhealthyInstancePercent: to.Ptr[int32](81), - // MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), - // PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), - // PrioritizeUnhealthyInstances: to.Ptr(true), - // }, - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("aaaaa"), - // Order: to.Ptr[int32](29), - // PackageReferenceID: to.Ptr("aaaaaaaaaa"), - // Tags: to.Ptr("aaaaaaaaaaa"), - // }}, - // }, - // BillingProfile: &armcompute.BillingProfile{ - // MaxPrice: to.Ptr[float64](4), - // }, - // CapacityReservation: &armcompute.CapacityReservationProfile{ - // CapacityReservationGroup: &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("aaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ - // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ - // { - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Name: to.Ptr("aa"), - // Type: to.Ptr("aaaaa"), - // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - // Type: to.Ptr("aaaaaaaa"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ProtectedSettings: map[string]any{ - // }, - // ProvisionAfterExtensions: []*string{ - // to.Ptr("aaaaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("aaaaaaaaaaaaa"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }}, - // }, - // LicenseType: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaa"), - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // HealthProbe: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), - // }, - // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("myNic1"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableFpga: to.Ptr(true), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("myIPConfig"), - // 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/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/myVNet/subnets/mySubnet"), - // }, - // }, - // }}, - // NetworkSecurityGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/myNetworkSecurityGroup"), - // }, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("admin"), - // ComputerNamePrefix: to.Ptr("{virtualMachineScaleSetName}"), - // CustomData: to.Ptr("a"), - // 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"), - // }}, - // }, - // }, - // 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), - // EnableHotpatching: to.Ptr(true), - // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), - // }, - // ProvisionVMAgent: to.Ptr(true), - // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // WinRM: &armcompute.WinRMConfiguration{ - // Listeners: []*armcompute.WinRMListener{ - // { - // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), - // }}, - // }, - // }, - // }, - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), - // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("aa"), - // }, - // }, - // 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.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // }, - // ImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("aaa"), - // ExactVersion: to.Ptr("aa"), - // Offer: to.Ptr("databricks"), - // Publisher: to.Ptr("azuredatabricks"), - // SharedGalleryImageID: to.Ptr("aaaaaaa"), - // SKU: to.Ptr("databricksworker"), - // Version: to.Ptr("3.15.2"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("a"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), - // }, - // DiskSizeGB: to.Ptr[int32](30), - // Image: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), - // }, - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaa"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // VhdContainers: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaa")}, - // WriteAcceleratorEnabled: to.Ptr(true), - // }, - // }, - // UserData: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // }, - // ZoneBalance: to.Ptr(true), - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D2s_v3"), - // Capacity: to.Ptr[int64](4), - // Tier: to.Ptr("Standard"), - // }, - // Zones: []*string{ - // to.Ptr("aaaaaaaa")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_List_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewListPager_virtualMachineScaleSetListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListPager("rgcompute", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetListResult = armcompute.VirtualMachineScaleSetListResult{ - // Value: []*armcompute.VirtualMachineScaleSet{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), - // Location: to.Ptr("eastus"), - // }, - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/rgcompute/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), - // Location: to.Ptr("eastus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewListAllPager_virtualMachineScaleSetListAllMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetListWithLinkResult = armcompute.VirtualMachineScaleSetListWithLinkResult{ - // Value: []*armcompute.VirtualMachineScaleSet{ - // { - // Name: to.Ptr("{virtualMachineScaleSetName}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key8425": to.Ptr("aaa"), - // }, - // ExtendedLocation: &armcompute.ExtendedLocation{ - // Name: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - // Type: to.Ptr(armcompute.ExtendedLocationTypesEdgeZone), - // }, - // Identity: &armcompute.VirtualMachineScaleSetIdentity{ - // Type: to.Ptr(armcompute.ResourceIdentityTypeSystemAssigned), - // PrincipalID: to.Ptr("aaaaaaaaaaaaaaa"), - // TenantID: to.Ptr("aaaaaaaaaaaaaaaa"), - // UserAssignedIdentities: map[string]*armcompute.UserAssignedIdentitiesValue{ - // "key3951": &armcompute.UserAssignedIdentitiesValue{ - // ClientID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // PrincipalID: to.Ptr("aaaa"), - // }, - // }, - // }, - // Plan: &armcompute.Plan{ - // Name: to.Ptr("aaaaaaaaaa"), - // Product: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // PromotionCode: to.Ptr("aaaaaaaaaaaaaaaaaaaa"), - // Publisher: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Properties: &armcompute.VirtualMachineScaleSetProperties{ - // AdditionalCapabilities: &armcompute.AdditionalCapabilities{ - // HibernationEnabled: to.Ptr(true), - // UltraSSDEnabled: to.Ptr(true), - // }, - // AutomaticRepairsPolicy: &armcompute.AutomaticRepairsPolicy{ - // Enabled: to.Ptr(true), - // GracePeriod: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // DoNotRunExtensionsOnOverprovisionedVMs: to.Ptr(true), - // HostGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // OrchestrationMode: to.Ptr(armcompute.OrchestrationModeUniform), - // Overprovision: to.Ptr(true), - // PlatformFaultDomainCount: to.Ptr[int32](1), - // ProvisioningState: to.Ptr("Succeeded"), - // ProximityPlacementGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // ScaleInPolicy: &armcompute.ScaleInPolicy{ - // ForceDeletion: to.Ptr(true), - // Rules: []*armcompute.VirtualMachineScaleSetScaleInRules{ - // to.Ptr(armcompute.VirtualMachineScaleSetScaleInRulesDefault)}, - // }, - // SinglePlacementGroup: to.Ptr(true), - // SpotRestorePolicy: &armcompute.SpotRestorePolicy{ - // Enabled: to.Ptr(true), - // RestoreTimeout: to.Ptr("aaaaaaaaaa"), - // }, - // UniqueID: to.Ptr("aaaaaaaa"), - // UpgradePolicy: &armcompute.UpgradePolicy{ - // AutomaticOSUpgradePolicy: &armcompute.AutomaticOSUpgradePolicy{ - // DisableAutomaticRollback: to.Ptr(true), - // EnableAutomaticOSUpgrade: to.Ptr(true), - // OSRollingUpgradeDeferral: to.Ptr(true), - // }, - // Mode: to.Ptr(armcompute.UpgradeModeManual), - // RollingUpgradePolicy: &armcompute.RollingUpgradePolicy{ - // EnableCrossZoneUpgrade: to.Ptr(true), - // MaxBatchInstancePercent: to.Ptr[int32](49), - // MaxSurge: to.Ptr(true), - // MaxUnhealthyInstancePercent: to.Ptr[int32](81), - // MaxUnhealthyUpgradedInstancePercent: to.Ptr[int32](98), - // PauseTimeBetweenBatches: to.Ptr("aaaaaaaaaaaaaaa"), - // PrioritizeUnhealthyInstances: to.Ptr(true), - // RollbackFailedInstancesOnPolicyBreach: to.Ptr(true), - // }, - // }, - // VirtualMachineProfile: &armcompute.VirtualMachineScaleSetVMProfile{ - // ApplicationProfile: &armcompute.ApplicationProfile{ - // GalleryApplications: []*armcompute.VMGalleryApplication{ - // { - // ConfigurationReference: to.Ptr("aaaaa"), - // Order: to.Ptr[int32](29), - // PackageReferenceID: to.Ptr("aaaaaaaaaa"), - // Tags: to.Ptr("aaaaaaaaaaa"), - // }}, - // }, - // BillingProfile: &armcompute.BillingProfile{ - // MaxPrice: to.Ptr[float64](4), - // }, - // CapacityReservation: &armcompute.CapacityReservationProfile{ - // CapacityReservationGroup: &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("aaaaaaaaaaaaaaaaaaa"), - // }, - // }, - // EvictionPolicy: to.Ptr(armcompute.VirtualMachineEvictionPolicyTypesDeallocate), - // ExtensionProfile: &armcompute.VirtualMachineScaleSetExtensionProfile{ - // ExtensionsTimeBudget: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Extensions: []*armcompute.VirtualMachineScaleSetExtension{ - // { - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Name: to.Ptr("aa"), - // Type: to.Ptr("aaaaa"), - // Properties: &armcompute.VirtualMachineScaleSetExtensionProperties{ - // Type: to.Ptr("aaaaaaaa"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // ProtectedSettings: map[string]any{ - // }, - // ProvisionAfterExtensions: []*string{ - // to.Ptr("aaaaaaaaaaaaaa")}, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("aaaaaaaaaaaaa"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // }}, - // }, - // LicenseType: to.Ptr("aaaaaaaaaa"), - // NetworkProfile: &armcompute.VirtualMachineScaleSetNetworkProfile{ - // HealthProbe: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/rpcName/restorePoints/restorePointName/diskRestorePoints/testingexcludedisk_OsDisk_1_74cdaedcea50483d9833c96adefa100f_22b4bdfe-6c54-4f72-84d8-85d8860f0c57"), - // }, - // NetworkAPIVersion: to.Ptr(armcompute.NetworkAPIVersionTwoThousandTwenty1101), - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DeleteOption: to.Ptr(armcompute.DeleteOptionsDelete), - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // to.Ptr("aaaaaaaaaaaa")}, - // }, - // EnableAcceleratedNetworking: to.Ptr(true), - // EnableFpga: to.Ptr(true), - // EnableIPForwarding: to.Ptr(true), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("{vmss-name}"), - // 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"), - // DomainNameLabelScope: to.Ptr(armcompute.DomainNameLabelScopeTypesTenantReuse), - // }, - // 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/{existing-virtual-network-name}/subnets/{existing-subnet-name}"), - // }, - // }, - // }}, - // NetworkSecurityGroup: &armcompute.SubResource{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"), - // }, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.VirtualMachineScaleSetOSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // ComputerNamePrefix: to.Ptr("{vmss-name}"), - // 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("aaa"), - // KeyData: to.Ptr("aaaaaa"), - // }}, - // }, - // }, - // 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), - // EnableHotpatching: to.Ptr(true), - // PatchMode: to.Ptr(armcompute.WindowsVMGuestPatchModeManual), - // }, - // ProvisionVMAgent: to.Ptr(true), - // TimeZone: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // WinRM: &armcompute.WinRMConfiguration{ - // Listeners: []*armcompute.WinRMListener{ - // { - // CertificateURL: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // Protocol: to.Ptr(armcompute.ProtocolTypesHTTP), - // }}, - // }, - // }, - // }, - // Priority: to.Ptr(armcompute.VirtualMachinePriorityTypesRegular), - // ScheduledEventsProfile: &armcompute.ScheduledEventsProfile{ - // TerminateNotificationProfile: &armcompute.TerminateNotificationProfile{ - // Enable: to.Ptr(true), - // NotBeforeTimeout: to.Ptr("aa"), - // }, - // }, - // 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.VirtualMachineScaleSetStorageProfile{ - // DataDisks: []*armcompute.VirtualMachineScaleSetDataDisk{ - // { - // Name: to.Ptr("aaaaaaaaaaaaaa"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskIOPSReadWrite: to.Ptr[int64](11), - // DiskMBpsReadWrite: to.Ptr[int64](13), - // DiskSizeGB: to.Ptr[int32](11), - // Lun: to.Ptr[int32](24), - // 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("a"), - // ExactVersion: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SharedGalleryImageID: to.Ptr("aaaaaaaaaaaaaaaaaaaaaa"), - // SKU: to.Ptr("2016-Datacenter"), - // Version: to.Ptr("latest"), - // }, - // OSDisk: &armcompute.VirtualMachineScaleSetOSDisk{ - // Name: to.Ptr("aaaaaaaaaaaaaaa"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiffDiskSettings: &armcompute.DiffDiskSettings{ - // Option: to.Ptr(armcompute.DiffDiskOptionsLocal), - // Placement: to.Ptr(armcompute.DiffDiskPlacementCacheDisk), - // }, - // DiskSizeGB: to.Ptr[int32](30), - // Image: &armcompute.VirtualHardDisk{ - // URI: to.Ptr("https://{storageAccountName}.blob.core.windows.net/{containerName}/{vhdName}.vhd"), - // }, - // ManagedDisk: &armcompute.VirtualMachineScaleSetManagedDiskParameters{ - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("aaaaaaaaaaaa"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // VhdContainers: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa")}, - // WriteAcceleratorEnabled: to.Ptr(true), - // }, - // }, - // UserData: to.Ptr("aaa"), - // }, - // ZoneBalance: to.Ptr(true), - // }, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Standard_D1_v2"), - // Capacity: to.Ptr[int64](3), - // Tier: to.Ptr("Standard"), - // }, - // Zones: []*string{ - // to.Ptr("aaaaaaaaaaaaaaaaaaaa")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListAll_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewListAllPager_virtualMachineScaleSetListAllMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListAllPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetListWithLinkResult = armcompute.VirtualMachineScaleSetListWithLinkResult{ - // Value: []*armcompute.VirtualMachineScaleSet{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}"), - // Location: to.Ptr("westus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewListSKUsPager_virtualMachineScaleSetListSkusMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListSKUsPager("rgcompute", "aaaaaa", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetListSKUsResult = armcompute.VirtualMachineScaleSetListSKUsResult{ - // Value: []*armcompute.VirtualMachineScaleSetSKU{ - // { - // Capacity: &armcompute.VirtualMachineScaleSetSKUCapacity{ - // DefaultCapacity: to.Ptr[int64](20), - // Maximum: to.Ptr[int64](27), - // Minimum: to.Ptr[int64](22), - // ScaleType: to.Ptr(armcompute.VirtualMachineScaleSetSKUScaleTypeAutomatic), - // }, - // ResourceType: to.Ptr("aaaaaaaaaaaaaaaaa"), - // SKU: &armcompute.SKU{ - // Name: to.Ptr("DSv3-Type1"), - // Capacity: to.Ptr[int64](7), - // Tier: to.Ptr("aaa"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ListSkus_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewListSKUsPager_virtualMachineScaleSetListSkusMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetsClient().NewListSKUsPager("rgcompute", "aaaaaaaaaaaaaaaa", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetListSKUsResult = armcompute.VirtualMachineScaleSetListSKUsResult{ - // Value: []*armcompute.VirtualMachineScaleSetSKU{ - // { - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewGetOSUpgradeHistoryPager_virtualMachineScaleSetGetOsUpgradeHistoryMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetsClient().NewGetOSUpgradeHistoryPager("rgcompute", "aaaaaa", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetListOSUpgradeHistory = armcompute.VirtualMachineScaleSetListOSUpgradeHistory{ - // Value: []*armcompute.UpgradeOperationHistoricalStatusInfo{ - // { - // Type: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // Location: to.Ptr("aaaaaaaaaaaaa"), - // Properties: &armcompute.UpgradeOperationHistoricalStatusInfoProperties{ - // Error: &armcompute.APIError{ - // Code: to.Ptr("aaaaaaa"), - // Innererror: &armcompute.InnerError{ - // Errordetail: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Exceptiontype: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Message: to.Ptr("aaaaaaaaa"), - // Target: to.Ptr("aaaaaaa"), - // Details: []*armcompute.APIErrorBase{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Message: to.Ptr("aa"), - // Target: to.Ptr("aaaa"), - // }}, - // }, - // Progress: &armcompute.RollingUpgradeProgressInfo{ - // FailedInstanceCount: to.Ptr[int32](25), - // InProgressInstanceCount: to.Ptr[int32](20), - // PendingInstanceCount: to.Ptr[int32](27), - // SuccessfulInstanceCount: to.Ptr[int32](6), - // }, - // RollbackInfo: &armcompute.RollbackStatusInfo{ - // FailedRolledbackInstanceCount: to.Ptr[int32](2), - // RollbackError: &armcompute.APIError{ - // Code: to.Ptr("aaaaaaa"), - // Innererror: &armcompute.InnerError{ - // Errordetail: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Exceptiontype: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), - // }, - // Message: to.Ptr("aaaaaaaaa"), - // Target: to.Ptr("aaaaaaa"), - // Details: []*armcompute.APIErrorBase{ - // { - // Code: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaa"), - // Message: to.Ptr("aa"), - // Target: to.Ptr("aaaa"), - // }}, - // }, - // SuccessfullyRolledbackInstanceCount: to.Ptr[int32](12), - // }, - // RunningStatus: &armcompute.UpgradeOperationHistoryStatus{ - // Code: to.Ptr(armcompute.UpgradeStateRollingForward), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:05:40.443Z"); return t}()), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-11-30T13:05:40.442Z"); return t}()), - // }, - // StartedBy: to.Ptr(armcompute.UpgradeOperationInvokerUnknown), - // TargetImageReference: &armcompute.ImageReference{ - // ID: to.Ptr("aaaaaaaaaaaaaaaaaaa"), - // ExactVersion: to.Ptr("aaaaaaa"), - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // SharedGalleryImageID: to.Ptr("aaaaaa"), - // SKU: to.Ptr("2016-Datacenter"), - // Version: to.Ptr("latest"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_GetOSUpgradeHistory_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_NewGetOSUpgradeHistoryPager_virtualMachineScaleSetGetOsUpgradeHistoryMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetsClient().NewGetOSUpgradeHistoryPager("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetListOSUpgradeHistory = armcompute.VirtualMachineScaleSetListOSUpgradeHistory{ - // Value: []*armcompute.UpgradeOperationHistoricalStatusInfo{ - // { - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginPowerOff_virtualMachineScaleSetPowerOffMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PowerOff_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginPowerOff_virtualMachineScaleSetPowerOffMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginPowerOff(ctx, "rgcompute", "a", &armcompute.VirtualMachineScaleSetsClientBeginPowerOffOptions{SkipShutdown: nil, - VMInstanceIDs: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginRestart_virtualMachineScaleSetRestartMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Restart_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginRestart_virtualMachineScaleSetRestartMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginRestart(ctx, "rgcompute", "aaaa", &armcompute.VirtualMachineScaleSetsClientBeginRestartOptions{VMInstanceIDs: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginStart_virtualMachineScaleSetStartMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Start_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginStart_virtualMachineScaleSetStartMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginStart(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginStartOptions{VMInstanceIDs: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginReapply_virtualMachineScaleSetsReapplyMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReapply(ctx, "VirtualMachineScaleSetReapplyTestRG", "VMSSReapply-Test-ScaleSet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reapply_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginReapply_virtualMachineScaleSetsReapplyMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReapply(ctx, "VirtualMachineScaleSetReapplyTestRG", "VMSSReapply-Test-ScaleSet", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginRedeploy_virtualMachineScaleSetRedeployMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Redeploy_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginRedeploy_virtualMachineScaleSetRedeployMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginRedeploy(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginRedeployOptions{VMInstanceIDs: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginPerformMaintenance_virtualMachineScaleSetPerformMaintenanceMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_PerformMaintenance_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginPerformMaintenance_virtualMachineScaleSetPerformMaintenanceMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginPerformMaintenance(ctx, "rgcompute", "aa", &armcompute.VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions{VMInstanceIDs: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginUpdateInstances_virtualMachineScaleSetUpdateInstancesMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_UpdateInstances_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginUpdateInstances_virtualMachineScaleSetUpdateInstancesMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginUpdateInstances(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginReimage_virtualMachineScaleSetReimageMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReimage(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginReimageOptions{VMScaleSetReimageInput: &armcompute.VirtualMachineScaleSetReimageParameters{ - TempDisk: to.Ptr(true), - ForceUpdateOSDiskForEphemeral: 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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_Reimage_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginReimage_virtualMachineScaleSetReimageMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReimage(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginReimageOptions{VMScaleSetReimageInput: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginReimageAll_virtualMachineScaleSetReimageAllMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ReimageAll_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginReimageAll_virtualMachineScaleSetReimageAllMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginReimageAll(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetsClientBeginReimageAllOptions{VMInstanceIDs: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ApproveRollingUpgrade.json -func ExampleVirtualMachineScaleSetsClient_BeginApproveRollingUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginApproveRollingUpgrade(ctx, "rgcompute", "vmssToApproveRollingUpgradeOn", &armcompute.VirtualMachineScaleSetsClientBeginApproveRollingUpgradeOptions{VMInstanceIDs: &armcompute.VirtualMachineScaleSetVMInstanceIDs{ - InstanceIDs: []*string{ - to.Ptr("0"), - to.Ptr("1"), - to.Ptr("2")}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetsClient().ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx, "rgcompute", "aaaaaaaaaaaaaaaa", 30, &armcompute.VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions{Zone: nil, - PlacementGroupID: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryWalkResponse = armcompute.RecoveryWalkResponse{ - // NextPlatformUpdateDomain: to.Ptr[int32](7), - // WalkPerformed: to.Ptr(true), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_ForceRecoveryServiceFabricPlatformUpdateDomainWalk_virtualMachineScaleSetForceRecoveryServiceFabricPlatformUpdateDomainWalkMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetsClient().ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx, "rgcompute", "aaaaaaaaaaaa", 9, &armcompute.VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions{Zone: nil, - PlacementGroupID: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryWalkResponse = armcompute.RecoveryWalkResponse{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_ConvertToSinglePlacementGroup_virtualMachineScaleSetConvertToSinglePlacementGroupMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewVirtualMachineScaleSetsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_ConvertToSinglePlacementGroup_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_ConvertToSinglePlacementGroup_virtualMachineScaleSetConvertToSinglePlacementGroupMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewVirtualMachineScaleSetsClient().ConvertToSinglePlacementGroup(ctx, "rgcompute", "aaaaaaaaaaaaa", armcompute.VMScaleSetConvertToSinglePlacementGroupInput{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginSetOrchestrationServiceState_virtualMachineScaleSetSetOrchestrationServiceStateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().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) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSet_SetOrchestrationServiceState_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetsClient_BeginSetOrchestrationServiceState_virtualMachineScaleSetSetOrchestrationServiceStateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetsClient().BeginSetOrchestrationServiceState(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", 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/virtualmachinescalesetvmextensions_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmextensions_client.go index 98cd78f23a87..1e04f9974ae4 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmextensions_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmextensions_client.go @@ -47,7 +47,7 @@ func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string, credenti // BeginCreateOrUpdate - The operation to create or update the VMSS VM extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -75,7 +75,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - The operation to create or update the VMSS VM extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtension, options *VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate" @@ -125,7 +125,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdateCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { @@ -137,7 +137,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) createOrUpdateCreateRequ // BeginDelete - The operation to delete the VMSS VM extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -164,7 +164,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) BeginDelete(ctx context. // Delete - The operation to delete the VMSS VM extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMExtensionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, options *VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginDelete" @@ -214,7 +214,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -223,7 +223,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) deleteCreateRequest(ctx // Get - The operation to get the VMSS VM extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -283,7 +283,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) getCreateRequest(ctx con if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,7 +301,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) getHandleResponse(resp * // List - The operation to get all extensions of an instance in Virtual Machine Scaleset. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -356,7 +356,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) listCreateRequest(ctx co if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -374,7 +374,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) listHandleResponse(resp // BeginUpdate - The operation to update the VMSS VM extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -402,7 +402,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) BeginUpdate(ctx context. // Update - The operation to update the VMSS VM extension. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMExtensionsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, vmExtensionName string, extensionParameters VirtualMachineScaleSetVMExtensionUpdate, options *VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMExtensionsClient.BeginUpdate" @@ -452,7 +452,7 @@ func (client *VirtualMachineScaleSetVMExtensionsClient) updateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, extensionParameters); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmextensions_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmextensions_client_example_test.go deleted file mode 100644 index 62a5ef644cda..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmextensions_client_example_test.go +++ /dev/null @@ -1,226 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().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]any{ - "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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetVMExtension = armcompute.VirtualMachineScaleSetVMExtension{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/extensions/myVMExtension"), - // Name: to.Ptr("myVMExtension"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/extensions"), - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("extType"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("extPublisher"), - // Settings: map[string]any{ - // "UserName": "xyz@microsoft.com", - // }, - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().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]any{ - "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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetVMExtension = armcompute.VirtualMachineScaleSetVMExtension{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/extensions/myVMExtension"), - // Name: to.Ptr("myVMExtension"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/extensions"), - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("extType"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("extPublisher"), - // Settings: map[string]any{ - // "UserName": "xyz@microsoft.com", - // }, - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().Get(ctx, "myResourceGroup", "myvmScaleSet", "0", "myVMExtension", &armcompute.VirtualMachineScaleSetVMExtensionsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetVMExtension = armcompute.VirtualMachineScaleSetVMExtension{ - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/extensions/myVMExtension"), - // Name: to.Ptr("myVMExtension"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/extensions"), - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("extType"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("extPublisher"), - // Settings: map[string]any{ - // "UserName": "xyz@microsoft.com", - // }, - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVMExtension_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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetVMExtensionsClient().List(ctx, "myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMExtensionsClientListOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetVMExtensionsListResult = armcompute.VirtualMachineScaleSetVMExtensionsListResult{ - // Value: []*armcompute.VirtualMachineScaleSetVMExtension{ - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/extensions/myVMExtension"), - // Name: to.Ptr("myVMExtension"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/extensions"), - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("extType"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("extPublisher"), - // Settings: map[string]any{ - // "UserName": "xyz@microsoft.com", - // }, - // TypeHandlerVersion: to.Ptr("1.2"), - // }, - // }, - // { - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/extensions/myVMExtension1"), - // Name: to.Ptr("myVMExtension1"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/extensions"), - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("extType1"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("extPublisher1"), - // Settings: map[string]any{ - // "UserName": "xyz@microsoft.com", - // }, - // TypeHandlerVersion: to.Ptr("1.0"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmruncommands_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmruncommands_client.go index baeaaadc4629..081612454482 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmruncommands_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmruncommands_client.go @@ -47,7 +47,7 @@ func NewVirtualMachineScaleSetVMRunCommandsClient(subscriptionID string, credent // BeginCreateOrUpdate - The operation to create or update the VMSS VM run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -75,7 +75,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - The operation to create or update the VMSS VM run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommand, options *VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate" @@ -125,7 +125,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} if err := runtime.MarshalAsJSON(req, runCommand); err != nil { @@ -137,7 +137,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) createOrUpdateCreateReq // BeginDelete - The operation to delete the VMSS VM run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -164,7 +164,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginDelete(ctx context // Delete - The operation to delete the VMSS VM run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, options *VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginDelete" @@ -214,7 +214,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} return req, nil @@ -223,7 +223,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) deleteCreateRequest(ctx // Get - The operation to get the VMSS VM run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -283,7 +283,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) getCreateRequest(ctx co if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} return req, nil @@ -300,7 +300,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) getHandleResponse(resp // NewListPager - The operation to get all run commands of an instance in Virtual Machine Scaleset. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -356,7 +356,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) listCreateRequest(ctx c if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} return req, nil @@ -374,7 +374,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) listHandleResponse(resp // BeginUpdate - The operation to update the VMSS VM run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -402,7 +402,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) BeginUpdate(ctx context // Update - The operation to update the VMSS VM run command. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMRunCommandsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, runCommandName string, runCommand VirtualMachineRunCommandUpdate, options *VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate" @@ -452,7 +452,7 @@ func (client *VirtualMachineScaleSetVMRunCommandsClient) updateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} if err := runtime.MarshalAsJSON(req, runCommand); err != nil { diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmruncommands_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmruncommands_client_example_test.go deleted file mode 100644 index ec8407f0f4bb..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvmruncommands_client_example_test.go +++ /dev/null @@ -1,291 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().BeginCreateOrUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", armcompute.VirtualMachineRunCommand{ - Location: to.Ptr("West US"), - Properties: &armcompute.VirtualMachineRunCommandProperties{ - AsyncExecution: to.Ptr(false), - ErrorBlobManagedIdentity: &armcompute.RunCommandManagedIdentity{}, - ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - OutputBlobManagedIdentity: &armcompute.RunCommandManagedIdentity{ - ClientID: to.Ptr("22d35efb-0c99-4041-8c5b-6d24db33a69a"), - }, - OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - 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{ - ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1"), - ScriptURIManagedIdentity: &armcompute.RunCommandManagedIdentity{ - ObjectID: to.Ptr("4231e4d2-33e4-4e23-96b2-17888afa6072"), - }, - }, - TimeoutInSeconds: to.Ptr[int32](3600), - TreatFailureAsDeploymentFailure: 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ - // Name: to.Ptr("myRunCommand"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/runCommands/myRunCommand"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // Parameters: []*armcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armcompute.VirtualMachineRunCommandScriptSource{ - // ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1"), - // }, - // TimeoutInSeconds: to.Ptr[int32](3600), - // TreatFailureAsDeploymentFailure: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().BeginUpdate(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", armcompute.VirtualMachineRunCommandUpdate{ - Properties: &armcompute.VirtualMachineRunCommandProperties{ - Source: &armcompute.VirtualMachineRunCommandScriptSource{ - ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1"), - ScriptURIManagedIdentity: &armcompute.RunCommandManagedIdentity{ - ObjectID: to.Ptr("4231e4d2-33e4-4e23-96b2-17888afa6072"), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ - // Name: to.Ptr("myRunCommand"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/runCommands/myRunCommand"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armcompute.VirtualMachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // Parameters: []*armcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armcompute.VirtualMachineRunCommandScriptSource{ - // ScriptURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/scriptcontainer/MyScript.ps1"), - // }, - // TimeoutInSeconds: to.Ptr[int32](3600), - // TreatFailureAsDeploymentFailure: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().Get(ctx, "myResourceGroup", "myvmScaleSet", "0", "myRunCommand", &armcompute.VirtualMachineScaleSetVMRunCommandsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineRunCommand = armcompute.VirtualMachineRunCommand{ - // Name: to.Ptr("myRunCommand"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/runCommands/myRunCommand"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // "tag2": to.Ptr("value2"), - // }, - // Properties: &armcompute.VirtualMachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // Parameters: []*armcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armcompute.VirtualMachineRunCommandScriptSource{ - // ScriptURI: to.Ptr("https://gist.githubusercontent.com/myusername/75fd3634w7511116063c60bcc50bee0/raw/04a4c68ac9e1d36asfasdc64bd1d889b104c7abdb8/HelloWorld.ps1"), - // }, - // TimeoutInSeconds: to.Ptr[int32](3600), - // TreatFailureAsDeploymentFailure: to.Ptr(false), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetVMRunCommandsClient().NewListPager("myResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMRunCommandsClientListOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineRunCommandsListResult = armcompute.VirtualMachineRunCommandsListResult{ - // Value: []*armcompute.VirtualMachineRunCommand{ - // { - // Name: to.Ptr("myRunCommand"), - // Type: to.Ptr("Microsoft.Compute/virtualMachineScaleSets/virtualMachines/runCommands"), - // ID: to.Ptr("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myvmScaleSet/virtualMachines/0/runCommands/myRunCommand"), - // Location: to.Ptr("westus"), - // Properties: &armcompute.VirtualMachineRunCommandProperties{ - // AsyncExecution: to.Ptr(false), - // ErrorBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - // OutputBlobURI: to.Ptr("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // Parameters: []*armcompute.RunCommandInputParameter{ - // { - // Name: to.Ptr("param1"), - // Value: to.Ptr("value1"), - // }, - // { - // Name: to.Ptr("param2"), - // Value: to.Ptr("value2"), - // }}, - // ProvisioningState: to.Ptr("Succeeded"), - // RunAsUser: to.Ptr("user1"), - // Source: &armcompute.VirtualMachineRunCommandScriptSource{ - // Script: to.Ptr("Write-Host Hello World! ; Remove-Item C: est estFile.txt"), - // }, - // TimeoutInSeconds: to.Ptr[int32](0), - // TreatFailureAsDeploymentFailure: to.Ptr(false), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvms_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvms_client.go index 04ed643c8ee6..e8481956364d 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvms_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvms_client.go @@ -48,7 +48,7 @@ func NewVirtualMachineScaleSetVMsClient(subscriptionID string, credential azcore // BeginApproveRollingUpgrade - Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -74,7 +74,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginApproveRollingUpgrade(ctx co // ApproveRollingUpgrade - Approve upgrade on deferred rolling upgrade for OS disk on a VM scale set instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) approveRollingUpgrade(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginApproveRollingUpgradeOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginApproveRollingUpgrade" @@ -120,7 +120,7 @@ func (client *VirtualMachineScaleSetVMsClient) approveRollingUpgradeCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -129,7 +129,7 @@ func (client *VirtualMachineScaleSetVMsClient) approveRollingUpgradeCreateReques // BeginAttachDetachDataDisks - Attach and detach data disks to/from a virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -157,7 +157,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginAttachDetachDataDisks(ctx co // AttachDetachDataDisks - Attach and detach data disks to/from a virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) attachDetachDataDisks(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters AttachDetachDataDisksRequest, options *VirtualMachineScaleSetVMsClientBeginAttachDetachDataDisksOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginAttachDetachDataDisks" @@ -203,7 +203,7 @@ func (client *VirtualMachineScaleSetVMsClient) attachDetachDataDisksCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -217,7 +217,7 @@ func (client *VirtualMachineScaleSetVMsClient) attachDetachDataDisksCreateReques // machine once it is deallocated. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -245,7 +245,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginDeallocate(ctx context.Conte // machine once it is deallocated. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) deallocate(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeallocateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginDeallocate" @@ -291,7 +291,7 @@ func (client *VirtualMachineScaleSetVMsClient) deallocateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +300,7 @@ func (client *VirtualMachineScaleSetVMsClient) deallocateCreateRequest(ctx conte // BeginDelete - Deletes a virtual machine from a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -326,7 +326,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginDelete(ctx context.Context, // Delete - Deletes a virtual machine from a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) deleteOperation(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginDelete" @@ -372,7 +372,7 @@ func (client *VirtualMachineScaleSetVMsClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.ForceDeletion != nil { reqQP.Set("forceDeletion", strconv.FormatBool(*options.ForceDeletion)) } @@ -384,7 +384,7 @@ func (client *VirtualMachineScaleSetVMsClient) deleteCreateRequest(ctx context.C // Get - Gets a virtual machine from a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -439,7 +439,7 @@ func (client *VirtualMachineScaleSetVMsClient) getCreateRequest(ctx context.Cont if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -457,7 +457,7 @@ func (client *VirtualMachineScaleSetVMsClient) getHandleResponse(resp *http.Resp // GetInstanceView - Gets the status of a virtual machine from a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -509,7 +509,7 @@ func (client *VirtualMachineScaleSetVMsClient) getInstanceViewCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -526,7 +526,7 @@ func (client *VirtualMachineScaleSetVMsClient) getInstanceViewHandleResponse(res // NewListPager - Gets a list of all virtual machines in a VM scale sets. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - virtualMachineScaleSetName - The name of the VM scale set. // - options - VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager @@ -583,7 +583,7 @@ func (client *VirtualMachineScaleSetVMsClient) listCreateRequest(ctx context.Con if options != nil && options.Select != nil { reqQP.Set("$select", *options.Select) } - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -601,7 +601,7 @@ func (client *VirtualMachineScaleSetVMsClient) listHandleResponse(resp *http.Res // BeginPerformMaintenance - Performs maintenance on a virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -627,7 +627,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginPerformMaintenance(ctx conte // PerformMaintenance - Performs maintenance on a virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) performMaintenance(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginPerformMaintenance" @@ -673,7 +673,7 @@ func (client *VirtualMachineScaleSetVMsClient) performMaintenanceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -681,11 +681,10 @@ func (client *VirtualMachineScaleSetVMsClient) performMaintenanceCreateRequest(c // BeginPowerOff - Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are // getting charged for the resources. Instead, use deallocate to release resources and avoid -// charges. Additionally, this operation is not allowed on a virtual machine that is being deallocated or already has been -// deallocated. +// charges. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -710,11 +709,10 @@ func (client *VirtualMachineScaleSetVMsClient) BeginPowerOff(ctx context.Context // PowerOff - Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting // charged for the resources. Instead, use deallocate to release resources and avoid -// charges. Additionally, this operation is not allowed on a virtual machine that is being deallocated or already has been -// deallocated. +// charges. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) powerOff(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginPowerOffOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginPowerOff" @@ -760,7 +758,7 @@ func (client *VirtualMachineScaleSetVMsClient) powerOffCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.SkipShutdown != nil { reqQP.Set("skipShutdown", strconv.FormatBool(*options.SkipShutdown)) } @@ -773,7 +771,7 @@ func (client *VirtualMachineScaleSetVMsClient) powerOffCreateRequest(ctx context // back on. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -800,7 +798,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginRedeploy(ctx context.Context // on. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) redeploy(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRedeployOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginRedeploy" @@ -846,7 +844,7 @@ func (client *VirtualMachineScaleSetVMsClient) redeployCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -855,7 +853,7 @@ func (client *VirtualMachineScaleSetVMsClient) redeployCreateRequest(ctx context // BeginReimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -881,7 +879,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginReimage(ctx context.Context, // Reimage - Reimages (upgrade the operating system) a specific virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) reimage(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginReimage" @@ -927,7 +925,7 @@ func (client *VirtualMachineScaleSetVMsClient) reimageCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.VMScaleSetVMReimageInput != nil { @@ -943,7 +941,7 @@ func (client *VirtualMachineScaleSetVMsClient) reimageCreateRequest(ctx context. // is only supported for managed disks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -970,7 +968,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginReimageAll(ctx context.Conte // is only supported for managed disks. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) reimageAll(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginReimageAllOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginReimageAll" @@ -1016,7 +1014,7 @@ func (client *VirtualMachineScaleSetVMsClient) reimageAllCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1025,7 +1023,7 @@ func (client *VirtualMachineScaleSetVMsClient) reimageAllCreateRequest(ctx conte // BeginRestart - Restarts a virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -1051,7 +1049,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginRestart(ctx context.Context, // Restart - Restarts a virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) restart(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginRestart" @@ -1097,7 +1095,7 @@ func (client *VirtualMachineScaleSetVMsClient) restartCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1107,7 +1105,7 @@ func (client *VirtualMachineScaleSetVMsClient) restartCreateRequest(ctx context. // scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -1159,7 +1157,7 @@ func (client *VirtualMachineScaleSetVMsClient) retrieveBootDiagnosticsDataCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") if options != nil && options.SasURIExpirationTimeInMinutes != nil { reqQP.Set("sasUriExpirationTimeInMinutes", strconv.FormatInt(int64(*options.SasURIExpirationTimeInMinutes), 10)) } @@ -1180,7 +1178,7 @@ func (client *VirtualMachineScaleSetVMsClient) retrieveBootDiagnosticsDataHandle // BeginRunCommand - Run command on a virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -1208,7 +1206,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginRunCommand(ctx context.Conte // RunCommand - Run command on a virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) runCommand(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters RunCommandInput, options *VirtualMachineScaleSetVMsClientBeginRunCommandOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginRunCommand" @@ -1254,7 +1252,7 @@ func (client *VirtualMachineScaleSetVMsClient) runCommandCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, text/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1266,7 +1264,7 @@ func (client *VirtualMachineScaleSetVMsClient) runCommandCreateRequest(ctx conte // SimulateEviction - The operation to simulate the eviction of spot virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -1317,7 +1315,7 @@ func (client *VirtualMachineScaleSetVMsClient) simulateEvictionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1326,7 +1324,7 @@ func (client *VirtualMachineScaleSetVMsClient) simulateEvictionCreateRequest(ctx // BeginStart - Starts a virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set. // - instanceID - The instance ID of the virtual machine. @@ -1352,7 +1350,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginStart(ctx context.Context, r // Start - Starts a virtual machine in a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) start(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, options *VirtualMachineScaleSetVMsClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginStart" @@ -1398,7 +1396,7 @@ func (client *VirtualMachineScaleSetVMsClient) startCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1407,7 +1405,7 @@ func (client *VirtualMachineScaleSetVMsClient) startCreateRequest(ctx context.Co // BeginUpdate - Updates a virtual machine of a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - resourceGroupName - The name of the resource group. // - vmScaleSetName - The name of the VM scale set where the extension should be create or updated. // - instanceID - The instance ID of the virtual machine. @@ -1434,7 +1432,7 @@ func (client *VirtualMachineScaleSetVMsClient) BeginUpdate(ctx context.Context, // Update - Updates a virtual machine of a VM scale set. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 func (client *VirtualMachineScaleSetVMsClient) update(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM, options *VirtualMachineScaleSetVMsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineScaleSetVMsClient.BeginUpdate" @@ -1480,7 +1478,7 @@ func (client *VirtualMachineScaleSetVMsClient) updateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvms_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvms_client_example_test.go deleted file mode 100644 index a66802a5f881..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinescalesetvms_client_example_test.go +++ /dev/null @@ -1,2554 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginReimage_virtualMachineScaleSetVmReimageMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginReimage(ctx, "rgcompute", "aaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientBeginReimageOptions{VMScaleSetVMReimageInput: &armcompute.VirtualMachineScaleSetVMReimageParameters{ - TempDisk: to.Ptr(true), - ForceUpdateOSDiskForEphemeral: to.Ptr(true), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Reimage_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginReimage_virtualMachineScaleSetVmReimageMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginReimage(ctx, "rgcompute", "aaaaaaa", "aaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientBeginReimageOptions{VMScaleSetVMReimageInput: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginReimageAll_virtualMachineScaleSetVmReimageAllMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ReimageAll_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginReimageAll_virtualMachineScaleSetVmReimageAllMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginReimageAll(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_ApproveRollingUpgrade.json -func ExampleVirtualMachineScaleSetVMsClient_BeginApproveRollingUpgrade() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginApproveRollingUpgrade(ctx, "rgcompute", "vmssToApproveRollingUpgradeOn", "0123", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginDeallocate_virtualMachineScaleSetVmDeallocateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Deallocate_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginDeallocate_virtualMachineScaleSetVmDeallocateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginDeallocate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginUpdate_virtualMachineScaleSetVmUpdateMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().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{ - { - 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{ - { - 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"), - }, - }, &armcompute.VirtualMachineScaleSetVMsClientBeginUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetVM = armcompute.VirtualMachineScaleSetVM{ - // Name: to.Ptr("{vmss-vm-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // InstanceID: to.Ptr("aaaaaaaaaaaa"), - // 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{ - // AssignedHost: to.Ptr("aaaaaaa"), - // BootDiagnostics: &armcompute.BootDiagnosticsInstanceView{ - // ConsoleScreenshotBlobURI: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // SerialConsoleLogBlobURI: to.Ptr("aaaaaaaa"), - // 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"), - // }}, - // }, - // LatestModelApplied: to.Ptr(true), - // LicenseType: to.Ptr("aaaaaaaaaa"), - // ModelDefinitionApplied: to.Ptr("VirtualMachineScaleSet"), - // 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{ - // { - // 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{ - // { - // 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{ - // 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), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // 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), - // DiskIOPSReadWrite: to.Ptr[int64](18), - // DiskMBpsReadWrite: to.Ptr[int64](29), - // 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"), - // ExactVersion: to.Ptr("4.127.20180315"), - // 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=="), - // VMID: to.Ptr("42af9fdf-b906-4ad7-9905-8316209ff619"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("CustomScriptExtension-DSC"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("CustomScriptExtension"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaa"), - // 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]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("1.9"), - // }, - // }}, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // Capacity: to.Ptr[int64](29), - // Tier: to.Ptr("aaaaaaaaaaaaaa"), - // }, - // Zones: []*string{ - // to.Ptr("a")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Update_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginUpdate_virtualMachineScaleSetVmUpdateMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginUpdate(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaa", armcompute.VirtualMachineScaleSetVM{ - Location: to.Ptr("westus"), - }, &armcompute.VirtualMachineScaleSetVMsClientBeginUpdateOptions{IfMatch: nil, - IfNoneMatch: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetVM = armcompute.VirtualMachineScaleSetVM{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), - // Location: to.Ptr("westus"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithUserData.json -func ExampleVirtualMachineScaleSetVMsClient_Get_getVmScaleSetVmWithUserData() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().Get(ctx, "myResourceGroup", "{vmss-name}", "0", &armcompute.VirtualMachineScaleSetVMsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetVM = armcompute.VirtualMachineScaleSetVM{ - // Name: to.Ptr("{vmss-vm-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Etag: to.Ptr("\"1\""), - // Properties: &armcompute.VirtualMachineScaleSetVMProperties{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // }, - // LatestModelApplied: to.Ptr(true), - // ModelDefinitionApplied: to.Ptr("VirtualMachineScaleSet"), - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415"), - // }}, - // }, - // NetworkProfileConfiguration: &armcompute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("vmsstestnetconfig5415"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("vmsstestnetconfig9693"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("Foo12"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("test000000"), - // RequireGuestProvisionSignal: to.Ptr(true), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](128), - // 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"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // ToBeDetached: to.Ptr(false), - // }}, - // ImageReference: &armcompute.ImageReference{ - // ExactVersion: to.Ptr("4.127.20180315"), - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // 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), - // DiskSizeGB: to.Ptr[int32](127), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - // VMID: to.Ptr("42af9fdf-b906-4ad7-9905-8316209ff619"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("CustomScriptExtension-DSC"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "displayName": to.Ptr("CustomScriptExtension-DSC"), - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("CustomScriptExtension"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("1.9"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Get_WithVMSizeProperties.json -func ExampleVirtualMachineScaleSetVMsClient_Get_getVmScaleSetVmWithVmSizeProperties() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().Get(ctx, "myResourceGroup", "{vmss-name}", "0", &armcompute.VirtualMachineScaleSetVMsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetVM = armcompute.VirtualMachineScaleSetVM{ - // Name: to.Ptr("{vmss-vm-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "myTag1": to.Ptr("tagValue1"), - // }, - // Etag: to.Ptr("\"1\""), - // Properties: &armcompute.VirtualMachineScaleSetVMProperties{ - // DiagnosticsProfile: &armcompute.DiagnosticsProfile{ - // BootDiagnostics: &armcompute.BootDiagnostics{ - // Enabled: to.Ptr(true), - // }, - // }, - // HardwareProfile: &armcompute.HardwareProfile{ - // VMSizeProperties: &armcompute.VMSizeProperties{ - // VCPUsAvailable: to.Ptr[int32](1), - // VCPUsPerCore: to.Ptr[int32](1), - // }, - // }, - // LatestModelApplied: to.Ptr(true), - // ModelDefinitionApplied: to.Ptr("VirtualMachineScaleSet"), - // NetworkProfile: &armcompute.NetworkProfile{ - // NetworkInterfaces: []*armcompute.NetworkInterfaceReference{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0/networkInterfaces/vmsstestnetconfig5415"), - // }}, - // }, - // NetworkProfileConfiguration: &armcompute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ - // NetworkInterfaceConfigurations: []*armcompute.VirtualMachineScaleSetNetworkConfiguration{ - // { - // Name: to.Ptr("vmsstestnetconfig5415"), - // Properties: &armcompute.VirtualMachineScaleSetNetworkConfigurationProperties{ - // DNSSettings: &armcompute.VirtualMachineScaleSetNetworkConfigurationDNSSettings{ - // DNSServers: []*string{ - // }, - // }, - // EnableAcceleratedNetworking: to.Ptr(false), - // EnableIPForwarding: to.Ptr(false), - // IPConfigurations: []*armcompute.VirtualMachineScaleSetIPConfiguration{ - // { - // Name: to.Ptr("vmsstestnetconfig9693"), - // Properties: &armcompute.VirtualMachineScaleSetIPConfigurationProperties{ - // PrivateIPAddressVersion: to.Ptr(armcompute.IPVersionIPv4), - // Subnet: &armcompute.APIEntityReference{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/vn4071/subnets/sn5503"), - // }, - // }, - // }}, - // Primary: to.Ptr(true), - // }, - // }}, - // }, - // OSProfile: &armcompute.OSProfile{ - // AdminUsername: to.Ptr("Foo12"), - // AllowExtensionOperations: to.Ptr(true), - // ComputerName: to.Ptr("test000000"), - // RequireGuestProvisionSignal: to.Ptr(true), - // Secrets: []*armcompute.VaultSecretGroup{ - // }, - // WindowsConfiguration: &armcompute.WindowsConfiguration{ - // EnableAutomaticUpdates: to.Ptr(true), - // ProvisionVMAgent: to.Ptr(true), - // }, - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // StorageProfile: &armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - // Caching: to.Ptr(armcompute.CachingTypesNone), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesEmpty), - // DiskSizeGB: to.Ptr[int32](128), - // 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"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // ToBeDetached: to.Ptr(false), - // }}, - // ImageReference: &armcompute.ImageReference{ - // ExactVersion: to.Ptr("4.127.20180315"), - // Offer: to.Ptr("WindowsServer"), - // Publisher: to.Ptr("MicrosoftWindowsServer"), - // 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), - // DiskSizeGB: to.Ptr[int32](127), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_OsDisk_1_6d72b805e50e4de6830303c5055077fc"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesStandardLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // }, - // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - // VMID: to.Ptr("42af9fdf-b906-4ad7-9905-8316209ff619"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("CustomScriptExtension-DSC"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "displayName": to.Ptr("CustomScriptExtension-DSC"), - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("CustomScriptExtension"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // }, - // TypeHandlerVersion: to.Ptr("1.9"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().GetInstanceView(ctx, "myResourceGroup", "myVirtualMachineScaleSet", "0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineScaleSetVMInstanceView = armcompute.VirtualMachineScaleSetVMInstanceView{ - // AssignedHost: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/hostGroups/myHostGroup/hosts/myHost"), - // Disks: []*armcompute.DiskInstanceView{ - // { - // Name: to.Ptr("myOSDisk"), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-01T04:58:58.088Z"); return t}()), - // }}, - // }}, - // PlatformFaultDomain: to.Ptr[int32](0), - // PlatformUpdateDomain: to.Ptr[int32](0), - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-05T04:59:58.185Z"); return t}()), - // }, - // { - // Code: to.Ptr("PowerState/running"), - // DisplayStatus: to.Ptr("VM running"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // }}, - // VMAgent: &armcompute.VirtualMachineAgentInstanceView{ - // Statuses: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ProvisioningState/Unavailable"), - // DisplayStatus: to.Ptr("Not Ready"), - // Level: to.Ptr(armcompute.StatusLevelTypesWarning), - // Message: to.Ptr("VM status blob is found but not yet populated."), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-07-01T05:00:32.000Z"); return t}()), - // }}, - // VMAgentVersion: to.Ptr("Unknown"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_NewListPager_virtualMachineScaleSetVmListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetVMsClient().NewListPager("rgcompute", "aaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientListOptions{Filter: to.Ptr("aaaaaaaaaaaaaa"), - Select: to.Ptr("aaaaaaaaaaaaaaaaaaaaa"), - Expand: to.Ptr("aaaaaaaaaaaaa"), - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetVMListResult = armcompute.VirtualMachineScaleSetVMListResult{ - // Value: []*armcompute.VirtualMachineScaleSetVM{ - // { - // Name: to.Ptr("{vmss-vm-name}"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // InstanceID: to.Ptr("aaaaaaaaaaaa"), - // 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{ - // AssignedHost: to.Ptr("aaaaaaa"), - // BootDiagnostics: &armcompute.BootDiagnosticsInstanceView{ - // ConsoleScreenshotBlobURI: to.Ptr("aaaaaaaaaaaaaaaaaaaaaaaaa"), - // SerialConsoleLogBlobURI: to.Ptr("aaaaaaaa"), - // 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"), - // }}, - // }, - // LatestModelApplied: to.Ptr(true), - // LicenseType: to.Ptr("aaaaaaaaaa"), - // ModelDefinitionApplied: to.Ptr("VirtualMachineScaleSet"), - // 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{ - // { - // 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{ - // { - // 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{ - // 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), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // 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), - // DiskIOPSReadWrite: to.Ptr[int64](18), - // DiskMBpsReadWrite: to.Ptr[int64](29), - // 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"), - // ExactVersion: to.Ptr("4.127.20180315"), - // 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), - // }, - // }, - // TimeCreated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-27T01:02:38.313Z"); return t}()), - // UserData: to.Ptr("RXhhbXBsZSBVc2VyRGF0YQ=="), - // VMID: to.Ptr("42af9fdf-b906-4ad7-9905-8316209ff619"), - // }, - // Resources: []*armcompute.VirtualMachineExtension{ - // { - // Name: to.Ptr("CustomScriptExtension-DSC"), - // Type: to.Ptr("Microsoft.Compute/virtualMachines/extensions"), - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM/extensions/CustomScriptExtension-DSC"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armcompute.VirtualMachineExtensionProperties{ - // Type: to.Ptr("CustomScriptExtension"), - // AutoUpgradeMinorVersion: to.Ptr(true), - // EnableAutomaticUpgrade: to.Ptr(true), - // ForceUpdateTag: to.Ptr("aaaaaaa"), - // 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]any{ - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // Publisher: to.Ptr("Microsoft.Compute"), - // Settings: map[string]any{ - // }, - // SuppressFailures: to.Ptr(true), - // TypeHandlerVersion: to.Ptr("1.9"), - // }, - // }}, - // SKU: &armcompute.SKU{ - // Name: to.Ptr("Classic"), - // Capacity: to.Ptr[int64](29), - // Tier: to.Ptr("aaaaaaaaaaaaaa"), - // }, - // Zones: []*string{ - // to.Ptr("a")}, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_List_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_NewListPager_virtualMachineScaleSetVmListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineScaleSetVMsClient().NewListPager("rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientListOptions{Filter: nil, - Select: nil, - Expand: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineScaleSetVMListResult = armcompute.VirtualMachineScaleSetVMListResult{ - // Value: []*armcompute.VirtualMachineScaleSetVM{ - // { - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{vmss-name}/virtualMachines/0"), - // Location: to.Ptr("westus"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginPowerOff_virtualMachineScaleSetVmPowerOffMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PowerOff_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginPowerOff_virtualMachineScaleSetVmPowerOffMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginPowerOff(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaa", &armcompute.VirtualMachineScaleSetVMsClientBeginPowerOffOptions{SkipShutdown: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginRestart_virtualMachineScaleSetVmRestartMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Restart_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginRestart_virtualMachineScaleSetVmRestartMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginRestart(ctx, "rgcompute", "aaaaaaaaaaaa", "aaaaaa", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginStart_virtualMachineScaleSetVmStartMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Start_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginStart_virtualMachineScaleSetVmStartMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginStart(ctx, "rgcompute", "aaaaaaaaaaaaaaaaaaaaaaaa", "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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginRedeploy_virtualMachineScaleSetVmRedeployMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_Redeploy_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginRedeploy_virtualMachineScaleSetVmRedeployMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginRedeploy(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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineScaleSetVMsClient().RetrieveBootDiagnosticsData(ctx, "ResourceGroup", "myvmScaleSet", "0", &armcompute.VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions{SasURIExpirationTimeInMinutes: to.Ptr[int32](60)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RetrieveBootDiagnosticsDataResult = armcompute.RetrieveBootDiagnosticsDataResult{ - // ConsoleScreenshotBlobURI: to.Ptr("https://storageuri/myvmScaleSetinstance.screenshot.bmp?{saskey}"), - // SerialConsoleLogBlobURI: to.Ptr("https://storageuri/myvmScaleSetinstance.serialconsole.log?{saskey}"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginPerformMaintenance_virtualMachineScaleSetVmPerformMaintenanceMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_PerformMaintenance_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginPerformMaintenance_virtualMachineScaleSetVmPerformMaintenanceMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginPerformMaintenance(ctx, "rgcompute", "aaaaaaaaaa", "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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewVirtualMachineScaleSetVMsClient().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/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MaximumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginAttachDetachDataDisks_virtualMachineScaleSetVmAttachDetachDataDisksMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginAttachDetachDataDisks(ctx, "rgcompute", "azure-vmscaleset", "0", armcompute.AttachDetachDataDisksRequest{ - DataDisksToAttach: []*armcompute.DataDisksToAttach{ - { - Caching: to.Ptr(armcompute.CachingTypesReadOnly), - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - Lun: to.Ptr[int32](1), - WriteAcceleratorEnabled: to.Ptr(true), - }, - { - Caching: to.Ptr(armcompute.CachingTypesReadWrite), - DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - }, - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), - Lun: to.Ptr[int32](2), - WriteAcceleratorEnabled: to.Ptr(false), - }}, - DataDisksToDetach: []*armcompute.DataDisksToDetach{ - { - DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x"), - }, - { - DetachOption: to.Ptr(armcompute.DiskDetachOptionTypesForceDetach), - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_4_disk4_4d4e784bdafa49baa780eb2d256ff41z"), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageProfile = armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - // Caching: to.Ptr(armcompute.CachingTypesReadOnly), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - // DiskSizeGB: to.Ptr[int32](30), - // 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("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // WriteAcceleratorEnabled: to.Ptr(true), - // }, - // { - // Name: to.Ptr("vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - // DiskSizeGB: to.Ptr[int32](100), - // Lun: to.Ptr[int32](2), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_2_disk3_7d5e664bdafa49baa780eb2d128ff38e"), - // DiskEncryptionSet: &armcompute.DiskEncryptionSetParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"), - // }, - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // WriteAcceleratorEnabled: 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("myOsDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/virtualMachineScaleSetExamples/VirtualMachineScaleSetVM_AttachDetachDataDisks_MinimumSet_Gen.json -func ExampleVirtualMachineScaleSetVMsClient_BeginAttachDetachDataDisks_virtualMachineScaleSetVmAttachDetachDataDisksMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().BeginAttachDetachDataDisks(ctx, "rgcompute", "azure-vmscaleset", "0", armcompute.AttachDetachDataDisksRequest{ - DataDisksToAttach: []*armcompute.DataDisksToAttach{ - { - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - }}, - DataDisksToDetach: []*armcompute.DataDisksToDetach{ - { - DiskID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_1_disk1_1a4e784bdafa49baa780eb2d128ff65x"), - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageProfile = armcompute.StorageProfile{ - // DataDisks: []*armcompute.DataDisk{ - // { - // Name: to.Ptr("vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesAttach), - // DiskSizeGB: to.Ptr[int32](30), - // Lun: to.Ptr[int32](0), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/vmss3176_vmss3176_0_disk2_6c4f554bdafa49baa780eb2d128ff39d"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // }}, - // 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("myOsDisk"), - // Caching: to.Ptr(armcompute.CachingTypesReadWrite), - // CreateOption: to.Ptr(armcompute.DiskCreateOptionTypesFromImage), - // DiskSizeGB: to.Ptr[int32](30), - // ManagedDisk: &armcompute.ManagedDiskParameters{ - // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/myOsDisk"), - // StorageAccountType: to.Ptr(armcompute.StorageAccountTypesPremiumLRS), - // }, - // OSType: to.Ptr(armcompute.OperatingSystemTypesWindows), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/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() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineScaleSetVMsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RunCommandResult = armcompute.RunCommandResult{ - // Value: []*armcompute.InstanceViewStatus{ - // { - // Code: to.Ptr("ComponentStatus/StdOut/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr("Hello World!"), - // }, - // { - // Code: to.Ptr("ComponentStatus/StdErr/succeeded"), - // DisplayStatus: to.Ptr("Provisioning succeeded"), - // Level: to.Ptr(armcompute.StatusLevelTypesInfo), - // Message: to.Ptr(""), - // }}, - // } -} diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinesizes_client.go b/sdk/resourcemanager/compute/armcompute/virtualmachinesizes_client.go index f2569b82f934..9237d5c925d6 100644 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinesizes_client.go +++ b/sdk/resourcemanager/compute/armcompute/virtualmachinesizes_client.go @@ -46,7 +46,7 @@ func NewVirtualMachineSizesClient(subscriptionID string, credential azcore.Token // NewListPager - This API is deprecated. Use Resources Skus [https://docs.microsoft.com/rest/api/compute/resourceskus/list] // -// Generated from API version 2024-07-01 +// Generated from API version 2024-11-01 // - location - The location upon which virtual-machine-sizes is queried. // - options - VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager // method. @@ -90,7 +90,7 @@ func (client *VirtualMachineSizesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-07-01") + reqQP.Set("api-version", "2024-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/compute/armcompute/virtualmachinesizes_client_example_test.go b/sdk/resourcemanager/compute/armcompute/virtualmachinesizes_client_example_test.go deleted file mode 100644 index 0395bd62ade0..000000000000 --- a/sdk/resourcemanager/compute/armcompute/virtualmachinesizes_client_example_test.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v6" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MaximumSet_Gen.json -func ExampleVirtualMachineSizesClient_NewListPager_virtualMachineSizesListMaximumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineSizesClient().NewListPager("-e", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineSizeListResult = armcompute.VirtualMachineSizeListResult{ - // Value: []*armcompute.VirtualMachineSize{ - // { - // Name: to.Ptr("Standard_A1_V2"), - // MaxDataDiskCount: to.Ptr[int32](2), - // MemoryInMB: to.Ptr[int32](2048), - // NumberOfCores: to.Ptr[int32](1), - // OSDiskSizeInMB: to.Ptr[int32](1047552), - // ResourceDiskSizeInMB: to.Ptr[int32](10240), - // }, - // { - // Name: to.Ptr("Standard_A2_V2"), - // MaxDataDiskCount: to.Ptr[int32](4), - // MemoryInMB: to.Ptr[int32](4096), - // NumberOfCores: to.Ptr[int32](2), - // OSDiskSizeInMB: to.Ptr[int32](1047552), - // ResourceDiskSizeInMB: to.Ptr[int32](20480), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d6d0798c6f5eb196fba7bd1924db2b145a94f58c/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2024-07-01/examples/computeRPCommonExamples/VirtualMachineSizes_List_MinimumSet_Gen.json -func ExampleVirtualMachineSizesClient_NewListPager_virtualMachineSizesListMinimumSetGen() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armcompute.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineSizesClient().NewListPager("._..", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineSizeListResult = armcompute.VirtualMachineSizeListResult{ - // } - } -}