From 5b9da12842adc5594216ca4606006948153c9667 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 30 Oct 2023 13:29:25 +0000 Subject: [PATCH] CodeGen from PR 26239 in Azure/azure-rest-api-specs Merge e65acad701efc9e56117184a4a529a7335c49fbd into d7719453f5fd98cd06863d825db960ccaa252aa5 --- .../armazurestackhci/CHANGELOG.md | 4 + .../armazurestackhci/autorest.md | 7 +- .../armazurestackhci/constants.go | 2 +- .../galleryimages_client_example_test.go | 368 --------- .../azurestackhci/armazurestackhci/go.mod | 13 +- .../azurestackhci/armazurestackhci/go.sum | 20 +- .../guestagent_client_example_test.go | 113 --- .../guestagents_client_example_test.go | 56 -- ...rididentitymetadata_client_example_test.go | 92 --- .../logicalnetworks_client_example_test.go | 242 ------ ...tplacegalleryimages_client_example_test.go | 401 --------- .../networkinterfaces_client_example_test.go | 295 ------- .../operations_client_example_test.go | 57 -- .../storagecontainers_client_example_test.go | 250 ------ .../virtualharddisks_client_example_test.go | 280 ------- ...ualmachineinstances_client_example_test.go | 769 ------------------ 16 files changed, 11 insertions(+), 2958 deletions(-) delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/galleryimages_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/guestagent_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/guestagents_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/hybrididentitymetadata_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/logicalnetworks_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/marketplacegalleryimages_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/networkinterfaces_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/storagecontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/virtualharddisks_client_example_test.go delete mode 100644 sdk/resourcemanager/azurestackhci/armazurestackhci/virtualmachineinstances_client_example_test.go diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md b/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md index dd153baf82c1..8dacae993ebc 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 2.0.0-beta.2 (2023-10-30) +### Other Changes + + ## 2.0.0-beta.1 (2023-10-27) ### Breaking Changes diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/autorest.md b/sdk/resourcemanager/azurestackhci/armazurestackhci/autorest.md index 3c5da4555118..48e7a5275da9 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/autorest.md +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/azurestackhci/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.0.0-beta.1 -tag: package-preview-2023-09 +module-version: 2.0.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/constants.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/constants.go index ec273b200c10..b8456494ec8d 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/constants.go +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/constants.go @@ -10,7 +10,7 @@ package armazurestackhci const ( moduleName = "armazurestackhci" - moduleVersion = "v2.0.0-beta.1" + moduleVersion = "v2.0.0-beta.2" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/galleryimages_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/galleryimages_client_example_test.go deleted file mode 100644 index 0224161e28e0..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/galleryimages_client_example_test.go +++ /dev/null @@ -1,368 +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 armazurestackhci_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/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetGalleryImage.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 := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGalleryImagesClient().Get(ctx, "test-rg", "test-gallery-image", 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.GalleryImages = armazurestackhci.GalleryImages{ - // Name: to.Ptr("test-gallery-image"), - // Type: to.Ptr("Microsoft.AzureStackHCI/galleryImages"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.GalleryImageProperties{ - // CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceNoCloud), - // ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV1), - // Identifier: &armazurestackhci.GalleryImageIdentifier{ - // Offer: to.Ptr("myOfferName"), - // Publisher: to.Ptr("myPublisherName"), - // SKU: to.Ptr("mySkuName"), - // }, - // OSType: to.Ptr(armazurestackhci.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // Status: &armazurestackhci.GalleryImageStatus{ - // DownloadStatus: &armazurestackhci.GalleryImageStatusDownloadStatus{ - // DownloadSizeInMB: to.Ptr[int64](9383), - // }, - // ProgressPercentage: to.Ptr[int64](100), - // ProvisioningStatus: &armazurestackhci.GalleryImageStatusProvisioningStatus{ - // OperationID: to.Ptr("79cfc696-44f5-4a68-a620-21850f7e9fb0"), - // Status: to.Ptr(armazurestackhci.StatusSucceeded), - // }, - // }, - // Version: &armazurestackhci.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // Properties: &armazurestackhci.GalleryImageVersionProperties{ - // StorageProfile: &armazurestackhci.GalleryImageVersionStorageProfile{ - // OSDiskImage: &armazurestackhci.GalleryOSDiskImage{ - // SizeInMB: to.Ptr[int64](30270), - // }, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutGalleryImage.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 := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImagesClient().BeginCreateOrUpdate(ctx, "test-rg", "test-gallery-image", armazurestackhci.GalleryImages{ - Location: to.Ptr("West US2"), - ExtendedLocation: &armazurestackhci.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - }, - Properties: &armazurestackhci.GalleryImageProperties{ - ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - ImagePath: to.Ptr("C:\\test.vhdx"), - OSType: to.Ptr(armazurestackhci.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.GalleryImages = armazurestackhci.GalleryImages{ - // Name: to.Ptr("test-gallery-image"), - // Type: to.Ptr("Microsoft.AzureStackHCI/galleryImages"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.GalleryImageProperties{ - // CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceNoCloud), - // ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV2), - // OSType: to.Ptr(armazurestackhci.OperatingSystemTypesLinux), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // Status: &armazurestackhci.GalleryImageStatus{ - // DownloadStatus: &armazurestackhci.GalleryImageStatusDownloadStatus{ - // DownloadSizeInMB: to.Ptr[int64](9383), - // }, - // ProgressPercentage: to.Ptr[int64](100), - // ProvisioningStatus: &armazurestackhci.GalleryImageStatusProvisioningStatus{ - // OperationID: to.Ptr("79cfc696-44f5-4a68-a620-21850f7e9fb0"), - // Status: to.Ptr(armazurestackhci.StatusSucceeded), - // }, - // }, - // Version: &armazurestackhci.GalleryImageVersion{ - // Properties: &armazurestackhci.GalleryImageVersionProperties{ - // StorageProfile: &armazurestackhci.GalleryImageVersionStorageProfile{ - // OSDiskImage: &armazurestackhci.GalleryOSDiskImage{ - // SizeInMB: to.Ptr[int64](30270), - // }, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteGalleryImage.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 := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImagesClient().BeginDelete(ctx, "test-rg", "test-gallery-image", 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateGalleryImage.json -func ExampleGalleryImagesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGalleryImagesClient().BeginUpdate(ctx, "test-rg", "test-gallery-image", armazurestackhci.GalleryImagesUpdateRequest{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("sample"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GalleryImages = armazurestackhci.GalleryImages{ - // Name: to.Ptr("test-gallery-image"), - // Type: to.Ptr("Microsoft.AzureStackHCI/galleryImages"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-galimg3325"), - // Location: to.Ptr("West US2"), - // Tags: map[string]*string{ - // "additionalProperties": to.Ptr("sample"), - // }, - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.GalleryImageProperties{ - // CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceNoCloud), - // ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV2), - // OSType: to.Ptr(armazurestackhci.OperatingSystemTypesLinux), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // Status: &armazurestackhci.GalleryImageStatus{ - // DownloadStatus: &armazurestackhci.GalleryImageStatusDownloadStatus{ - // DownloadSizeInMB: to.Ptr[int64](9383), - // }, - // ProgressPercentage: to.Ptr[int64](100), - // ProvisioningStatus: &armazurestackhci.GalleryImageStatusProvisioningStatus{ - // OperationID: to.Ptr("79cfc696-44f5-4a68-a620-21850f7e9fb0"), - // Status: to.Ptr(armazurestackhci.StatusSucceeded), - // }, - // }, - // Version: &armazurestackhci.GalleryImageVersion{ - // Properties: &armazurestackhci.GalleryImageVersionProperties{ - // StorageProfile: &armazurestackhci.GalleryImageVersionStorageProfile{ - // OSDiskImage: &armazurestackhci.GalleryOSDiskImage{ - // SizeInMB: to.Ptr[int64](30270), - // }, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListGalleryImageByResourceGroup.json -func ExampleGalleryImagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGalleryImagesClient().NewListPager("test-rg", 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.GalleryImagesListResult = armazurestackhci.GalleryImagesListResult{ - // Value: []*armazurestackhci.GalleryImages{ - // { - // Name: to.Ptr("test-gallery-image"), - // Type: to.Ptr("Microsoft.AzureStackHCI/galleryImages"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.GalleryImageProperties{ - // CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceNoCloud), - // ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV2), - // OSType: to.Ptr(armazurestackhci.OperatingSystemTypesLinux), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // Status: &armazurestackhci.GalleryImageStatus{ - // DownloadStatus: &armazurestackhci.GalleryImageStatusDownloadStatus{ - // DownloadSizeInMB: to.Ptr[int64](9383), - // }, - // ProgressPercentage: to.Ptr[int64](100), - // ProvisioningStatus: &armazurestackhci.GalleryImageStatusProvisioningStatus{ - // OperationID: to.Ptr("79cfc696-44f5-4a68-a620-21850f7e9fb0"), - // Status: to.Ptr(armazurestackhci.StatusSucceeded), - // }, - // }, - // Version: &armazurestackhci.GalleryImageVersion{ - // Properties: &armazurestackhci.GalleryImageVersionProperties{ - // StorageProfile: &armazurestackhci.GalleryImageVersionStorageProfile{ - // OSDiskImage: &armazurestackhci.GalleryOSDiskImage{ - // SizeInMB: to.Ptr[int64](30270), - // }, - // }, - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListGalleryImageBySubscription.json -func ExampleGalleryImagesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGalleryImagesClient().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.GalleryImagesListResult = armazurestackhci.GalleryImagesListResult{ - // Value: []*armazurestackhci.GalleryImages{ - // { - // Name: to.Ptr("test-gallery-image"), - // Type: to.Ptr("Microsoft.AzureStackHCI/galleryImages"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.GalleryImageProperties{ - // CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceNoCloud), - // ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV2), - // OSType: to.Ptr(armazurestackhci.OperatingSystemTypesLinux), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // Status: &armazurestackhci.GalleryImageStatus{ - // DownloadStatus: &armazurestackhci.GalleryImageStatusDownloadStatus{ - // DownloadSizeInMB: to.Ptr[int64](9383), - // }, - // ProgressPercentage: to.Ptr[int64](100), - // ProvisioningStatus: &armazurestackhci.GalleryImageStatusProvisioningStatus{ - // OperationID: to.Ptr("79cfc696-44f5-4a68-a620-21850f7e9fb0"), - // Status: to.Ptr(armazurestackhci.StatusSucceeded), - // }, - // }, - // Version: &armazurestackhci.GalleryImageVersion{ - // Properties: &armazurestackhci.GalleryImageVersionProperties{ - // StorageProfile: &armazurestackhci.GalleryImageVersionStorageProfile{ - // OSDiskImage: &armazurestackhci.GalleryOSDiskImage{ - // SizeInMB: to.Ptr[int64](30270), - // }, - // }, - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/go.mod b/sdk/resourcemanager/azurestackhci/armazurestackhci/go.mod index f0ecb53eee63..1d9c5c98bc8f 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/go.mod +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/go.mod @@ -2,20 +2,11 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azurestackhci/armaz go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect - github.com/golang-jwt/jwt/v5 v5.0.0 // indirect - github.com/google/uuid v1.3.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.14.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.15.0 // indirect - golang.org/x/sys v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect ) diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/go.sum b/sdk/resourcemanager/azurestackhci/armazurestackhci/go.sum index 014da0d3b4ac..39f83ae26f03 100644 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/go.sum +++ b/sdk/resourcemanager/azurestackhci/armazurestackhci/go.sum @@ -1,31 +1,13 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 h1:9kDVnTz3vbfweTqAUmk/a/pH5pWFCHtvRpHYC0G/dcA= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0/go.mod h1:3Ug6Qzto9anB6mGlEdgYMDF5zHQ+wwhEaYR4s17PHMw= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= -github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/guestagent_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/guestagent_client_example_test.go deleted file mode 100644 index 5c261d768d3b..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/guestagent_client_example_test.go +++ /dev/null @@ -1,113 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armazurestackhci_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/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/CreateGuestAgent.json -func ExampleGuestAgentClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGuestAgentClient().BeginCreate(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", &armazurestackhci.GuestAgentClientBeginCreateOptions{Body: &armazurestackhci.GuestAgent{ - Properties: &armazurestackhci.GuestAgentProperties{ - Credentials: &armazurestackhci.GuestCredential{ - Password: to.Ptr(""), - Username: to.Ptr("tempuser"), - }, - ProvisioningAction: to.Ptr(armazurestackhci.ProvisioningActionInstall), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GuestAgent = armazurestackhci.GuestAgent{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualMachineInstances/guestAgents"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default"), - // Properties: &armazurestackhci.GuestAgentProperties{ - // ProvisioningAction: to.Ptr(armazurestackhci.ProvisioningActionInstall), - // ProvisioningState: to.Ptr("Succeeded"), - // Status: to.Ptr("connected"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetGuestAgent.json -func ExampleGuestAgentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGuestAgentClient().Get(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", 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.GuestAgent = armazurestackhci.GuestAgent{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualMachineInstances/guestAgents"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default"), - // Properties: &armazurestackhci.GuestAgentProperties{ - // ProvisioningAction: to.Ptr(armazurestackhci.ProvisioningActionInstall), - // ProvisioningState: to.Ptr("Succeeded"), - // Status: to.Ptr("connected"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteGuestAgent.json -func ExampleGuestAgentClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGuestAgentClient().BeginDelete(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", 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/azurestackhci/armazurestackhci/guestagents_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/guestagents_client_example_test.go deleted file mode 100644 index b7b2541ee7de..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/guestagents_client_example_test.go +++ /dev/null @@ -1,56 +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 armazurestackhci_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GuestAgent_List.json -func ExampleGuestAgentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGuestAgentsClient().NewListPager("subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", 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.GuestAgentList = armazurestackhci.GuestAgentList{ - // Value: []*armazurestackhci.GuestAgent{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualMachineInstances/guestAgents"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default"), - // Properties: &armazurestackhci.GuestAgentProperties{ - // ProvisioningAction: to.Ptr(armazurestackhci.ProvisioningActionInstall), - // ProvisioningState: to.Ptr("Succeeded"), - // Status: to.Ptr("connected"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/hybrididentitymetadata_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/hybrididentitymetadata_client_example_test.go deleted file mode 100644 index 40bf9c56d21a..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/hybrididentitymetadata_client_example_test.go +++ /dev/null @@ -1,92 +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 armazurestackhci_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetHybridIdentityMetadata.json -func ExampleHybridIdentityMetadataClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHybridIdentityMetadataClient().Get(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", 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.HybridIdentityMetadata = armazurestackhci.HybridIdentityMetadata{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualMachineInstances/hybridIdentityMetadata"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // Properties: &armazurestackhci.HybridIdentityMetadataProperties{ - // Identity: &armazurestackhci.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("7b5129bc-8642-4a6a-95f8-63400ca6ec4d"), - // TenantID: to.Ptr("ec46ca82-5d4a-4e3e-b4b7-e27f9318645d"), - // }, - // PublicKey: to.Ptr("8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/HybridIdentityMetadata_List.json -func ExampleHybridIdentityMetadataClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHybridIdentityMetadataClient().NewListPager("subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", 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.HybridIdentityMetadataList = armazurestackhci.HybridIdentityMetadataList{ - // Value: []*armazurestackhci.HybridIdentityMetadata{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualMachineInstances/hybridIdentityMetadata"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // Properties: &armazurestackhci.HybridIdentityMetadataProperties{ - // Identity: &armazurestackhci.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("7b5129bc-8642-4a6a-95f8-63400ca6ec4d"), - // TenantID: to.Ptr("ec46ca82-5d4a-4e3e-b4b7-e27f9318645d"), - // }, - // PublicKey: to.Ptr("8ec7d60c-9700-40b1-8e6e-e5b2f6f477f2"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/logicalnetworks_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/logicalnetworks_client_example_test.go deleted file mode 100644 index 620fed06d072..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/logicalnetworks_client_example_test.go +++ /dev/null @@ -1,242 +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 armazurestackhci_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/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetLogicalNetwork.json -func ExampleLogicalNetworksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLogicalNetworksClient().Get(ctx, "test-rg", "test-lnet", 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.LogicalNetworks = armazurestackhci.LogicalNetworks{ - // Name: to.Ptr("test-lnet"), - // Type: to.Ptr("Microsoft.AzureStackHCI/logicalNetworks"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/logicalNetworks/test-lnet"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.LogicalNetworkProperties{ - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutLogicalNetwork.json -func ExampleLogicalNetworksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLogicalNetworksClient().BeginCreateOrUpdate(ctx, "test-rg", "test-lnet", armazurestackhci.LogicalNetworks{ - Location: to.Ptr("West US2"), - ExtendedLocation: &armazurestackhci.ExtendedLocation{ - Name: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogicalNetworks = armazurestackhci.LogicalNetworks{ - // Name: to.Ptr("test-lnet"), - // Type: to.Ptr("Microsoft.AzureStackHCI/logicalNetworks"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/logicalNetworks/test-lnet"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.LogicalNetworkProperties{ - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteLogicalNetwork.json -func ExampleLogicalNetworksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLogicalNetworksClient().BeginDelete(ctx, "test-rg", "test-lnet", 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateLogicalNetwork.json -func ExampleLogicalNetworksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewLogicalNetworksClient().BeginUpdate(ctx, "test-rg", "test-lnet", armazurestackhci.LogicalNetworksUpdateRequest{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("sample"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.LogicalNetworks = armazurestackhci.LogicalNetworks{ - // Name: to.Ptr("test-lnet"), - // Type: to.Ptr("Microsoft.AzureStackHCI/logicalNetworks"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/logicalNetworks/test-lnet"), - // Location: to.Ptr("West US2"), - // Tags: map[string]*string{ - // "additionalProperties": to.Ptr("sample"), - // }, - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.LogicalNetworkProperties{ - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListLogicalNetworkByResourceGroup.json -func ExampleLogicalNetworksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLogicalNetworksClient().NewListPager("test-rg", 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.LogicalNetworksListResult = armazurestackhci.LogicalNetworksListResult{ - // Value: []*armazurestackhci.LogicalNetworks{ - // { - // Name: to.Ptr("test-lnet"), - // Type: to.Ptr("Microsoft.AzureStackHCI/logicalNetworks"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-lnet"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.LogicalNetworkProperties{ - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListLogicalNetworkBySubscription.json -func ExampleLogicalNetworksClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLogicalNetworksClient().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.LogicalNetworksListResult = armazurestackhci.LogicalNetworksListResult{ - // Value: []*armazurestackhci.LogicalNetworks{ - // { - // Name: to.Ptr("test-lnet"), - // Type: to.Ptr("Microsoft.AzureStackHCI/logicalNetworks"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/logicalNetworks/test-lnet"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.LogicalNetworkProperties{ - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/marketplacegalleryimages_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/marketplacegalleryimages_client_example_test.go deleted file mode 100644 index 0c7011e1fa15..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/marketplacegalleryimages_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 armazurestackhci_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/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetMarketplaceGalleryImage.json -func ExampleMarketplaceGalleryImagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMarketplaceGalleryImagesClient().Get(ctx, "test-rg", "test-marketplace-gallery-image", 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.MarketplaceGalleryImages = armazurestackhci.MarketplaceGalleryImages{ - // Name: to.Ptr("test-marketplace-gallery-image"), - // Type: to.Ptr("Microsoft.AzureStackHCI/marketplaceGalleryImages"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.MarketplaceGalleryImageProperties{ - // CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceNoCloud), - // ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV1), - // Identifier: &armazurestackhci.GalleryImageIdentifier{ - // Offer: to.Ptr("myOfferName"), - // Publisher: to.Ptr("myPublisherName"), - // SKU: to.Ptr("mySkuName"), - // }, - // OSType: to.Ptr(armazurestackhci.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // Status: &armazurestackhci.MarketplaceGalleryImageStatus{ - // DownloadStatus: &armazurestackhci.MarketplaceGalleryImageStatusDownloadStatus{ - // DownloadSizeInMB: to.Ptr[int64](9383), - // }, - // ProgressPercentage: to.Ptr[int64](100), - // ProvisioningStatus: &armazurestackhci.MarketplaceGalleryImageStatusProvisioningStatus{ - // OperationID: to.Ptr("79cfc696-44f5-4a68-a620-21850f7e9fb0"), - // Status: to.Ptr(armazurestackhci.StatusSucceeded), - // }, - // }, - // Version: &armazurestackhci.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // Properties: &armazurestackhci.GalleryImageVersionProperties{ - // StorageProfile: &armazurestackhci.GalleryImageVersionStorageProfile{ - // OSDiskImage: &armazurestackhci.GalleryOSDiskImage{ - // SizeInMB: to.Ptr[int64](30270), - // }, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutMarketplaceGalleryImage.json -func ExampleMarketplaceGalleryImagesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMarketplaceGalleryImagesClient().BeginCreateOrUpdate(ctx, "test-rg", "test-marketplace-gallery-image", armazurestackhci.MarketplaceGalleryImages{ - Location: to.Ptr("West US2"), - ExtendedLocation: &armazurestackhci.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - }, - Properties: &armazurestackhci.MarketplaceGalleryImageProperties{ - CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceAzure), - ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV1), - Identifier: &armazurestackhci.GalleryImageIdentifier{ - Offer: to.Ptr("myOfferName"), - Publisher: to.Ptr("myPublisherName"), - SKU: to.Ptr("mySkuName"), - }, - OSType: to.Ptr(armazurestackhci.OperatingSystemTypesWindows), - Version: &armazurestackhci.GalleryImageVersion{ - Name: to.Ptr("1.0.0"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MarketplaceGalleryImages = armazurestackhci.MarketplaceGalleryImages{ - // Name: to.Ptr("test-marketplace-gallery-image"), - // Type: to.Ptr("Microsoft.AzureStackHCI/marketplaceGalleryImages"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.MarketplaceGalleryImageProperties{ - // CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceAzure), - // ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV1), - // Identifier: &armazurestackhci.GalleryImageIdentifier{ - // Offer: to.Ptr("myOfferName"), - // Publisher: to.Ptr("myPublisherName"), - // SKU: to.Ptr("mySkuName"), - // }, - // OSType: to.Ptr(armazurestackhci.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // Status: &armazurestackhci.MarketplaceGalleryImageStatus{ - // DownloadStatus: &armazurestackhci.MarketplaceGalleryImageStatusDownloadStatus{ - // DownloadSizeInMB: to.Ptr[int64](9383), - // }, - // ProgressPercentage: to.Ptr[int64](0), - // ProvisioningStatus: &armazurestackhci.MarketplaceGalleryImageStatusProvisioningStatus{ - // OperationID: to.Ptr("79cfc696-44f5-4a68-a620-21850f7e9fb0"), - // Status: to.Ptr(armazurestackhci.StatusInProgress), - // }, - // }, - // Version: &armazurestackhci.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // Properties: &armazurestackhci.GalleryImageVersionProperties{ - // StorageProfile: &armazurestackhci.GalleryImageVersionStorageProfile{ - // OSDiskImage: &armazurestackhci.GalleryOSDiskImage{ - // SizeInMB: to.Ptr[int64](30270), - // }, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteMarketplaceGalleryImage.json -func ExampleMarketplaceGalleryImagesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMarketplaceGalleryImagesClient().BeginDelete(ctx, "test-rg", "test-marketplace-gallery-image", 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateMarketplaceGalleryImage.json -func ExampleMarketplaceGalleryImagesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewMarketplaceGalleryImagesClient().BeginUpdate(ctx, "test-rg", "test-marketplce-gallery-image", armazurestackhci.MarketplaceGalleryImagesUpdateRequest{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("sample"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MarketplaceGalleryImages = armazurestackhci.MarketplaceGalleryImages{ - // Name: to.Ptr("test-marketplace-gallery-image"), - // Type: to.Ptr("Microsoft.AzureStackHCI/marketplaceGalleryImages"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image"), - // Location: to.Ptr("West US2"), - // Tags: map[string]*string{ - // "additionalProperties": to.Ptr("sample"), - // }, - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.MarketplaceGalleryImageProperties{ - // CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceAzure), - // ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV1), - // Identifier: &armazurestackhci.GalleryImageIdentifier{ - // Offer: to.Ptr("myOfferName"), - // Publisher: to.Ptr("myPublisherName"), - // SKU: to.Ptr("mySkuName"), - // }, - // OSType: to.Ptr(armazurestackhci.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // Status: &armazurestackhci.MarketplaceGalleryImageStatus{ - // DownloadStatus: &armazurestackhci.MarketplaceGalleryImageStatusDownloadStatus{ - // DownloadSizeInMB: to.Ptr[int64](9383), - // }, - // ProgressPercentage: to.Ptr[int64](0), - // ProvisioningStatus: &armazurestackhci.MarketplaceGalleryImageStatusProvisioningStatus{ - // OperationID: to.Ptr("79cfc696-44f5-4a68-a620-21850f7e9fb0"), - // Status: to.Ptr(armazurestackhci.StatusInProgress), - // }, - // }, - // Version: &armazurestackhci.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // Properties: &armazurestackhci.GalleryImageVersionProperties{ - // StorageProfile: &armazurestackhci.GalleryImageVersionStorageProfile{ - // OSDiskImage: &armazurestackhci.GalleryOSDiskImage{ - // SizeInMB: to.Ptr[int64](30270), - // }, - // }, - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListMarketplaceGalleryImageByResourceGroup.json -func ExampleMarketplaceGalleryImagesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMarketplaceGalleryImagesClient().NewListPager("test-rg", 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.MarketplaceGalleryImagesListResult = armazurestackhci.MarketplaceGalleryImagesListResult{ - // Value: []*armazurestackhci.MarketplaceGalleryImages{ - // { - // Name: to.Ptr("test-marketplace-gallery-image"), - // Type: to.Ptr("Microsoft.AzureStackHCI/marketplaceGalleryImages"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.MarketplaceGalleryImageProperties{ - // CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceAzure), - // ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV1), - // Identifier: &armazurestackhci.GalleryImageIdentifier{ - // Offer: to.Ptr("myOfferName"), - // Publisher: to.Ptr("myPublisherName"), - // SKU: to.Ptr("mySkuName"), - // }, - // OSType: to.Ptr(armazurestackhci.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // Status: &armazurestackhci.MarketplaceGalleryImageStatus{ - // DownloadStatus: &armazurestackhci.MarketplaceGalleryImageStatusDownloadStatus{ - // DownloadSizeInMB: to.Ptr[int64](9383), - // }, - // ProgressPercentage: to.Ptr[int64](100), - // ProvisioningStatus: &armazurestackhci.MarketplaceGalleryImageStatusProvisioningStatus{ - // OperationID: to.Ptr("79cfc696-44f5-4a68-a620-21850f7e9fb0"), - // Status: to.Ptr(armazurestackhci.StatusSucceeded), - // }, - // }, - // Version: &armazurestackhci.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // Properties: &armazurestackhci.GalleryImageVersionProperties{ - // StorageProfile: &armazurestackhci.GalleryImageVersionStorageProfile{ - // OSDiskImage: &armazurestackhci.GalleryOSDiskImage{ - // SizeInMB: to.Ptr[int64](30270), - // }, - // }, - // }, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListMarketplaceGalleryImageBySubscription.json -func ExampleMarketplaceGalleryImagesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewMarketplaceGalleryImagesClient().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.MarketplaceGalleryImagesListResult = armazurestackhci.MarketplaceGalleryImagesListResult{ - // Value: []*armazurestackhci.MarketplaceGalleryImages{ - // { - // Name: to.Ptr("test-marketplace-gallery-image"), - // Type: to.Ptr("Microsoft.AzureStackHCI/marketplaceGalleryImages"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.MarketplaceGalleryImageProperties{ - // CloudInitDataSource: to.Ptr(armazurestackhci.CloudInitDataSourceAzure), - // ContainerID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV1), - // Identifier: &armazurestackhci.GalleryImageIdentifier{ - // Offer: to.Ptr("myOfferName"), - // Publisher: to.Ptr("myPublisherName"), - // SKU: to.Ptr("mySkuName"), - // }, - // OSType: to.Ptr(armazurestackhci.OperatingSystemTypesWindows), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // Status: &armazurestackhci.MarketplaceGalleryImageStatus{ - // DownloadStatus: &armazurestackhci.MarketplaceGalleryImageStatusDownloadStatus{ - // DownloadSizeInMB: to.Ptr[int64](9383), - // }, - // ProgressPercentage: to.Ptr[int64](100), - // ProvisioningStatus: &armazurestackhci.MarketplaceGalleryImageStatusProvisioningStatus{ - // OperationID: to.Ptr("79cfc696-44f5-4a68-a620-21850f7e9fb0"), - // Status: to.Ptr(armazurestackhci.StatusSucceeded), - // }, - // }, - // Version: &armazurestackhci.GalleryImageVersion{ - // Name: to.Ptr("1.0.0"), - // Properties: &armazurestackhci.GalleryImageVersionProperties{ - // StorageProfile: &armazurestackhci.GalleryImageVersionStorageProfile{ - // OSDiskImage: &armazurestackhci.GalleryOSDiskImage{ - // SizeInMB: to.Ptr[int64](30270), - // }, - // }, - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/networkinterfaces_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/networkinterfaces_client_example_test.go deleted file mode 100644 index e22143d50040..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/networkinterfaces_client_example_test.go +++ /dev/null @@ -1,295 +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 armazurestackhci_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/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetNetworkInterface.json -func ExampleNetworkInterfacesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkInterfacesClient().Get(ctx, "test-rg", "test-nic", 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.NetworkInterfaces = armazurestackhci.NetworkInterfaces{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.AzureStackHCI/networkInterfaces"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.NetworkInterfaceProperties{ - // IPConfigurations: []*armazurestackhci.IPConfiguration{ - // { - // Name: to.Ptr("ipconfig-sample"), - // Properties: &armazurestackhci.IPConfigurationProperties{ - // Subnet: &armazurestackhci.IPConfigurationPropertiesSubnet{ - // ID: to.Ptr("external"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutNetworkInterface.json -func ExampleNetworkInterfacesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginCreateOrUpdate(ctx, "test-rg", "test-nic", armazurestackhci.NetworkInterfaces{ - Location: to.Ptr("West US2"), - ExtendedLocation: &armazurestackhci.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - }, - Properties: &armazurestackhci.NetworkInterfaceProperties{ - IPConfigurations: []*armazurestackhci.IPConfiguration{ - { - Name: to.Ptr("ipconfig-sample"), - Properties: &armazurestackhci.IPConfigurationProperties{ - Subnet: &armazurestackhci.IPConfigurationPropertiesSubnet{ - ID: to.Ptr("test-lnet"), - }, - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkInterfaces = armazurestackhci.NetworkInterfaces{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.AzureStackHCI/networkInterfaces"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.NetworkInterfaceProperties{ - // IPConfigurations: []*armazurestackhci.IPConfiguration{ - // { - // Name: to.Ptr("ipconfig-sample"), - // Properties: &armazurestackhci.IPConfigurationProperties{ - // Subnet: &armazurestackhci.IPConfigurationPropertiesSubnet{ - // ID: to.Ptr("test-lnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteNetworkInterface.json -func ExampleNetworkInterfacesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginDelete(ctx, "test-rg", "test-nic", 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateNetworkInterface.json -func ExampleNetworkInterfacesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkInterfacesClient().BeginUpdate(ctx, "test-rg", "test-nic", armazurestackhci.NetworkInterfacesUpdateRequest{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("sample"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkInterfaces = armazurestackhci.NetworkInterfaces{ - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.AzureStackHCI/networkInterfaces"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.NetworkInterfaceProperties{ - // IPConfigurations: []*armazurestackhci.IPConfiguration{ - // { - // Name: to.Ptr("ipconfig-sample"), - // Properties: &armazurestackhci.IPConfigurationProperties{ - // Subnet: &armazurestackhci.IPConfigurationPropertiesSubnet{ - // ID: to.Ptr("test-lnet"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListNetworkInterfaceByResourceGroup.json -func ExampleNetworkInterfacesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkInterfacesClient().NewListPager("test-rg", 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.NetworkInterfacesListResult = armazurestackhci.NetworkInterfacesListResult{ - // Value: []*armazurestackhci.NetworkInterfaces{ - // { - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.AzureStackHCI/networkInterfaces"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.NetworkInterfaceProperties{ - // IPConfigurations: []*armazurestackhci.IPConfiguration{ - // { - // Name: to.Ptr("ipconfig-sample"), - // Properties: &armazurestackhci.IPConfigurationProperties{ - // Subnet: &armazurestackhci.IPConfigurationPropertiesSubnet{ - // ID: to.Ptr("external"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListNetworkInterfaceBySubscription.json -func ExampleNetworkInterfacesClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkInterfacesClient().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.NetworkInterfacesListResult = armazurestackhci.NetworkInterfacesListResult{ - // Value: []*armazurestackhci.NetworkInterfaces{ - // { - // Name: to.Ptr("test-nic"), - // Type: to.Ptr("Microsoft.AzureStackHCI/networkInterfaces"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/networkInterfaces/test-nic"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.NetworkInterfaceProperties{ - // IPConfigurations: []*armazurestackhci.IPConfiguration{ - // { - // Name: to.Ptr("ipconfig-sample"), - // Properties: &armazurestackhci.IPConfigurationProperties{ - // Subnet: &armazurestackhci.IPConfigurationPropertiesSubnet{ - // ID: to.Ptr("external"), - // }, - // }, - // }}, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_client_example_test.go deleted file mode 100644 index a29fb22b8856..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/operations_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 armazurestackhci_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.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 = armazurestackhci.OperationListResult{ - // Value: []*armazurestackhci.Operation{ - // { - // Name: to.Ptr("Microsoft.AzureStackHCI/galleryImages/read"), - // Display: &armazurestackhci.OperationDisplay{ - // Description: to.Ptr("List or get the Addresses"), - // Operation: to.Ptr("List or Get Addresses"), - // Provider: to.Ptr("Azure Stack HCI"), - // Resource: to.Ptr("GalleryImages"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr(armazurestackhci.OriginUser), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/storagecontainers_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/storagecontainers_client_example_test.go deleted file mode 100644 index 7337c9072a8a..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/storagecontainers_client_example_test.go +++ /dev/null @@ -1,250 +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 armazurestackhci_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/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetStorageContainer.json -func ExampleStorageContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewStorageContainersClient().Get(ctx, "test-rg", "Default_Container", 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.StorageContainers = armazurestackhci.StorageContainers{ - // Name: to.Ptr("Default_Container"), - // Type: to.Ptr("Microsoft.AzureStackHCI/storageContainers"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/Default_Container"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.StorageContainerProperties{ - // Path: to.Ptr("C:\\container_storage"), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutStorageContainer.json -func ExampleStorageContainersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageContainersClient().BeginCreateOrUpdate(ctx, "test-rg", "Default_Container", armazurestackhci.StorageContainers{ - Location: to.Ptr("West US2"), - ExtendedLocation: &armazurestackhci.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - }, - Properties: &armazurestackhci.StorageContainerProperties{ - Path: to.Ptr("C:\\container_storage"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageContainers = armazurestackhci.StorageContainers{ - // Name: to.Ptr("Default_Container"), - // Type: to.Ptr("Microsoft.AzureStackHCI/storageContainers"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-galimg3325"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.StorageContainerProperties{ - // Path: to.Ptr("C:\\container_storage"), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteStorageContainer.json -func ExampleStorageContainersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageContainersClient().BeginDelete(ctx, "test-rg", "Default_Container", 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateStorageContainer.json -func ExampleStorageContainersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewStorageContainersClient().BeginUpdate(ctx, "test-rg", "Default_Container", armazurestackhci.StorageContainersUpdateRequest{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("sample"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.StorageContainers = armazurestackhci.StorageContainers{ - // Name: to.Ptr("Default_Container"), - // Type: to.Ptr("Microsoft.AzureStackHCI/storageContainers"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-galimg3325"), - // Location: to.Ptr("West US2"), - // Tags: map[string]*string{ - // "additionalProperties": to.Ptr("sample"), - // }, - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.StorageContainerProperties{ - // Path: to.Ptr("C:\\container_storage"), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListStorageContainerByResourceGroup.json -func ExampleStorageContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStorageContainersClient().NewListPager("test-rg", 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.StorageContainersListResult = armazurestackhci.StorageContainersListResult{ - // Value: []*armazurestackhci.StorageContainers{ - // { - // Name: to.Ptr("Default_Container"), - // Type: to.Ptr("Microsoft.AzureStackHCI/storageContainers"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/Default_Container"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.StorageContainerProperties{ - // Path: to.Ptr("C:\\container_storage"), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListStorageContainerBySubscription.json -func ExampleStorageContainersClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewStorageContainersClient().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.StorageContainersListResult = armazurestackhci.StorageContainersListResult{ - // Value: []*armazurestackhci.StorageContainers{ - // { - // Name: to.Ptr("Default_Container"), - // Type: to.Ptr("Microsoft.AzureStackHCI/storageContainers"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/Default_Container"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.StorageContainerProperties{ - // Path: to.Ptr("C:\\container_storage"), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/virtualharddisks_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/virtualharddisks_client_example_test.go deleted file mode 100644 index b748f67a2209..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/virtualharddisks_client_example_test.go +++ /dev/null @@ -1,280 +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 armazurestackhci_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/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetVirtualHardDisk.json -func ExampleVirtualHardDisksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualHardDisksClient().Get(ctx, "test-rg", "test-vhd", 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.VirtualHardDisks = armazurestackhci.VirtualHardDisks{ - // Name: to.Ptr("test-vhd"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualHardDisks"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualHardDiskProperties{ - // BlockSizeBytes: to.Ptr[int32](0), - // DiskFileFormat: to.Ptr(armazurestackhci.DiskFileFormatVhdx), - // DiskSizeGB: to.Ptr[int64](32), - // Dynamic: to.Ptr(true), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV2), - // LogicalSectorBytes: to.Ptr[int32](512), - // PhysicalSectorBytes: to.Ptr[int32](512), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualHardDisk.json -func ExampleVirtualHardDisksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHardDisksClient().BeginCreateOrUpdate(ctx, "test-rg", "test-vhd", armazurestackhci.VirtualHardDisks{ - Location: to.Ptr("West US2"), - ExtendedLocation: &armazurestackhci.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - }, - Properties: &armazurestackhci.VirtualHardDiskProperties{ - DiskSizeGB: to.Ptr[int64](32), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHardDisks = armazurestackhci.VirtualHardDisks{ - // Name: to.Ptr("test-vhd"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualHardDisks"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualHardDiskProperties{ - // BlockSizeBytes: to.Ptr[int32](0), - // DiskFileFormat: to.Ptr(armazurestackhci.DiskFileFormatVhdx), - // DiskSizeGB: to.Ptr[int64](32), - // Dynamic: to.Ptr(true), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV2), - // LogicalSectorBytes: to.Ptr[int32](512), - // PhysicalSectorBytes: to.Ptr[int32](512), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteVirtualHardDisk.json -func ExampleVirtualHardDisksClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHardDisksClient().BeginDelete(ctx, "test-rg", "test-vhd", 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateVirtualHardDisk.json -func ExampleVirtualHardDisksClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualHardDisksClient().BeginUpdate(ctx, "test-rg", "test-vhd", armazurestackhci.VirtualHardDisksUpdateRequest{ - Tags: map[string]*string{ - "additionalProperties": to.Ptr("sample"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualHardDisks = armazurestackhci.VirtualHardDisks{ - // Name: to.Ptr("test-vhd"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualHardDisks"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd"), - // Location: to.Ptr("West US2"), - // Tags: map[string]*string{ - // "additionalProperties": to.Ptr("sample"), - // }, - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualHardDiskProperties{ - // BlockSizeBytes: to.Ptr[int32](0), - // DiskFileFormat: to.Ptr(armazurestackhci.DiskFileFormatVhdx), - // DiskSizeGB: to.Ptr[int64](32), - // Dynamic: to.Ptr(true), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV2), - // LogicalSectorBytes: to.Ptr[int32](512), - // PhysicalSectorBytes: to.Ptr[int32](512), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListVirtualHardDiskByResourceGroup.json -func ExampleVirtualHardDisksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHardDisksClient().NewListPager("test-rg", 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.VirtualHardDisksListResult = armazurestackhci.VirtualHardDisksListResult{ - // Value: []*armazurestackhci.VirtualHardDisks{ - // { - // Name: to.Ptr("test-vhd"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualHardDisks"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualHardDiskProperties{ - // BlockSizeBytes: to.Ptr[int32](0), - // DiskFileFormat: to.Ptr(armazurestackhci.DiskFileFormatVhdx), - // DiskSizeGB: to.Ptr[int64](32), - // Dynamic: to.Ptr(true), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV2), - // LogicalSectorBytes: to.Ptr[int32](512), - // PhysicalSectorBytes: to.Ptr[int32](512), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListVirtualHardDiskBySubscription.json -func ExampleVirtualHardDisksClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualHardDisksClient().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.VirtualHardDisksListResult = armazurestackhci.VirtualHardDisksListResult{ - // Value: []*armazurestackhci.VirtualHardDisks{ - // { - // Name: to.Ptr("test-vhd"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualHardDisks"), - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd"), - // Location: to.Ptr("West US2"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualHardDiskProperties{ - // BlockSizeBytes: to.Ptr[int32](0), - // DiskFileFormat: to.Ptr(armazurestackhci.DiskFileFormatVhdx), - // DiskSizeGB: to.Ptr[int64](32), - // Dynamic: to.Ptr(true), - // HyperVGeneration: to.Ptr(armazurestackhci.HyperVGenerationV2), - // LogicalSectorBytes: to.Ptr[int32](512), - // PhysicalSectorBytes: to.Ptr[int32](512), - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/azurestackhci/armazurestackhci/virtualmachineinstances_client_example_test.go b/sdk/resourcemanager/azurestackhci/armazurestackhci/virtualmachineinstances_client_example_test.go deleted file mode 100644 index 64d2766e4358..000000000000 --- a/sdk/resourcemanager/azurestackhci/armazurestackhci/virtualmachineinstances_client_example_test.go +++ /dev/null @@ -1,769 +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 armazurestackhci_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/azurestackhci/armazurestackhci/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/GetVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineInstancesClient().Get(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", 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.VirtualMachineInstance = armazurestackhci.VirtualMachineInstance{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualMachineInstances"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - // HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - // VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - // }, - // NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - // NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - // { - // ID: to.Ptr("test-nic"), - // }}, - // }, - // OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - // AdminUsername: to.Ptr("localadmin"), - // ComputerName: to.Ptr("luamaster"), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - // ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // }, - // VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithGalleryImage.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate_putVirtualMachineInstanceWithGalleryImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", armazurestackhci.VirtualMachineInstance{ - ExtendedLocation: &armazurestackhci.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - }, - Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - }, - NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - { - ID: to.Ptr("test-nic"), - }}, - }, - OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - AdminPassword: to.Ptr("password"), - AdminUsername: to.Ptr("localadmin"), - ComputerName: to.Ptr("luamaster"), - }, - SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - EnableTPM: to.Ptr(true), - UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - SecureBootEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - }, - VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armazurestackhci.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - // HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - // VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - // }, - // NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - // NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - // { - // ID: to.Ptr("test-nic"), - // }}, - // }, - // OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - // AdminUsername: to.Ptr("localadmin"), - // ComputerName: to.Ptr("luamaster"), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - // EnableTPM: to.Ptr(true), - // UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - // ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // }, - // VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithMarketplaceGalleryImage.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate_putVirtualMachineInstanceWithMarketplaceGalleryImage() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", armazurestackhci.VirtualMachineInstance{ - ExtendedLocation: &armazurestackhci.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - }, - Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - }, - NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - { - ID: to.Ptr("test-nic"), - }}, - }, - OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - AdminPassword: to.Ptr("password"), - AdminUsername: to.Ptr("localadmin"), - ComputerName: to.Ptr("luamaster"), - }, - SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - EnableTPM: to.Ptr(true), - UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - SecureBootEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image"), - }, - VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armazurestackhci.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - // HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - // VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - // }, - // NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - // NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - // { - // ID: to.Ptr("test-nic"), - // }}, - // }, - // OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - // AdminUsername: to.Ptr("localadmin"), - // ComputerName: to.Ptr("luamaster"), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - // EnableTPM: to.Ptr(true), - // UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - // ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/test-marketplace-gallery-image"), - // }, - // VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithOsDisk.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate_putVirtualMachineInstanceWithOsDisk() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", armazurestackhci.VirtualMachineInstance{ - ExtendedLocation: &armazurestackhci.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - }, - Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - }, - NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - { - ID: to.Ptr("test-nic"), - }}, - }, - SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - EnableTPM: to.Ptr(true), - UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - SecureBootEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - OSDisk: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileOsDisk{ - ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd"), - }, - VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armazurestackhci.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - // HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - // VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - // }, - // NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - // NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - // { - // ID: to.Ptr("test-nic"), - // }}, - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - // EnableTPM: to.Ptr(true), - // UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - // OSDisk: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileOsDisk{ - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd"), - // }, - // VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/PutVirtualMachineInstanceWithVMConfigAgent.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate_putVirtualMachineInstanceWithVmConfigAgent() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", armazurestackhci.VirtualMachineInstance{ - ExtendedLocation: &armazurestackhci.ExtendedLocation{ - Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - }, - Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - }, - NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - { - ID: to.Ptr("test-nic"), - }}, - }, - OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - AdminPassword: to.Ptr("password"), - AdminUsername: to.Ptr("localadmin"), - ComputerName: to.Ptr("luamaster"), - WindowsConfiguration: &armazurestackhci.VirtualMachineInstancePropertiesOsProfileWindowsConfiguration{ - ProvisionVMConfigAgent: to.Ptr(true), - }, - }, - SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - EnableTPM: to.Ptr(true), - UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - SecureBootEnabled: to.Ptr(true), - }, - }, - StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - }, - VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armazurestackhci.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - // HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - // VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - // }, - // InstanceView: &armazurestackhci.VirtualMachineInstanceView{ - // VMAgent: &armazurestackhci.VirtualMachineConfigAgentInstanceView{ - // Statuses: []*armazurestackhci.InstanceViewStatus{ - // { - // Code: to.Ptr("Ok"), - // DisplayStatus: to.Ptr("Ok"), - // Level: to.Ptr(armazurestackhci.StatusLevelTypesInfo), - // Message: to.Ptr("The agent is healthy"), - // Time: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2009-06-15T13:45:30"); return t}()), - // }}, - // VMConfigAgentVersion: to.Ptr("1.0.0"), - // }, - // }, - // NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - // NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - // { - // ID: to.Ptr("test-nic"), - // }}, - // }, - // OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - // AdminUsername: to.Ptr("localadmin"), - // ComputerName: to.Ptr("luamaster"), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - // EnableTPM: to.Ptr(true), - // UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - // ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // }, - // VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/DeleteVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDelete(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", 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/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/UpdateVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginUpdate(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", armazurestackhci.VirtualMachineInstanceUpdateRequest{ - Properties: &armazurestackhci.VirtualMachineInstanceUpdateProperties{ - StorageProfile: &armazurestackhci.StorageProfileUpdate{ - DataDisks: []*armazurestackhci.StorageProfileUpdateDataDisksItem{ - { - ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-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.VirtualMachineInstance = armazurestackhci.VirtualMachineInstance{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualMachineInstances"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - // HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - // VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - // }, - // NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - // NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - // { - // ID: to.Ptr("test-nic"), - // }}, - // }, - // OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - // AdminUsername: to.Ptr("localadmin"), - // ComputerName: to.Ptr("luamaster"), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - // DataDisks: []*armazurestackhci.VirtualMachineInstancePropertiesStorageProfileDataDisksItem{ - // { - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/virtualHardDisks/test-vhd"), - // }}, - // ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/StartVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStart(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armazurestackhci.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - // HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - // VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - // }, - // NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - // NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - // { - // ID: to.Ptr("test-nic"), - // }}, - // }, - // OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - // AdminUsername: to.Ptr("localadmin"), - // ComputerName: to.Ptr("luamaster"), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - // EnableTPM: to.Ptr(true), - // UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - // ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // }, - // VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/StopVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStop(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armazurestackhci.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - // HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - // VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - // }, - // NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - // NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - // { - // ID: to.Ptr("test-nic"), - // }}, - // }, - // OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - // AdminUsername: to.Ptr("localadmin"), - // ComputerName: to.Ptr("luamaster"), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - // EnableTPM: to.Ptr(true), - // UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - // ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // }, - // VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/RestartVirtualMachineInstance.json -func ExampleVirtualMachineInstancesClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestart(ctx, "subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineInstance = armazurestackhci.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - // HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - // VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - // }, - // NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - // NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - // { - // ID: to.Ptr("test-nic"), - // }}, - // }, - // OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - // AdminUsername: to.Ptr("localadmin"), - // ComputerName: to.Ptr("luamaster"), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // SecurityProfile: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfile{ - // EnableTPM: to.Ptr(true), - // UefiSettings: &armazurestackhci.VirtualMachineInstancePropertiesSecurityProfileUefiSettings{ - // SecureBootEnabled: to.Ptr(true), - // }, - // }, - // StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - // ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // }, - // VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ec0fcc278aa2128c4fbb2b8a1aa93432d72cce0/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/preview/2023-09-01-preview/examples/ListVirtualMachineInstances.json -func ExampleVirtualMachineInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armazurestackhci.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineInstancesClient().NewListPager("subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM", 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.VirtualMachineInstanceListResult = armazurestackhci.VirtualMachineInstanceListResult{ - // Value: []*armazurestackhci.VirtualMachineInstance{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.AzureStackHCI/virtualMachineInstances"), - // ID: to.Ptr("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/Microsoft.HybridCompute/machines/DemoVM/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default"), - // ExtendedLocation: &armazurestackhci.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"), - // Type: to.Ptr(armazurestackhci.ExtendedLocationTypesCustomLocation), - // }, - // Properties: &armazurestackhci.VirtualMachineInstanceProperties{ - // HardwareProfile: &armazurestackhci.VirtualMachineInstancePropertiesHardwareProfile{ - // VMSize: to.Ptr(armazurestackhci.VMSizeEnumDefault), - // }, - // NetworkProfile: &armazurestackhci.VirtualMachineInstancePropertiesNetworkProfile{ - // NetworkInterfaces: []*armazurestackhci.VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesItem{ - // { - // ID: to.Ptr("test-nic"), - // }}, - // }, - // OSProfile: &armazurestackhci.VirtualMachineInstancePropertiesOsProfile{ - // AdminUsername: to.Ptr("localadmin"), - // ComputerName: to.Ptr("luamaster"), - // }, - // ProvisioningState: to.Ptr(armazurestackhci.ProvisioningStateEnumSucceeded), - // StorageProfile: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfile{ - // ImageReference: &armazurestackhci.VirtualMachineInstancePropertiesStorageProfileImageReference{ - // ID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/galleryImages/test-gallery-image"), - // }, - // VMConfigStoragePathID: to.Ptr("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-container"), - // }, - // }, - // }}, - // } - } -}