diff --git a/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md b/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md index 4b4702a05b07..bd8551c29570 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md +++ b/sdk/resourcemanager/scvmm/armscvmm/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 2.0.0 (2024-10-30) +### Breaking Changes + +- Function `*VirtualMachineInstancesClient.BeginStop` parameter(s) have been changed from `(context.Context, string, StopVirtualMachineOptions, *VirtualMachineInstancesClientBeginStopOptions)` to `(context.Context, string, *VirtualMachineInstancesClientBeginStopOptions)` + +### Features Added + +- New field `PrivateLinkScopeResourceID` in struct `GuestAgentProperties` +- New field `DomainName`, `DomainPassword`, `DomainUsername`, `ProductKey`, `RunOnceCommands`, `Timezone`, `Workgroup` in struct `OsProfileForVMInstance` +- New field `Body` in struct `VirtualMachineInstancesClientBeginStopOptions` + + ## 1.0.0 (2024-06-28) ### Breaking Changes diff --git a/sdk/resourcemanager/scvmm/armscvmm/README.md b/sdk/resourcemanager/scvmm/armscvmm/README.md index 8de88d0e8735..97f556c19ae9 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/README.md +++ b/sdk/resourcemanager/scvmm/armscvmm/README.md @@ -1,6 +1,6 @@ # Azure Scvmm Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2) The `armscvmm` module provides operations for working with Azure Scvmm. @@ -20,7 +20,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Scvmm module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2 ``` ## Authorization diff --git a/sdk/resourcemanager/scvmm/armscvmm/autorest.md b/sdk/resourcemanager/scvmm/armscvmm/autorest.md index be912d6e1c0c..60d923df049d 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/autorest.md +++ b/sdk/resourcemanager/scvmm/armscvmm/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/scvmm/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/scvmm/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 -tag: package-2023-10 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go b/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go index cea845178f08..b593e3a91dcd 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client.go @@ -46,7 +46,7 @@ func NewAvailabilitySetsClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Onboards the ScVmm availability set as an Azure resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *AvailabilitySetsClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Onboards the ScVmm availability set as an Azure resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *AvailabilitySetsClient) createOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, resource AvailabilitySet, options *AvailabilitySetsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AvailabilitySetsClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *AvailabilitySetsClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deregisters the ScVmm availability set from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - options - AvailabilitySetsClientBeginDeleteOptions contains the optional parameters for the AvailabilitySetsClient.BeginDelete @@ -153,7 +153,7 @@ func (client *AvailabilitySetsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deregisters the ScVmm availability set from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *AvailabilitySetsClient) deleteOperation(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, options *AvailabilitySetsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AvailabilitySetsClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -207,7 +207,7 @@ func (client *AvailabilitySetsClient) deleteCreateRequest(ctx context.Context, r // Get - Implements AvailabilitySet GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - options - AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. @@ -253,7 +253,7 @@ func (client *AvailabilitySetsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *AvailabilitySetsClient) getHandleResponse(resp *http.Response) (Av // NewListByResourceGroupPager - List of AvailabilitySets in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - AvailabilitySetsClientListByResourceGroupOptions contains the optional parameters for the AvailabilitySetsClient.NewListByResourceGroupPager // method. @@ -313,7 +313,7 @@ func (client *AvailabilitySetsClient) listByResourceGroupCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *AvailabilitySetsClient) listByResourceGroupHandleResponse(resp *ht // NewListBySubscriptionPager - List of AvailabilitySets in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager // method. func (client *AvailabilitySetsClient) NewListBySubscriptionPager(options *AvailabilitySetsClientListBySubscriptionOptions) *runtime.Pager[AvailabilitySetsClientListBySubscriptionResponse] { @@ -368,7 +368,7 @@ func (client *AvailabilitySetsClient) listBySubscriptionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +386,7 @@ func (client *AvailabilitySetsClient) listBySubscriptionHandleResponse(resp *htt // BeginUpdate - Updates the AvailabilitySets resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - availabilitySetResourceName - Name of the AvailabilitySet. // - properties - The resource properties to be updated. @@ -413,7 +413,7 @@ func (client *AvailabilitySetsClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates the AvailabilitySets resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *AvailabilitySetsClient) update(ctx context.Context, resourceGroupName string, availabilitySetResourceName string, properties AvailabilitySetTagsUpdate, options *AvailabilitySetsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AvailabilitySetsClient.BeginUpdate" @@ -455,7 +455,7 @@ func (client *AvailabilitySetsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client_example_test.go deleted file mode 100644 index de9ef8437cfa..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/availabilitysets_client_example_test.go +++ /dev/null @@ -1,488 +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 armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListBySubscriptionPager_availabilitySetsListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListBySubscription_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListBySubscriptionPager_availabilitySetsListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListByResourceGroupPager_availabilitySetsListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_ListByResourceGroup_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_NewListByResourceGroupPager_availabilitySetsListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAvailabilitySetsClient().NewListByResourceGroupPager("rgscvmm", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AvailabilitySetListResult = armscvmm.AvailabilitySetListResult{ - // Value: []*armscvmm.AvailabilitySet{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_Get_availabilitySetsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "rgscvmm", "-", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Get_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_Get_availabilitySetsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAvailabilitySetsClient().Get(ctx, "rgscvmm", "V", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginCreateOrUpdate_availabilitySetsCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.AvailabilitySet{ - Location: to.Ptr("jelevilan"), - Tags: map[string]*string{ - "key5701": to.Ptr("cldtxloqh"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.AvailabilitySetProperties{ - AvailabilitySetName: to.Ptr("njrpftunzo"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_CreateOrUpdate_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginCreateOrUpdate_availabilitySetsCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "_", armscvmm.AvailabilitySet{ - Location: to.Ptr("jelevilan"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginUpdate_availabilitySetsUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginUpdate(ctx, "rgscvmm", "-", armscvmm.AvailabilitySetTagsUpdate{ - Tags: map[string]*string{ - "key1460": to.Ptr("vcbwibkvr"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // Name: to.Ptr("dibfuxyuidzxcfik"), - // Type: to.Ptr("xwzjruksexpuqgtreexm"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("jelevilan"), - // Tags: map[string]*string{ - // "key5701": to.Ptr("cldtxloqh"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.AvailabilitySetProperties{ - // AvailabilitySetName: to.Ptr("njrpftunzo"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Update_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginUpdate_availabilitySetsUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginUpdate(ctx, "rgscvmm", "1", armscvmm.AvailabilitySetTagsUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AvailabilitySet = armscvmm.AvailabilitySet{ - // Location: to.Ptr("jelevilan"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MaximumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginDelete_availabilitySetsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginDelete(ctx, "rgscvmm", "_", &armscvmm.AvailabilitySetsClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/AvailabilitySets_Delete_MinimumSet_Gen.json -func ExampleAvailabilitySetsClient_BeginDelete_availabilitySetsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAvailabilitySetsClient().BeginDelete(ctx, "rgscvmm", "6", &armscvmm.AvailabilitySetsClientBeginDeleteOptions{Force: 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/scvmm/armscvmm/clouds_client.go b/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go index defd671ed809..5f2de325e9bd 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/clouds_client.go @@ -46,7 +46,7 @@ func NewCloudsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Onboards the ScVmm fabric cloud as an Azure cloud resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *CloudsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Onboards the ScVmm fabric cloud as an Azure cloud resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *CloudsClient) createOrUpdate(ctx context.Context, resourceGroupName string, cloudResourceName string, resource Cloud, options *CloudsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudsClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *CloudsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *CloudsClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Deregisters the ScVmm fabric cloud from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - options - CloudsClientBeginDeleteOptions contains the optional parameters for the CloudsClient.BeginDelete method. @@ -152,7 +152,7 @@ func (client *CloudsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Deregisters the ScVmm fabric cloud from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *CloudsClient) deleteOperation(ctx context.Context, resourceGroupName string, cloudResourceName string, options *CloudsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "CloudsClient.BeginDelete" @@ -194,7 +194,7 @@ func (client *CloudsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -206,7 +206,7 @@ func (client *CloudsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Implements Cloud GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - options - CloudsClientGetOptions contains the optional parameters for the CloudsClient.Get method. @@ -252,7 +252,7 @@ func (client *CloudsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *CloudsClient) getHandleResponse(resp *http.Response) (CloudsClient // NewListByResourceGroupPager - List of Clouds in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - CloudsClientListByResourceGroupOptions contains the optional parameters for the CloudsClient.NewListByResourceGroupPager // method. @@ -312,7 +312,7 @@ func (client *CloudsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *CloudsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - List of Clouds in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - CloudsClientListBySubscriptionOptions contains the optional parameters for the CloudsClient.NewListBySubscriptionPager // method. func (client *CloudsClient) NewListBySubscriptionPager(options *CloudsClientListBySubscriptionOptions) *runtime.Pager[CloudsClientListBySubscriptionResponse] { @@ -367,7 +367,7 @@ func (client *CloudsClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,7 @@ func (client *CloudsClient) listBySubscriptionHandleResponse(resp *http.Response // BeginUpdate - Updates the Clouds resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - cloudResourceName - Name of the Cloud. // - properties - The resource properties to be updated. @@ -411,7 +411,7 @@ func (client *CloudsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Updates the Clouds resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *CloudsClient) update(ctx context.Context, resourceGroupName string, cloudResourceName string, properties CloudTagsUpdate, options *CloudsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "CloudsClient.BeginUpdate" @@ -453,7 +453,7 @@ func (client *CloudsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/clouds_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/clouds_client_example_test.go deleted file mode 100644 index 13b1ecee71db..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/clouds_client_example_test.go +++ /dev/null @@ -1,570 +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 armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MaximumSet_Gen.json -func ExampleCloudsClient_NewListBySubscriptionPager_cloudsListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListBySubscription_MinimumSet_Gen.json -func ExampleCloudsClient_NewListBySubscriptionPager_cloudsListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MaximumSet_Gen.json -func ExampleCloudsClient_NewListByResourceGroupPager_cloudsListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListByResourceGroupPager("rgscvmm", 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.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_ListByResourceGroup_MinimumSet_Gen.json -func ExampleCloudsClient_NewListByResourceGroupPager_cloudsListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCloudsClient().NewListByResourceGroupPager("rgscvmm", 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.CloudListResult = armscvmm.CloudListResult{ - // Value: []*armscvmm.Cloud{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MaximumSet_Gen.json -func ExampleCloudsClient_Get_cloudsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudsClient().Get(ctx, "rgscvmm", "_", 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.Cloud = armscvmm.Cloud{ - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Get_MinimumSet_Gen.json -func ExampleCloudsClient_Get_cloudsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCloudsClient().Get(ctx, "rgscvmm", "i", 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.Cloud = armscvmm.Cloud{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MaximumSet_Gen.json -func ExampleCloudsClient_BeginCreateOrUpdate_cloudsCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "2", armscvmm.Cloud{ - Location: to.Ptr("khwsdmaxfhmbu"), - Tags: map[string]*string{ - "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.CloudProperties{ - CloudCapacity: &armscvmm.CloudCapacity{}, - InventoryItemID: to.Ptr("qjd"), - UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cloud = armscvmm.Cloud{ - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_CreateOrUpdate_MinimumSet_Gen.json -func ExampleCloudsClient_BeginCreateOrUpdate_cloudsCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.Cloud{ - Location: to.Ptr("khwsdmaxfhmbu"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cloud = armscvmm.Cloud{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MaximumSet_Gen.json -func ExampleCloudsClient_BeginUpdate_cloudsUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginUpdate(ctx, "rgscvmm", "P", armscvmm.CloudTagsUpdate{ - Tags: map[string]*string{ - "key5266": to.Ptr("hjpcnwmpnixsolrxnbl"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cloud = armscvmm.Cloud{ - // Name: to.Ptr("wwcwalpiufsfbnydxpr"), - // Type: to.Ptr("qnaaimszbuokldohwrdfuiitpy"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("khwsdmaxfhmbu"), - // Tags: map[string]*string{ - // "key4295": to.Ptr("wngosgcbdifaxdobufuuqxtho"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.CloudProperties{ - // CloudCapacity: &armscvmm.CloudCapacity{ - // CPUCount: to.Ptr[int64](4), - // MemoryMB: to.Ptr[int64](19), - // VMCount: to.Ptr[int64](28), - // }, - // CloudName: to.Ptr("menarjsplhcqvnkjdwieroir"), - // InventoryItemID: to.Ptr("qjd"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageQosPolicies: []*armscvmm.StorageQosPolicy{ - // { - // Name: to.Ptr("hvqcentnbwcunxhzfavyewhwlo"), - // BandwidthLimit: to.Ptr[int64](26), - // ID: to.Ptr("oclhgkydaw"), - // IopsMaximum: to.Ptr[int64](6), - // IopsMinimum: to.Ptr[int64](25), - // PolicyID: to.Ptr("lvcylbmxrqjgarvhfny"), - // }}, - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Update_MinimumSet_Gen.json -func ExampleCloudsClient_BeginUpdate_cloudsUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginUpdate(ctx, "rgscvmm", "_", armscvmm.CloudTagsUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cloud = armscvmm.Cloud{ - // Location: to.Ptr("khwsdmaxfhmbu"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MaximumSet_Gen.json -func ExampleCloudsClient_BeginDelete_cloudsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginDelete(ctx, "rgscvmm", "-", &armscvmm.CloudsClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Clouds_Delete_MinimumSet_Gen.json -func ExampleCloudsClient_BeginDelete_cloudsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewCloudsClient().BeginDelete(ctx, "rgscvmm", "1", &armscvmm.CloudsClientBeginDeleteOptions{Force: 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/scvmm/armscvmm/constants.go b/sdk/resourcemanager/scvmm/armscvmm/constants.go index 7c68e179fa2f..cb75ae9b4a1b 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/constants.go +++ b/sdk/resourcemanager/scvmm/armscvmm/constants.go @@ -10,7 +10,7 @@ package armscvmm const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/availabilitysets_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/availabilitysets_server.go index a3357a05ca99..15e4feaa720b 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/availabilitysets_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/availabilitysets_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/clouds_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/clouds_server.go index e5bb28aaa5d6..f119d6a50fd4 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/clouds_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/clouds_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/guestagents_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/guestagents_server.go index 1d9302b83e5b..a794c84aa41d 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/guestagents_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/guestagents_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/inventoryitems_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/inventoryitems_server.go index f8df37d81ce9..94261a00f982 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/inventoryitems_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/inventoryitems_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/operations_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/operations_server.go index 477592a51cf1..55d8dcfc184f 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/operations_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/operations_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" ) diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachineinstances_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachineinstances_server.go index eabd181b08ba..e2d3b71217ee 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachineinstances_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachineinstances_server.go @@ -16,9 +16,10 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" + "reflect" "regexp" ) @@ -62,7 +63,7 @@ type VirtualMachineInstancesServer struct { // BeginStop is the fake for method VirtualMachineInstancesClient.BeginStop // HTTP status codes to indicate success: http.StatusAccepted - BeginStop func(ctx context.Context, resourceURI string, body armscvmm.StopVirtualMachineOptions, options *armscvmm.VirtualMachineInstancesClientBeginStopOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientStopResponse], errResp azfake.ErrorResponder) + BeginStop func(ctx context.Context, resourceURI string, options *armscvmm.VirtualMachineInstancesClientBeginStopOptions) (resp azfake.PollerResponder[armscvmm.VirtualMachineInstancesClientStopResponse], errResp azfake.ErrorResponder) // BeginUpdate is the fake for method VirtualMachineInstancesClient.BeginUpdate // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted @@ -549,7 +550,13 @@ func (v *VirtualMachineInstancesServerTransport) dispatchBeginStop(req *http.Req if err != nil { return nil, err } - respr, errRespr := v.srv.BeginStop(req.Context(), resourceURIParam, body, nil) + var options *armscvmm.VirtualMachineInstancesClientBeginStopOptions + if !reflect.ValueOf(body).IsZero() { + options = &armscvmm.VirtualMachineInstancesClientBeginStopOptions{ + Body: &body, + } + } + respr, errRespr := v.srv.BeginStop(req.Context(), resourceURIParam, options) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachinetemplates_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachinetemplates_server.go index 9a4308e8cbc8..1bc9edc5c091 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachinetemplates_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualmachinetemplates_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualnetworks_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualnetworks_server.go index 33c8a6cb93c1..42697969c183 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/virtualnetworks_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/virtualnetworks_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/vminstancehybrididentitymetadatas_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/vminstancehybrididentitymetadatas_server.go index 5b8d55a3702d..b2104eff934b 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/vminstancehybrididentitymetadatas_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/vminstancehybrididentitymetadatas_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/scvmm/armscvmm/fake/vmmservers_server.go b/sdk/resourcemanager/scvmm/armscvmm/fake/vmmservers_server.go index 1f21f887f115..c54d0e4b4f5d 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/fake/vmmservers_server.go +++ b/sdk/resourcemanager/scvmm/armscvmm/fake/vmmservers_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/scvmm/armscvmm/go.mod b/sdk/resourcemanager/scvmm/armscvmm/go.mod index bd204cd34872..fc366c184d4b 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/go.mod +++ b/sdk/resourcemanager/scvmm/armscvmm/go.mod @@ -1,21 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect ) diff --git a/sdk/resourcemanager/scvmm/armscvmm/go.sum b/sdk/resourcemanager/scvmm/armscvmm/go.sum index 09d275cb9a37..917448a001b7 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/go.sum +++ b/sdk/resourcemanager/scvmm/armscvmm/go.sum @@ -1,29 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= -golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go b/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go index abaabf3a1784..a19e5074b1bf 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/guestagents_client.go @@ -41,7 +41,7 @@ func NewGuestAgentsClient(credential azcore.TokenCredential, options *arm.Client // BeginCreate - Create Or Update GuestAgent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - resource - Resource create parameters. // - options - GuestAgentsClientBeginCreateOptions contains the optional parameters for the GuestAgentsClient.BeginCreate method. @@ -66,7 +66,7 @@ func (client *GuestAgentsClient) BeginCreate(ctx context.Context, resourceURI st // Create - Create Or Update GuestAgent. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *GuestAgentsClient) create(ctx context.Context, resourceURI string, resource GuestAgent, options *GuestAgentsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "GuestAgentsClient.BeginCreate" @@ -97,7 +97,7 @@ func (client *GuestAgentsClient) createCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -109,7 +109,7 @@ func (client *GuestAgentsClient) createCreateRequest(ctx context.Context, resour // Delete - Implements GuestAgent DELETE method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - GuestAgentsClientDeleteOptions contains the optional parameters for the GuestAgentsClient.Delete method. func (client *GuestAgentsClient) Delete(ctx context.Context, resourceURI string, options *GuestAgentsClientDeleteOptions) (GuestAgentsClientDeleteResponse, error) { @@ -142,7 +142,7 @@ func (client *GuestAgentsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -151,7 +151,7 @@ func (client *GuestAgentsClient) deleteCreateRequest(ctx context.Context, resour // Get - Implements GuestAgent GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - GuestAgentsClientGetOptions contains the optional parameters for the GuestAgentsClient.Get method. func (client *GuestAgentsClient) Get(ctx context.Context, resourceURI string, options *GuestAgentsClientGetOptions) (GuestAgentsClientGetResponse, error) { @@ -185,7 +185,7 @@ func (client *GuestAgentsClient) getCreateRequest(ctx context.Context, resourceU return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +202,7 @@ func (client *GuestAgentsClient) getHandleResponse(resp *http.Response) (GuestAg // NewListByVirtualMachineInstancePager - Returns the list of GuestAgent of the given vm. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - GuestAgentsClientListByVirtualMachineInstanceOptions contains the optional parameters for the GuestAgentsClient.NewListByVirtualMachineInstancePager // method. @@ -238,7 +238,7 @@ func (client *GuestAgentsClient) listByVirtualMachineInstanceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/guestagents_client_example_test.go deleted file mode 100644 index 0ea7db384610..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/guestagents_client_example_test.go +++ /dev/null @@ -1,293 +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 armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MaximumSet_Gen.json -func ExampleGuestAgentsClient_NewListByVirtualMachineInstancePager_guestAgentsListByVirtualMachineInstanceMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGuestAgentsClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", 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.GuestAgentListResult = armscvmm.GuestAgentListResult{ - // Value: []*armscvmm.GuestAgent{ - // { - // Name: to.Ptr("rwecpthzyt"), - // Type: to.Ptr("dkcgcbtlwtsedxzhvtu"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.GuestAgentProperties{ - // Credentials: &armscvmm.GuestCredential{ - // Username: to.Ptr("jqxuwirrcpfv"), - // }, - // CustomResourceName: to.Ptr("mhqymxkapuvsugd"), - // HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - // HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - // }, - // ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // Status: to.Ptr("jpoukrzfenzrmjdahimkl"), - // UUID: to.Ptr("hbsgztyakewtgbuxbesezncnzu"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_ListByVirtualMachineInstance_MinimumSet_Gen.json -func ExampleGuestAgentsClient_NewListByVirtualMachineInstancePager_guestAgentsListByVirtualMachineInstanceMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGuestAgentsClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", 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.GuestAgentListResult = armscvmm.GuestAgentListResult{ - // Value: []*armscvmm.GuestAgent{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MaximumSet_Gen.json -func ExampleGuestAgentsClient_Get_guestAgentsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGuestAgentsClient().Get(ctx, "gtgclehcbsyave", 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 = armscvmm.GuestAgent{ - // Name: to.Ptr("rwecpthzyt"), - // Type: to.Ptr("dkcgcbtlwtsedxzhvtu"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.GuestAgentProperties{ - // Credentials: &armscvmm.GuestCredential{ - // Username: to.Ptr("jqxuwirrcpfv"), - // }, - // CustomResourceName: to.Ptr("mhqymxkapuvsugd"), - // HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - // HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - // }, - // ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // Status: to.Ptr("jpoukrzfenzrmjdahimkl"), - // UUID: to.Ptr("hbsgztyakewtgbuxbesezncnzu"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Get_MinimumSet_Gen.json -func ExampleGuestAgentsClient_Get_guestAgentsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGuestAgentsClient().Get(ctx, "gtgclehcbsyave", 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 = armscvmm.GuestAgent{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MaximumSet_Gen.json -func ExampleGuestAgentsClient_BeginCreate_guestAgentsCreateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGuestAgentsClient().BeginCreate(ctx, "gtgclehcbsyave", armscvmm.GuestAgent{ - Properties: &armscvmm.GuestAgentProperties{ - Credentials: &armscvmm.GuestCredential{ - Password: to.Ptr("gkvbnmuahumuoibvscoxzfdqwvfuf"), - Username: to.Ptr("jqxuwirrcpfv"), - }, - HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - }, - ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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 = armscvmm.GuestAgent{ - // Name: to.Ptr("rwecpthzyt"), - // Type: to.Ptr("dkcgcbtlwtsedxzhvtu"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/guestAgents/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.GuestAgentProperties{ - // Credentials: &armscvmm.GuestCredential{ - // Username: to.Ptr("jqxuwirrcpfv"), - // }, - // CustomResourceName: to.Ptr("mhqymxkapuvsugd"), - // HTTPProxyConfig: &armscvmm.HTTPProxyConfiguration{ - // HTTPSProxy: to.Ptr("uoyzyticmohohomlkwct"), - // }, - // ProvisioningAction: to.Ptr(armscvmm.ProvisioningActionInstall), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // Status: to.Ptr("jpoukrzfenzrmjdahimkl"), - // UUID: to.Ptr("hbsgztyakewtgbuxbesezncnzu"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Create_MinimumSet_Gen.json -func ExampleGuestAgentsClient_BeginCreate_guestAgentsCreateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGuestAgentsClient().BeginCreate(ctx, "gtgclehcbsyave", armscvmm.GuestAgent{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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 = armscvmm.GuestAgent{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MaximumSet_Gen.json -func ExampleGuestAgentsClient_Delete_guestAgentsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGuestAgentsClient().Delete(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/GuestAgents_Delete_MinimumSet_Gen.json -func ExampleGuestAgentsClient_Delete_guestAgentsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGuestAgentsClient().Delete(ctx, "gtgclehcbsyave", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go b/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go index 33d02089cc34..c90100c46477 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client.go @@ -46,7 +46,7 @@ func NewInventoryItemsClient(subscriptionID string, credential azcore.TokenCrede // Create - Create Or Update InventoryItem. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - inventoryItemResourceName - Name of the inventoryItem. @@ -98,7 +98,7 @@ func (client *InventoryItemsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -119,7 +119,7 @@ func (client *InventoryItemsClient) createHandleResponse(resp *http.Response) (I // Delete - Deletes an inventoryItem. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - inventoryItemResourceName - Name of the inventoryItem. @@ -169,7 +169,7 @@ func (client *InventoryItemsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +178,7 @@ func (client *InventoryItemsClient) deleteCreateRequest(ctx context.Context, res // Get - Shows an inventory item. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - inventoryItemResourceName - Name of the inventoryItem. @@ -229,7 +229,7 @@ func (client *InventoryItemsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +246,7 @@ func (client *InventoryItemsClient) getHandleResponse(resp *http.Response) (Inve // NewListByVmmServerPager - Returns the list of inventoryItems in the given VmmServer. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - options - InventoryItemsClientListByVmmServerOptions contains the optional parameters for the InventoryItemsClient.NewListByVmmServerPager @@ -294,7 +294,7 @@ func (client *InventoryItemsClient) listByVmmServerCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client_example_test.go deleted file mode 100644 index 72dfbef0933f..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/inventoryitems_client_example_test.go +++ /dev/null @@ -1,264 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MaximumSet_Gen.json -func ExampleInventoryItemsClient_NewListByVmmServerPager_inventoryItemsListByVmmServerMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInventoryItemsClient().NewListByVmmServerPager("rgscvmm", "X", 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.InventoryItemListResult = armscvmm.InventoryItemListResult{ - // Value: []*armscvmm.InventoryItem{ - // { - // Name: to.Ptr("oimmcgxagnhmasgsmhdaigznub"), - // Type: to.Ptr("lfhuayaplzxdqzubmjvtgcan"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Kind: to.Ptr("M\\d_,V."), - // Properties: &armscvmm.InventoryItemProperties{ - // InventoryItemName: to.Ptr("kspgdhmlmycalwrepfmshoaoumna"), - // InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - // ManagedResourceID: to.Ptr("ictxvjzvurnkdgwabqyyfyckkkdx"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("jolmoxfopwfoje"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_ListByVmmServer_MinimumSet_Gen.json -func ExampleInventoryItemsClient_NewListByVmmServerPager_inventoryItemsListByVmmServerMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInventoryItemsClient().NewListByVmmServerPager("rgscvmm", "H", 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.InventoryItemListResult = armscvmm.InventoryItemListResult{ - // Value: []*armscvmm.InventoryItem{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MaximumSet_Gen.json -func ExampleInventoryItemsClient_Get_inventoryItemsGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Get(ctx, "rgscvmm", "1", "2bFBede6-EEf8-becB-dBbd-B96DbBFdB3f3", 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.InventoryItem = armscvmm.InventoryItem{ - // Name: to.Ptr("oimmcgxagnhmasgsmhdaigznub"), - // Type: to.Ptr("lfhuayaplzxdqzubmjvtgcan"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Kind: to.Ptr("M\\d_,V."), - // Properties: &armscvmm.InventoryItemProperties{ - // InventoryItemName: to.Ptr("kspgdhmlmycalwrepfmshoaoumna"), - // InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - // ManagedResourceID: to.Ptr("ictxvjzvurnkdgwabqyyfyckkkdx"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("jolmoxfopwfoje"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Get_MinimumSet_Gen.json -func ExampleInventoryItemsClient_Get_inventoryItemsGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Get(ctx, "rgscvmm", "_", "cacb8Ceb-efAC-bebb-ae7C-dec8C5Bb7100", 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.InventoryItem = armscvmm.InventoryItem{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MaximumSet_Gen.json -func ExampleInventoryItemsClient_Create_inventoryItemsCreateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Create(ctx, "rgscvmm", "O", "1BdDc2Ab-bDd9-Ebd6-bfdb-C0dbbdB5DEDf", armscvmm.InventoryItem{ - Kind: to.Ptr("M\\d_,V."), - Properties: &armscvmm.InventoryItemProperties{ - InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - }, - }, 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.InventoryItem = armscvmm.InventoryItem{ - // Name: to.Ptr("oimmcgxagnhmasgsmhdaigznub"), - // Type: to.Ptr("lfhuayaplzxdqzubmjvtgcan"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/{vmmServerName}/inventoryItems/inventoryItemResourceName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Kind: to.Ptr("M\\d_,V."), - // Properties: &armscvmm.InventoryItemProperties{ - // InventoryItemName: to.Ptr("kspgdhmlmycalwrepfmshoaoumna"), - // InventoryType: to.Ptr(armscvmm.InventoryType("InventoryItemProperties")), - // ManagedResourceID: to.Ptr("ictxvjzvurnkdgwabqyyfyckkkdx"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("jolmoxfopwfoje"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Create_MinimumSet_Gen.json -func ExampleInventoryItemsClient_Create_inventoryItemsCreateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInventoryItemsClient().Create(ctx, "rgscvmm", ".", "bbFb0cBb-50ce-4bfc-3eeD-bC26AbCC257a", armscvmm.InventoryItem{}, 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.InventoryItem = armscvmm.InventoryItem{ - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MaximumSet_Gen.json -func ExampleInventoryItemsClient_Delete_inventoryItemsDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewInventoryItemsClient().Delete(ctx, "rgscvmm", "b", "EcECadfd-Eaaa-e5Ce-ebdA-badeEd3c6af1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/InventoryItems_Delete_MinimumSet_Gen.json -func ExampleInventoryItemsClient_Delete_inventoryItemsDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewInventoryItemsClient().Delete(ctx, "rgscvmm", "_", "cDBcbae6-BC3d-52fe-CedC-7eFeaBFabb82", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/models.go b/sdk/resourcemanager/scvmm/armscvmm/models.go index 954137ee3c26..56712fc917c8 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/models.go +++ b/sdk/resourcemanager/scvmm/armscvmm/models.go @@ -239,6 +239,9 @@ type GuestAgentProperties struct { // HTTP Proxy configuration for the VM. HTTPProxyConfig *HTTPProxyConfiguration + // The resource id of the private link scope this machine is assigned to, if any. + PrivateLinkScopeResourceID *string + // Gets or sets the guest agent provisioning action. ProvisioningAction *ProvisioningAction @@ -549,6 +552,27 @@ type OsProfileForVMInstance struct { // Gets or sets computer name. ComputerName *string + // Gets or sets the domain name. + DomainName *string + + // Password of the domain the VM has to join. + DomainPassword *string + + // Gets or sets the domain username. + DomainUsername *string + + // Gets or sets the product key.Input format xxxxx-xxxxx-xxxxx-xxxxx-xxxxx + ProductKey *string + + // Get or sets the commands to be run once at the time of creation separated by semicolons. + RunOnceCommands *string + + // Gets or sets the index value of the timezone. + Timezone *int32 + + // Gets or sets the workgroup. + Workgroup *string + // READ-ONLY; Gets os sku. OSSKU *string diff --git a/sdk/resourcemanager/scvmm/armscvmm/models_serde.go b/sdk/resourcemanager/scvmm/armscvmm/models_serde.go index a0c75adc8c61..257a76cefd1f 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/models_serde.go +++ b/sdk/resourcemanager/scvmm/armscvmm/models_serde.go @@ -586,6 +586,7 @@ func (g GuestAgentProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "credentials", g.Credentials) populate(objectMap, "customResourceName", g.CustomResourceName) populate(objectMap, "httpProxyConfig", g.HTTPProxyConfig) + populate(objectMap, "privateLinkScopeResourceId", g.PrivateLinkScopeResourceID) populate(objectMap, "provisioningAction", g.ProvisioningAction) populate(objectMap, "provisioningState", g.ProvisioningState) populate(objectMap, "status", g.Status) @@ -611,6 +612,9 @@ func (g *GuestAgentProperties) UnmarshalJSON(data []byte) error { case "httpProxyConfig": err = unpopulate(val, "HTTPProxyConfig", &g.HTTPProxyConfig) delete(rawMsg, key) + case "privateLinkScopeResourceId": + err = unpopulate(val, "PrivateLinkScopeResourceID", &g.PrivateLinkScopeResourceID) + delete(rawMsg, key) case "provisioningAction": err = unpopulate(val, "ProvisioningAction", &g.ProvisioningAction) delete(rawMsg, key) @@ -1323,9 +1327,16 @@ func (o OsProfileForVMInstance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "adminPassword", o.AdminPassword) populate(objectMap, "computerName", o.ComputerName) + populate(objectMap, "domainName", o.DomainName) + populate(objectMap, "domainPassword", o.DomainPassword) + populate(objectMap, "domainUsername", o.DomainUsername) populate(objectMap, "osSku", o.OSSKU) populate(objectMap, "osType", o.OSType) populate(objectMap, "osVersion", o.OSVersion) + populate(objectMap, "productKey", o.ProductKey) + populate(objectMap, "runOnceCommands", o.RunOnceCommands) + populate(objectMap, "timezone", o.Timezone) + populate(objectMap, "workgroup", o.Workgroup) return json.Marshal(objectMap) } @@ -1344,6 +1355,15 @@ func (o *OsProfileForVMInstance) UnmarshalJSON(data []byte) error { case "computerName": err = unpopulate(val, "ComputerName", &o.ComputerName) delete(rawMsg, key) + case "domainName": + err = unpopulate(val, "DomainName", &o.DomainName) + delete(rawMsg, key) + case "domainPassword": + err = unpopulate(val, "DomainPassword", &o.DomainPassword) + delete(rawMsg, key) + case "domainUsername": + err = unpopulate(val, "DomainUsername", &o.DomainUsername) + delete(rawMsg, key) case "osSku": err = unpopulate(val, "OSSKU", &o.OSSKU) delete(rawMsg, key) @@ -1353,6 +1373,18 @@ func (o *OsProfileForVMInstance) UnmarshalJSON(data []byte) error { case "osVersion": err = unpopulate(val, "OSVersion", &o.OSVersion) delete(rawMsg, key) + case "productKey": + err = unpopulate(val, "ProductKey", &o.ProductKey) + delete(rawMsg, key) + case "runOnceCommands": + err = unpopulate(val, "RunOnceCommands", &o.RunOnceCommands) + delete(rawMsg, key) + case "timezone": + err = unpopulate(val, "Timezone", &o.Timezone) + delete(rawMsg, key) + case "workgroup": + err = unpopulate(val, "Workgroup", &o.Workgroup) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) diff --git a/sdk/resourcemanager/scvmm/armscvmm/operations_client.go b/sdk/resourcemanager/scvmm/armscvmm/operations_client.go index 859c2036320a..71a20790552f 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/operations_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the operations for the provider // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/operations_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/operations_client_example_test.go deleted file mode 100644 index 15482cfb6029..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/operations_client_example_test.go +++ /dev/null @@ -1,85 +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 armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MaximumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.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 = armscvmm.OperationListResult{ - // Value: []*armscvmm.Operation{ - // { - // Name: to.Ptr("rieknsh"), - // ActionType: to.Ptr(armscvmm.ActionTypeInternal), - // Display: &armscvmm.OperationDisplay{ - // Description: to.Ptr("fmwevntnynhgzoksqpjidn"), - // Operation: to.Ptr("v"), - // Provider: to.Ptr("avkabpzrbafrbnubspbrsippj"), - // Resource: to.Ptr("qojushhvjhkwwmboofogcky"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr(armscvmm.OriginUser), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/Operations_List_MinimumSet_Gen.json -func ExampleOperationsClient_NewListPager_operationsListMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.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 = armscvmm.OperationListResult{ - // } - } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/options.go b/sdk/resourcemanager/scvmm/armscvmm/options.go index b22dfafc9139..f3a79285927a 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/options.go +++ b/sdk/resourcemanager/scvmm/armscvmm/options.go @@ -203,6 +203,9 @@ type VirtualMachineInstancesClientBeginStartOptions struct { // VirtualMachineInstancesClientBeginStopOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginStop // method. type VirtualMachineInstancesClientBeginStopOptions struct { + // The content of the action request + Body *StopVirtualMachineOptions + // Resumes the LRO from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go index baed77d9ab5c..0f256b7b8518 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client.go @@ -41,7 +41,7 @@ func NewVirtualMachineInstancesClient(credential azcore.TokenCredential, options // BeginCreateCheckpoint - Creates a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - body - The content of the action request // - options - VirtualMachineInstancesClientBeginCreateCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginCreateCheckpoint @@ -67,7 +67,7 @@ func (client *VirtualMachineInstancesClient) BeginCreateCheckpoint(ctx context.C // CreateCheckpoint - Creates a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) createCheckpoint(ctx context.Context, resourceURI string, body VirtualMachineCreateCheckpoint, options *VirtualMachineInstancesClientBeginCreateCheckpointOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginCreateCheckpoint" @@ -98,7 +98,7 @@ func (client *VirtualMachineInstancesClient) createCheckpointCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -111,7 +111,7 @@ func (client *VirtualMachineInstancesClient) createCheckpointCreateRequest(ctx c // set only during virtual machine instance creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - resource - Resource create parameters. // - options - VirtualMachineInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginCreateOrUpdate @@ -138,7 +138,7 @@ func (client *VirtualMachineInstancesClient) BeginCreateOrUpdate(ctx context.Con // during virtual machine instance creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) createOrUpdate(ctx context.Context, resourceURI string, resource VirtualMachineInstance, options *VirtualMachineInstancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginCreateOrUpdate" @@ -169,7 +169,7 @@ func (client *VirtualMachineInstancesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -181,7 +181,7 @@ func (client *VirtualMachineInstancesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - The operation to delete a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientBeginDeleteOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginDelete // method. @@ -206,7 +206,7 @@ func (client *VirtualMachineInstancesClient) BeginDelete(ctx context.Context, re // Delete - The operation to delete a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) deleteOperation(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginDelete" @@ -237,7 +237,7 @@ func (client *VirtualMachineInstancesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.DeleteFromHost != nil { reqQP.Set("deleteFromHost", string(*options.DeleteFromHost)) } @@ -252,7 +252,7 @@ func (client *VirtualMachineInstancesClient) deleteCreateRequest(ctx context.Con // BeginDeleteCheckpoint - Deletes a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - body - The content of the action request // - options - VirtualMachineInstancesClientBeginDeleteCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginDeleteCheckpoint @@ -278,7 +278,7 @@ func (client *VirtualMachineInstancesClient) BeginDeleteCheckpoint(ctx context.C // DeleteCheckpoint - Deletes a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) deleteCheckpoint(ctx context.Context, resourceURI string, body VirtualMachineDeleteCheckpoint, options *VirtualMachineInstancesClientBeginDeleteCheckpointOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginDeleteCheckpoint" @@ -309,7 +309,7 @@ func (client *VirtualMachineInstancesClient) deleteCheckpointCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -321,7 +321,7 @@ func (client *VirtualMachineInstancesClient) deleteCheckpointCreateRequest(ctx c // Get - Retrieves information about a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientGetOptions contains the optional parameters for the VirtualMachineInstancesClient.Get // method. @@ -356,7 +356,7 @@ func (client *VirtualMachineInstancesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,7 +373,7 @@ func (client *VirtualMachineInstancesClient) getHandleResponse(resp *http.Respon // NewListPager - Lists all of the virtual machine instances within the specified parent resource. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientListOptions contains the optional parameters for the VirtualMachineInstancesClient.NewListPager // method. @@ -409,7 +409,7 @@ func (client *VirtualMachineInstancesClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -427,7 +427,7 @@ func (client *VirtualMachineInstancesClient) listHandleResponse(resp *http.Respo // BeginRestart - The operation to restart a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientBeginRestartOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginRestart // method. @@ -452,7 +452,7 @@ func (client *VirtualMachineInstancesClient) BeginRestart(ctx context.Context, r // Restart - The operation to restart a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) restart(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginRestartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginRestart" @@ -483,7 +483,7 @@ func (client *VirtualMachineInstancesClient) restartCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -492,7 +492,7 @@ func (client *VirtualMachineInstancesClient) restartCreateRequest(ctx context.Co // BeginRestoreCheckpoint - Restores to a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - body - The content of the action request // - options - VirtualMachineInstancesClientBeginRestoreCheckpointOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginRestoreCheckpoint @@ -518,7 +518,7 @@ func (client *VirtualMachineInstancesClient) BeginRestoreCheckpoint(ctx context. // RestoreCheckpoint - Restores to a checkpoint in virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) restoreCheckpoint(ctx context.Context, resourceURI string, body VirtualMachineRestoreCheckpoint, options *VirtualMachineInstancesClientBeginRestoreCheckpointOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginRestoreCheckpoint" @@ -549,7 +549,7 @@ func (client *VirtualMachineInstancesClient) restoreCheckpointCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, body); err != nil { @@ -561,7 +561,7 @@ func (client *VirtualMachineInstancesClient) restoreCheckpointCreateRequest(ctx // BeginStart - The operation to start a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VirtualMachineInstancesClientBeginStartOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginStart // method. @@ -586,7 +586,7 @@ func (client *VirtualMachineInstancesClient) BeginStart(ctx context.Context, res // Start - The operation to start a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) start(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginStartOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginStart" @@ -617,7 +617,7 @@ func (client *VirtualMachineInstancesClient) startCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -626,14 +626,13 @@ func (client *VirtualMachineInstancesClient) startCreateRequest(ctx context.Cont // BeginStop - The operation to power off (stop) a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. -// - body - The content of the action request // - options - VirtualMachineInstancesClientBeginStopOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginStop // method. -func (client *VirtualMachineInstancesClient) BeginStop(ctx context.Context, resourceURI string, body StopVirtualMachineOptions, options *VirtualMachineInstancesClientBeginStopOptions) (*runtime.Poller[VirtualMachineInstancesClientStopResponse], error) { +func (client *VirtualMachineInstancesClient) BeginStop(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginStopOptions) (*runtime.Poller[VirtualMachineInstancesClientStopResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.stop(ctx, resourceURI, body, options) + resp, err := client.stop(ctx, resourceURI, options) if err != nil { return nil, err } @@ -652,14 +651,14 @@ func (client *VirtualMachineInstancesClient) BeginStop(ctx context.Context, reso // Stop - The operation to power off (stop) a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 -func (client *VirtualMachineInstancesClient) stop(ctx context.Context, resourceURI string, body StopVirtualMachineOptions, options *VirtualMachineInstancesClientBeginStopOptions) (*http.Response, error) { +// Generated from API version 2024-06-01 +func (client *VirtualMachineInstancesClient) stop(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginStopOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginStop" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) defer func() { endSpan(err) }() - req, err := client.stopCreateRequest(ctx, resourceURI, body, options) + req, err := client.stopCreateRequest(ctx, resourceURI, options) if err != nil { return nil, err } @@ -675,7 +674,7 @@ func (client *VirtualMachineInstancesClient) stop(ctx context.Context, resourceU } // stopCreateRequest creates the Stop request. -func (client *VirtualMachineInstancesClient) stopCreateRequest(ctx context.Context, resourceURI string, body StopVirtualMachineOptions, options *VirtualMachineInstancesClientBeginStopOptions) (*policy.Request, error) { +func (client *VirtualMachineInstancesClient) stopCreateRequest(ctx context.Context, resourceURI string, options *VirtualMachineInstancesClientBeginStopOptions) (*policy.Request, error) { urlPath := "/{resourceUri}/providers/Microsoft.ScVmm/virtualMachineInstances/default/stop" urlPath = strings.ReplaceAll(urlPath, "{resourceUri}", resourceURI) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) @@ -683,11 +682,14 @@ func (client *VirtualMachineInstancesClient) stopCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, body); err != nil { - return nil, err + if options != nil && options.Body != nil { + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -695,7 +697,7 @@ func (client *VirtualMachineInstancesClient) stopCreateRequest(ctx context.Conte // BeginUpdate - The operation to update a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - properties - The resource properties to be updated. // - options - VirtualMachineInstancesClientBeginUpdateOptions contains the optional parameters for the VirtualMachineInstancesClient.BeginUpdate @@ -721,7 +723,7 @@ func (client *VirtualMachineInstancesClient) BeginUpdate(ctx context.Context, re // Update - The operation to update a virtual machine instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineInstancesClient) update(ctx context.Context, resourceURI string, properties VirtualMachineInstanceUpdate, options *VirtualMachineInstancesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineInstancesClient.BeginUpdate" @@ -752,7 +754,7 @@ func (client *VirtualMachineInstancesClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client_example_test.go deleted file mode 100644 index d2eb007ddf2a..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachineinstances_client_example_test.go +++ /dev/null @@ -1,1079 +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 armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_NewListPager_virtualMachineInstancesListMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineInstancesClient().NewListPager("gtgclehcbsyave", 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 = armscvmm.VirtualMachineInstanceListResult{ - // Value: []*armscvmm.VirtualMachineInstance{ - // { - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_List_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_NewListPager_virtualMachineInstancesListMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineInstancesClient().NewListPager("gtgclehcbsyave", 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 = armscvmm.VirtualMachineInstanceListResult{ - // Value: []*armscvmm.VirtualMachineInstance{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_Get_virtualMachineInstancesGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineInstancesClient().Get(ctx, "gtgclehcbsyave", 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 = armscvmm.VirtualMachineInstance{ - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Get_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_Get_virtualMachineInstancesGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineInstancesClient().Get(ctx, "gtgclehcbsyave", 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 = armscvmm.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate_virtualMachineInstancesCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstance{ - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VirtualMachineInstanceProperties{ - AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - { - Name: to.Ptr("lwbhaseo"), - ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - }}, - HardwareProfile: &armscvmm.HardwareProfile{ - CPUCount: to.Ptr[int32](22), - DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - DynamicMemoryMaxMB: to.Ptr[int32](2), - DynamicMemoryMinMB: to.Ptr[int32](30), - IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - MemoryMB: to.Ptr[int32](5), - }, - InfrastructureProfile: &armscvmm.InfrastructureProfile{ - BiosGUID: to.Ptr("xixivxifyql"), - CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - Generation: to.Ptr[int32](28), - InventoryItemID: to.Ptr("ihkkqmg"), - LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - Name: to.Ptr("keqn"), - Description: to.Ptr("qurzfrgyflrh"), - CheckpointID: to.Ptr("wsqmrje"), - ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - }, - TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - UUID: to.Ptr("hrpw"), - VMName: to.Ptr("qovpayfydhcvfrhe"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - NetworkProfile: &armscvmm.NetworkProfile{ - NetworkInterfaces: []*armscvmm.NetworkInterface{ - { - Name: to.Ptr("kvofzqulbjlbtt"), - IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - MacAddress: to.Ptr("oaeqqegt"), - MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - NicID: to.Ptr("roxpsvlo"), - VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - }}, - }, - OSProfile: &armscvmm.OsProfileForVMInstance{ - AdminPassword: to.Ptr("vavtppmmhlspydtkzxda"), - ComputerName: to.Ptr("uuxpcxuxcufllc"), - OSType: to.Ptr(armscvmm.OsTypeWindows), - }, - StorageProfile: &armscvmm.StorageProfile{ - Disks: []*armscvmm.VirtualDisk{ - { - Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - Bus: to.Ptr[int32](8), - BusType: to.Ptr("zu"), - CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - DiskSizeGB: to.Ptr[int32](30), - Lun: to.Ptr[int32](10), - StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - Name: to.Ptr("ceiyfrflu"), - ID: to.Ptr("o"), - }, - TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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 = armscvmm.VirtualMachineInstance{ - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("kz"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateOrUpdate_virtualMachineInstancesCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateOrUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstance{ - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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 = armscvmm.VirtualMachineInstance{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginUpdate_virtualMachineInstancesUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstanceUpdate{ - Properties: &armscvmm.VirtualMachineInstanceUpdateProperties{ - AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - { - Name: to.Ptr("lwbhaseo"), - ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - }}, - HardwareProfile: &armscvmm.HardwareProfileUpdate{ - CPUCount: to.Ptr[int32](22), - DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - DynamicMemoryMaxMB: to.Ptr[int32](2), - DynamicMemoryMinMB: to.Ptr[int32](30), - LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - MemoryMB: to.Ptr[int32](5), - }, - InfrastructureProfile: &armscvmm.InfrastructureProfileUpdate{ - CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - }, - NetworkProfile: &armscvmm.NetworkProfileUpdate{ - NetworkInterfaces: []*armscvmm.NetworkInterfaceUpdate{ - { - Name: to.Ptr("kvofzqulbjlbtt"), - IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - MacAddress: to.Ptr("oaeqqegt"), - MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - NicID: to.Ptr("roxpsvlo"), - VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - }}, - }, - StorageProfile: &armscvmm.StorageProfileUpdate{ - Disks: []*armscvmm.VirtualDiskUpdate{ - { - Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - Bus: to.Ptr[int32](8), - BusType: to.Ptr("zu"), - DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - DiskSizeGB: to.Ptr[int32](30), - Lun: to.Ptr[int32](10), - StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - Name: to.Ptr("ceiyfrflu"), - ID: to.Ptr("o"), - }, - VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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 = armscvmm.VirtualMachineInstance{ - // Name: to.Ptr("uuqpsdoiyvedvqtrwop"), - // Type: to.Ptr("zculorteltpvthtzgnpgdpoe"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineInstanceProperties{ - // AvailabilitySets: []*armscvmm.AvailabilitySetListItem{ - // { - // Name: to.Ptr("lwbhaseo"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/availabilitySets/availabilitySetResourceName"), - // }}, - // HardwareProfile: &armscvmm.HardwareProfile{ - // CPUCount: to.Ptr[int32](22), - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](2), - // DynamicMemoryMinMB: to.Ptr[int32](30), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](5), - // }, - // InfrastructureProfile: &armscvmm.InfrastructureProfile{ - // BiosGUID: to.Ptr("xixivxifyql"), - // CheckpointType: to.Ptr("jkbpzjxpeegackhsvikrnlnwqz"), - // Checkpoints: []*armscvmm.Checkpoint{ - // { - // Name: to.Ptr("keqn"), - // Description: to.Ptr("kz"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }}, - // CloudID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/clouds/cloudResourceName"), - // Generation: to.Ptr[int32](28), - // InventoryItemID: to.Ptr("ihkkqmg"), - // LastRestoredVMCheckpoint: &armscvmm.Checkpoint{ - // Name: to.Ptr("keqn"), - // Description: to.Ptr("qurzfrgyflrh"), - // CheckpointID: to.Ptr("wsqmrje"), - // ParentCheckpointID: to.Ptr("hqhhzikoxunuqguouw"), - // }, - // TemplateID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // UUID: to.Ptr("hrpw"), - // VMName: to.Ptr("qovpayfydhcvfrhe"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // NetworkProfile: &armscvmm.NetworkProfile{ - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // }, - // OSProfile: &armscvmm.OsProfileForVMInstance{ - // ComputerName: to.Ptr("uuxpcxuxcufllc"), - // OSSKU: to.Ptr("cxqnjxgkts"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // OSVersion: to.Ptr("djt"), - // }, - // PowerState: to.Ptr("dbqyxewvrbqcifpwfvxyllwyaffmvm"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // StorageProfile: &armscvmm.StorageProfile{ - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Update_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginUpdate_virtualMachineInstancesUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginUpdate(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineInstanceUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your 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 = armscvmm.VirtualMachineInstance{ - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDelete_virtualMachineInstancesDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDelete(ctx, "gtgclehcbsyave", &armscvmm.VirtualMachineInstancesClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue), - DeleteFromHost: to.Ptr(armscvmm.DeleteFromHostTrue), - }) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Delete_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDelete_virtualMachineInstancesDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDelete(ctx, "gtgclehcbsyave", &armscvmm.VirtualMachineInstancesClientBeginDeleteOptions{Force: nil, - DeleteFromHost: 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateCheckpoint_virtualMachineInstancesCreateCheckpointMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineCreateCheckpoint{ - Name: to.Ptr("ilvltf"), - Description: to.Ptr("zoozhfbepldrgpjqsbhpqebtodrhvy"), - }, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_CreateCheckpoint_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginCreateCheckpoint_virtualMachineInstancesCreateCheckpointMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginCreateCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineCreateCheckpoint{}, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDeleteCheckpoint_virtualMachineInstancesDeleteCheckpointMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDeleteCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineDeleteCheckpoint{ - ID: to.Ptr("eenfflimcbgqfsebdusophahjpk"), - }, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_DeleteCheckpoint_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginDeleteCheckpoint_virtualMachineInstancesDeleteCheckpointMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginDeleteCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineDeleteCheckpoint{}, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestart_virtualMachineInstancesRestartMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestart(ctx, "gtgclehcbsyave", 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Restart_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestart_virtualMachineInstancesRestartMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestart(ctx, "gtgclehcbsyave", 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestoreCheckpoint_virtualMachineInstancesRestoreCheckpointMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestoreCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineRestoreCheckpoint{ - ID: to.Ptr("rweqduwzsn"), - }, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_RestoreCheckpoint_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginRestoreCheckpoint_virtualMachineInstancesRestoreCheckpointMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginRestoreCheckpoint(ctx, "gtgclehcbsyave", armscvmm.VirtualMachineRestoreCheckpoint{}, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStart_virtualMachineInstancesStartMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStart(ctx, "gtgclehcbsyave", 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Start_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStart_virtualMachineInstancesStartMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStart(ctx, "gtgclehcbsyave", 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MaximumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStop_virtualMachineInstancesStopMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStop(ctx, "gtgclehcbsyave", armscvmm.StopVirtualMachineOptions{ - SkipShutdown: to.Ptr(armscvmm.SkipShutdownTrue), - }, 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineInstances_Stop_MinimumSet_Gen.json -func ExampleVirtualMachineInstancesClient_BeginStop_virtualMachineInstancesStopMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineInstancesClient().BeginStop(ctx, "gtgclehcbsyave", armscvmm.StopVirtualMachineOptions{}, 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/scvmm/armscvmm/virtualmachinetemplates_client.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client.go index 84281bc35baf..30b8ef90956b 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client.go @@ -46,7 +46,7 @@ func NewVirtualMachineTemplatesClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Onboards the ScVmm VM Template as an Azure VM Template resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *VirtualMachineTemplatesClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Onboards the ScVmm VM Template as an Azure VM Template resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineTemplatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, resource VirtualMachineTemplate, options *VirtualMachineTemplatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineTemplatesClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *VirtualMachineTemplatesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *VirtualMachineTemplatesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deregisters the ScVmm VM Template from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - options - VirtualMachineTemplatesClientBeginDeleteOptions contains the optional parameters for the VirtualMachineTemplatesClient.BeginDelete @@ -153,7 +153,7 @@ func (client *VirtualMachineTemplatesClient) BeginDelete(ctx context.Context, re // Delete - Deregisters the ScVmm VM Template from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineTemplatesClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, options *VirtualMachineTemplatesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineTemplatesClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *VirtualMachineTemplatesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -207,7 +207,7 @@ func (client *VirtualMachineTemplatesClient) deleteCreateRequest(ctx context.Con // Get - Implements VirtualMachineTemplate GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - options - VirtualMachineTemplatesClientGetOptions contains the optional parameters for the VirtualMachineTemplatesClient.Get @@ -254,7 +254,7 @@ func (client *VirtualMachineTemplatesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *VirtualMachineTemplatesClient) getHandleResponse(resp *http.Respon // NewListByResourceGroupPager - List of VirtualMachineTemplates in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualMachineTemplatesClientListByResourceGroupOptions contains the optional parameters for the VirtualMachineTemplatesClient.NewListByResourceGroupPager // method. @@ -314,7 +314,7 @@ func (client *VirtualMachineTemplatesClient) listByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +331,7 @@ func (client *VirtualMachineTemplatesClient) listByResourceGroupHandleResponse(r // NewListBySubscriptionPager - List of VirtualMachineTemplates in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - VirtualMachineTemplatesClientListBySubscriptionOptions contains the optional parameters for the VirtualMachineTemplatesClient.NewListBySubscriptionPager // method. func (client *VirtualMachineTemplatesClient) NewListBySubscriptionPager(options *VirtualMachineTemplatesClientListBySubscriptionOptions) *runtime.Pager[VirtualMachineTemplatesClientListBySubscriptionResponse] { @@ -369,7 +369,7 @@ func (client *VirtualMachineTemplatesClient) listBySubscriptionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +387,7 @@ func (client *VirtualMachineTemplatesClient) listBySubscriptionHandleResponse(re // BeginUpdate - Updates the VirtualMachineTemplate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualMachineTemplateName - Name of the VirtualMachineTemplate. // - properties - The resource properties to be updated. @@ -414,7 +414,7 @@ func (client *VirtualMachineTemplatesClient) BeginUpdate(ctx context.Context, re // Update - Updates the VirtualMachineTemplate resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualMachineTemplatesClient) update(ctx context.Context, resourceGroupName string, virtualMachineTemplateName string, properties VirtualMachineTemplateTagsUpdate, options *VirtualMachineTemplatesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualMachineTemplatesClient.BeginUpdate" @@ -456,7 +456,7 @@ func (client *VirtualMachineTemplatesClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client_example_test.go deleted file mode 100644 index 0b71bb748b18..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualmachinetemplates_client_example_test.go +++ /dev/null @@ -1,739 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListBySubscriptionPager_virtualMachineTemplatesListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListBySubscription_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListBySubscriptionPager_virtualMachineTemplatesListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListByResourceGroupPager_virtualMachineTemplatesListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListByResourceGroupPager("rgscvmm", 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.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_ListByResourceGroup_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_NewListByResourceGroupPager_virtualMachineTemplatesListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualMachineTemplatesClient().NewListByResourceGroupPager("rgscvmm", 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.VirtualMachineTemplateListResult = armscvmm.VirtualMachineTemplateListResult{ - // Value: []*armscvmm.VirtualMachineTemplate{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_Get_virtualMachineTemplatesGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineTemplatesClient().Get(ctx, "rgscvmm", "4", 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.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Get_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_Get_virtualMachineTemplatesGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualMachineTemplatesClient().Get(ctx, "rgscvmm", "m", 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.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginCreateOrUpdate_virtualMachineTemplatesCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginCreateOrUpdate(ctx, "rgscvmm", "6", armscvmm.VirtualMachineTemplate{ - Location: to.Ptr("ayxsyduviotylbojh"), - Tags: map[string]*string{ - "key9494": to.Ptr("kkbmfpwhmvlobm"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VirtualMachineTemplateProperties{ - DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - OSType: to.Ptr(armscvmm.OsTypeWindows), - UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginCreateOrUpdate_virtualMachineTemplatesCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginCreateOrUpdate(ctx, "rgscvmm", "P", armscvmm.VirtualMachineTemplate{ - Location: to.Ptr("ayxsyduviotylbojh"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginUpdate_virtualMachineTemplatesUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginUpdate(ctx, "rgscvmm", "g", armscvmm.VirtualMachineTemplateTagsUpdate{ - Tags: map[string]*string{ - "key6634": to.Ptr("wwfhrg"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // Name: to.Ptr("ioeuwaznkaayvhpqbnrwbr"), - // Type: to.Ptr("egfzqiscydkyddksvsjujdlee"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineTemplates/virtualMachineTemplateName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("ayxsyduviotylbojh"), - // Tags: map[string]*string{ - // "key9494": to.Ptr("kkbmfpwhmvlobm"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualMachineTemplateProperties{ - // ComputerName: to.Ptr("asxghqngsojdsdptpirbz"), - // CPUCount: to.Ptr[int32](23), - // Disks: []*armscvmm.VirtualDisk{ - // { - // Name: to.Ptr("fgnckfymwdsqnfxkdvexuaobe"), - // Bus: to.Ptr[int32](8), - // BusType: to.Ptr("zu"), - // CreateDiffDisk: to.Ptr(armscvmm.CreateDiffDiskTrue), - // DiskID: to.Ptr("ltdrwcfjklpsimhzqyh"), - // DiskSizeGB: to.Ptr[int32](30), - // DisplayName: to.Ptr("fgladknawlgjodo"), - // Lun: to.Ptr[int32](10), - // MaxDiskSizeGB: to.Ptr[int32](18), - // StorageQosPolicy: &armscvmm.StorageQosPolicyDetails{ - // Name: to.Ptr("ceiyfrflu"), - // ID: to.Ptr("o"), - // }, - // TemplateDiskID: to.Ptr("lcdwrokpyvekqccclf"), - // VhdFormatType: to.Ptr("vbcrrmhgahznifudvhxfagwoplcb"), - // VhdType: to.Ptr("cnbeeeylrvopigdynvgpkfp"), - // VolumeType: to.Ptr("ckkymkuekzzqhexyjueruzlfemoeln"), - // }}, - // DynamicMemoryEnabled: to.Ptr(armscvmm.DynamicMemoryEnabledTrue), - // DynamicMemoryMaxMB: to.Ptr[int32](21), - // DynamicMemoryMinMB: to.Ptr[int32](21), - // Generation: to.Ptr[int32](16), - // InventoryItemID: to.Ptr("qjrykoogccwlgkd"), - // IsCustomizable: to.Ptr(armscvmm.IsCustomizableTrue), - // IsHighlyAvailable: to.Ptr(armscvmm.IsHighlyAvailableTrue), - // LimitCPUForMigration: to.Ptr(armscvmm.LimitCPUForMigrationTrue), - // MemoryMB: to.Ptr[int32](24), - // NetworkInterfaces: []*armscvmm.NetworkInterface{ - // { - // Name: to.Ptr("kvofzqulbjlbtt"), - // DisplayName: to.Ptr("yoayfd"), - // IPv4AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv4Addresses: []*string{ - // to.Ptr("eeunirpkpqazzxhsqonkxcfuks")}, - // IPv6AddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // IPv6Addresses: []*string{ - // to.Ptr("pk")}, - // MacAddress: to.Ptr("oaeqqegt"), - // MacAddressType: to.Ptr(armscvmm.AllocationMethodDynamic), - // NetworkName: to.Ptr("lqbm"), - // NicID: to.Ptr("roxpsvlo"), - // VirtualNetworkID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // }}, - // OSName: to.Ptr("qcbolnbisklo"), - // OSType: to.Ptr(armscvmm.OsTypeWindows), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Update_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginUpdate_virtualMachineTemplatesUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginUpdate(ctx, "rgscvmm", "-", armscvmm.VirtualMachineTemplateTagsUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualMachineTemplate = armscvmm.VirtualMachineTemplate{ - // Location: to.Ptr("ayxsyduviotylbojh"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MaximumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginDelete_virtualMachineTemplatesDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginDelete(ctx, "rgscvmm", "6", &armscvmm.VirtualMachineTemplatesClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualMachineTemplates_Delete_MinimumSet_Gen.json -func ExampleVirtualMachineTemplatesClient_BeginDelete_virtualMachineTemplatesDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualMachineTemplatesClient().BeginDelete(ctx, "rgscvmm", "5", &armscvmm.VirtualMachineTemplatesClientBeginDeleteOptions{Force: 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/scvmm/armscvmm/virtualnetworks_client.go b/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go index c3ee98db816a..fd4acca640f4 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client.go @@ -46,7 +46,7 @@ func NewVirtualNetworksClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Onboards the ScVmm virtual network as an Azure virtual network resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *VirtualNetworksClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Onboards the ScVmm virtual network as an Azure virtual network resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualNetworksClient) createOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, resource VirtualNetwork, options *VirtualNetworksClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *VirtualNetworksClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Deregisters the ScVmm virtual network from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - options - VirtualNetworksClientBeginDeleteOptions contains the optional parameters for the VirtualNetworksClient.BeginDelete @@ -153,7 +153,7 @@ func (client *VirtualNetworksClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deregisters the ScVmm virtual network from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualNetworksClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualNetworkName string, options *VirtualNetworksClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginDelete" @@ -195,7 +195,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -207,7 +207,7 @@ func (client *VirtualNetworksClient) deleteCreateRequest(ctx context.Context, re // Get - Implements VirtualNetwork GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - options - VirtualNetworksClientGetOptions contains the optional parameters for the VirtualNetworksClient.Get method. @@ -253,7 +253,7 @@ func (client *VirtualNetworksClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,7 +270,7 @@ func (client *VirtualNetworksClient) getHandleResponse(resp *http.Response) (Vir // NewListByResourceGroupPager - List of VirtualNetworks in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VirtualNetworksClientListByResourceGroupOptions contains the optional parameters for the VirtualNetworksClient.NewListByResourceGroupPager // method. @@ -313,7 +313,7 @@ func (client *VirtualNetworksClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,7 +330,7 @@ func (client *VirtualNetworksClient) listByResourceGroupHandleResponse(resp *htt // NewListBySubscriptionPager - List of VirtualNetworks in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - VirtualNetworksClientListBySubscriptionOptions contains the optional parameters for the VirtualNetworksClient.NewListBySubscriptionPager // method. func (client *VirtualNetworksClient) NewListBySubscriptionPager(options *VirtualNetworksClientListBySubscriptionOptions) *runtime.Pager[VirtualNetworksClientListBySubscriptionResponse] { @@ -368,7 +368,7 @@ func (client *VirtualNetworksClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,7 +386,7 @@ func (client *VirtualNetworksClient) listBySubscriptionHandleResponse(resp *http // BeginUpdate - Updates the VirtualNetworks resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - virtualNetworkName - Name of the VirtualNetwork. // - properties - The resource properties to be updated. @@ -413,7 +413,7 @@ func (client *VirtualNetworksClient) BeginUpdate(ctx context.Context, resourceGr // Update - Updates the VirtualNetworks resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VirtualNetworksClient) update(ctx context.Context, resourceGroupName string, virtualNetworkName string, properties VirtualNetworkTagsUpdate, options *VirtualNetworksClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VirtualNetworksClient.BeginUpdate" @@ -455,7 +455,7 @@ func (client *VirtualNetworksClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client_example_test.go deleted file mode 100644 index 48165b958265..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/virtualnetworks_client_example_test.go +++ /dev/null @@ -1,500 +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 armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_NewListBySubscriptionPager_virtualNetworksListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListBySubscription_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_NewListBySubscriptionPager_virtualNetworksListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_NewListByResourceGroupPager_virtualNetworksListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListByResourceGroupPager("rgscvmm", 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.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_ListByResourceGroup_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_NewListByResourceGroupPager_virtualNetworksListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVirtualNetworksClient().NewListByResourceGroupPager("rgscvmm", 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.VirtualNetworkListResult = armscvmm.VirtualNetworkListResult{ - // Value: []*armscvmm.VirtualNetwork{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_Get_virtualNetworksGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rgscvmm", "2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Get_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_Get_virtualNetworksGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVirtualNetworksClient().Get(ctx, "rgscvmm", "-", 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.VirtualNetwork = armscvmm.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_virtualNetworksCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rgscvmm", "_", armscvmm.VirtualNetwork{ - Location: to.Ptr("fky"), - Tags: map[string]*string{ - "key705": to.Ptr("apgplvjdyocx"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VirtualNetworkProperties{ - InventoryItemID: to.Ptr("bxn"), - UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_BeginCreateOrUpdate_virtualNetworksCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.VirtualNetwork{ - Location: to.Ptr("fky"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_BeginUpdate_virtualNetworksUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginUpdate(ctx, "rgscvmm", "S", armscvmm.VirtualNetworkTagsUpdate{ - Tags: map[string]*string{ - "key9516": to.Ptr("oxduo"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // Name: to.Ptr("sbeiflgxwzkgt"), - // Type: to.Ptr("oinkkqcuemmcvugnhebckmxeluuulw"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("fky"), - // Tags: map[string]*string{ - // "key705": to.Ptr("apgplvjdyocx"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VirtualNetworkProperties{ - // InventoryItemID: to.Ptr("bxn"), - // NetworkName: to.Ptr("eeqahvnbblsdeeqezqdinggretyeg"), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("12345678-1234-1234-1234-12345678abcd"), - // VmmServerID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Update_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_BeginUpdate_virtualNetworksUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginUpdate(ctx, "rgscvmm", "-", armscvmm.VirtualNetworkTagsUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VirtualNetwork = armscvmm.VirtualNetwork{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualNetworks/virtualNetworkName"), - // Location: to.Ptr("fky"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MaximumSet_Gen.json -func ExampleVirtualNetworksClient_BeginDelete_virtualNetworksDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "rgscvmm", ".", &armscvmm.VirtualNetworksClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VirtualNetworks_Delete_MinimumSet_Gen.json -func ExampleVirtualNetworksClient_BeginDelete_virtualNetworksDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVirtualNetworksClient().BeginDelete(ctx, "rgscvmm", "1", &armscvmm.VirtualNetworksClientBeginDeleteOptions{Force: 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/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go b/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go index e47d239a05b4..5b63a4eb8026 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client.go @@ -41,7 +41,7 @@ func NewVMInstanceHybridIdentityMetadatasClient(credential azcore.TokenCredentia // Get - Implements HybridIdentityMetadata GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VMInstanceHybridIdentityMetadatasClientGetOptions contains the optional parameters for the VMInstanceHybridIdentityMetadatasClient.Get // method. @@ -76,7 +76,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -93,7 +93,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) getHandleResponse(resp *h // NewListByVirtualMachineInstancePager - Returns the list of HybridIdentityMetadata of the given VM. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceURI - The fully qualified Azure Resource manager identifier of the resource. // - options - VMInstanceHybridIdentityMetadatasClientListByVirtualMachineInstanceOptions contains the optional parameters for // the VMInstanceHybridIdentityMetadatasClient.NewListByVirtualMachineInstancePager method. @@ -129,7 +129,7 @@ func (client *VMInstanceHybridIdentityMetadatasClient) listByVirtualMachineInsta return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client_example_test.go deleted file mode 100644 index 28cdf105c571..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/vminstancehybrididentitymetadatas_client_example_test.go +++ /dev/null @@ -1,156 +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 armscvmm_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MaximumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_NewListByVirtualMachineInstancePager_vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", 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.VMInstanceHybridIdentityMetadataListResult = armscvmm.VMInstanceHybridIdentityMetadataListResult{ - // Value: []*armscvmm.VMInstanceHybridIdentityMetadata{ - // { - // Name: to.Ptr("rxvpcegqc"), - // Type: to.Ptr("ixqhymswessvylnqgti"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.VMInstanceHybridIdentityMetadataProperties{ - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // PublicKey: to.Ptr("hijhfxcdjuzidfjjztoh"), - // ResourceUID: to.Ptr("mikbntobifeiouinvsalnu"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_ListByVirtualMachineInstance_MinimumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_NewListByVirtualMachineInstancePager_vmInstanceHybridIdentityMetadatasListByVirtualMachineInstanceMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().NewListByVirtualMachineInstancePager("gtgclehcbsyave", 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.VMInstanceHybridIdentityMetadataListResult = armscvmm.VMInstanceHybridIdentityMetadataListResult{ - // Value: []*armscvmm.VMInstanceHybridIdentityMetadata{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MaximumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_Get_vmInstanceHybridIdentityMetadatasGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().Get(ctx, "gtgclehcbsyave", 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.VMInstanceHybridIdentityMetadata = armscvmm.VMInstanceHybridIdentityMetadata{ - // Name: to.Ptr("rxvpcegqc"), - // Type: to.Ptr("ixqhymswessvylnqgti"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Properties: &armscvmm.VMInstanceHybridIdentityMetadataProperties{ - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // PublicKey: to.Ptr("hijhfxcdjuzidfjjztoh"), - // ResourceUID: to.Ptr("mikbntobifeiouinvsalnu"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmInstanceHybridIdentityMetadatas_Get_MinimumSet_Gen.json -func ExampleVMInstanceHybridIdentityMetadatasClient_Get_vmInstanceHybridIdentityMetadatasGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVMInstanceHybridIdentityMetadatasClient().Get(ctx, "gtgclehcbsyave", 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.VMInstanceHybridIdentityMetadata = armscvmm.VMInstanceHybridIdentityMetadata{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/virtualMachineInstances/default/hybridIdentityMetadata/default"), - // } -} diff --git a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go b/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go index 13f2dad140c1..0fe0192fadfe 100644 --- a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go +++ b/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client.go @@ -46,7 +46,7 @@ func NewVmmServersClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Onboards the SCVmm fabric as an Azure VmmServer resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - resource - Resource create parameters. @@ -73,7 +73,7 @@ func (client *VmmServersClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Onboards the SCVmm fabric as an Azure VmmServer resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VmmServersClient) createOrUpdate(ctx context.Context, resourceGroupName string, vmmServerName string, resource VmmServer, options *VmmServersClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "VmmServersClient.BeginCreateOrUpdate" @@ -115,7 +115,7 @@ func (client *VmmServersClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, resource); err != nil { @@ -127,7 +127,7 @@ func (client *VmmServersClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Removes the SCVmm fabric from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - options - VmmServersClientBeginDeleteOptions contains the optional parameters for the VmmServersClient.BeginDelete method. @@ -152,7 +152,7 @@ func (client *VmmServersClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Removes the SCVmm fabric from Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VmmServersClient) deleteOperation(ctx context.Context, resourceGroupName string, vmmServerName string, options *VmmServersClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "VmmServersClient.BeginDelete" @@ -194,7 +194,7 @@ func (client *VmmServersClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") if options != nil && options.Force != nil { reqQP.Set("force", string(*options.Force)) } @@ -206,7 +206,7 @@ func (client *VmmServersClient) deleteCreateRequest(ctx context.Context, resourc // Get - Implements VmmServer GET method. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - options - VmmServersClientGetOptions contains the optional parameters for the VmmServersClient.Get method. @@ -252,7 +252,7 @@ func (client *VmmServersClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *VmmServersClient) getHandleResponse(resp *http.Response) (VmmServe // NewListByResourceGroupPager - List of VmmServers in a resource group. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - VmmServersClientListByResourceGroupOptions contains the optional parameters for the VmmServersClient.NewListByResourceGroupPager // method. @@ -312,7 +312,7 @@ func (client *VmmServersClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *VmmServersClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - List of VmmServers in a subscription. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - options - VmmServersClientListBySubscriptionOptions contains the optional parameters for the VmmServersClient.NewListBySubscriptionPager // method. func (client *VmmServersClient) NewListBySubscriptionPager(options *VmmServersClientListBySubscriptionOptions) *runtime.Pager[VmmServersClientListBySubscriptionResponse] { @@ -367,7 +367,7 @@ func (client *VmmServersClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -385,7 +385,7 @@ func (client *VmmServersClient) listBySubscriptionHandleResponse(resp *http.Resp // BeginUpdate - Updates the VmmServers resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vmmServerName - Name of the VmmServer. // - properties - The resource properties to be updated. @@ -411,7 +411,7 @@ func (client *VmmServersClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates the VmmServers resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-10-07 +// Generated from API version 2024-06-01 func (client *VmmServersClient) update(ctx context.Context, resourceGroupName string, vmmServerName string, properties VmmServerTagsUpdate, options *VmmServersClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "VmmServersClient.BeginUpdate" @@ -453,7 +453,7 @@ func (client *VmmServersClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-10-07") + reqQP.Set("api-version", "2024-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client_example_test.go b/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client_example_test.go deleted file mode 100644 index e440882550b1..000000000000 --- a/sdk/resourcemanager/scvmm/armscvmm/vmmservers_client_example_test.go +++ /dev/null @@ -1,528 +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 armscvmm_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/scvmm/armscvmm" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MaximumSet_Gen.json -func ExampleVmmServersClient_NewListBySubscriptionPager_vmmServersListBySubscriptionMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListBySubscription_MinimumSet_Gen.json -func ExampleVmmServersClient_NewListBySubscriptionPager_vmmServersListBySubscriptionMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MaximumSet_Gen.json -func ExampleVmmServersClient_NewListByResourceGroupPager_vmmServersListByResourceGroupMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListByResourceGroupPager("rgscvmm", 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.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_ListByResourceGroup_MinimumSet_Gen.json -func ExampleVmmServersClient_NewListByResourceGroupPager_vmmServersListByResourceGroupMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewVmmServersClient().NewListByResourceGroupPager("rgscvmm", 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.VmmServerListResult = armscvmm.VmmServerListResult{ - // Value: []*armscvmm.VmmServer{ - // { - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MaximumSet_Gen.json -func ExampleVmmServersClient_Get_vmmServersGetMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVmmServersClient().Get(ctx, "rgscvmm", ".", 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.VmmServer = armscvmm.VmmServer{ - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Get_MinimumSet_Gen.json -func ExampleVmmServersClient_Get_vmmServersGetMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewVmmServersClient().Get(ctx, "rgscvmm", "D", 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.VmmServer = armscvmm.VmmServer{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MaximumSet_Gen.json -func ExampleVmmServersClient_BeginCreateOrUpdate_vmmServersCreateOrUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginCreateOrUpdate(ctx, "rgscvmm", "-", armscvmm.VmmServer{ - Location: to.Ptr("hslxkyzktvwpqbypvs"), - Tags: map[string]*string{ - "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - }, - ExtendedLocation: &armscvmm.ExtendedLocation{ - Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - Type: to.Ptr("customLocation"), - }, - Properties: &armscvmm.VmmServerProperties{ - Credentials: &armscvmm.VmmCredential{ - Password: to.Ptr("gaecsnkjr"), - Username: to.Ptr("jbuoltypmrgqfi"), - }, - Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - Port: to.Ptr[int32](4), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VmmServer = armscvmm.VmmServer{ - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_CreateOrUpdate_MinimumSet_Gen.json -func ExampleVmmServersClient_BeginCreateOrUpdate_vmmServersCreateOrUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginCreateOrUpdate(ctx, "rgscvmm", "w", armscvmm.VmmServer{ - Location: to.Ptr("hslxkyzktvwpqbypvs"), - ExtendedLocation: &armscvmm.ExtendedLocation{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VmmServer = armscvmm.VmmServer{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MaximumSet_Gen.json -func ExampleVmmServersClient_BeginUpdate_vmmServersUpdateMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginUpdate(ctx, "rgscvmm", "Y", armscvmm.VmmServerTagsUpdate{ - Tags: map[string]*string{ - "key7187": to.Ptr("oktnfvklfchnquelzzdagtpwfskzc"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VmmServer = armscvmm.VmmServer{ - // Name: to.Ptr("gyoxmcbnbbfajvzygtffpaufxxjzs"), - // Type: to.Ptr("nwiimbcjryiggdcbpvrqdnlrklcwbr"), - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // SystemData: &armscvmm.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.094Z"); return t}()), - // CreatedBy: to.Ptr("p"), - // CreatedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-29T22:28:00.095Z"); return t}()), - // LastModifiedBy: to.Ptr("goxcwpyyqlxndquly"), - // LastModifiedByType: to.Ptr(armscvmm.CreatedByTypeUser), - // }, - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // Tags: map[string]*string{ - // "key4834": to.Ptr("vycgfkzjcyyuotwwq"), - // }, - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // Name: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ExtendedLocation/customLocations/customLocationName"), - // Type: to.Ptr("customLocation"), - // }, - // Properties: &armscvmm.VmmServerProperties{ - // ConnectionStatus: to.Ptr("vlmrrigzmutgbzrgjtolnamfxm"), - // Credentials: &armscvmm.VmmCredential{ - // Username: to.Ptr("jbuoltypmrgqfi"), - // }, - // ErrorMessage: to.Ptr("ndkzeiipz"), - // Fqdn: to.Ptr("pvzcjaqrswbvptgx"), - // Port: to.Ptr[int32](4), - // ProvisioningState: to.Ptr(armscvmm.ProvisioningStateSucceeded), - // UUID: to.Ptr("vmwbukuqbuz"), - // Version: to.Ptr("tawfjzbqrlkqzqyomxiahnfqg"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Update_MinimumSet_Gen.json -func ExampleVmmServersClient_BeginUpdate_vmmServersUpdateMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginUpdate(ctx, "rgscvmm", "_", armscvmm.VmmServerTagsUpdate{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.VmmServer = armscvmm.VmmServer{ - // ID: to.Ptr("/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.ScVmm/vmmServers/vmmServerName"), - // Location: to.Ptr("hslxkyzktvwpqbypvs"), - // ExtendedLocation: &armscvmm.ExtendedLocation{ - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MaximumSet_Gen.json -func ExampleVmmServersClient_BeginDelete_vmmServersDeleteMaximumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginDelete(ctx, "rgscvmm", ".", &armscvmm.VmmServersClientBeginDeleteOptions{Force: to.Ptr(armscvmm.ForceDeleteTrue)}) - 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/7753cb8917f0968713c013a1f25875e8bd8dc492/specification/scvmm/resource-manager/Microsoft.ScVmm/stable/2023-10-07/examples/VmmServers_Delete_MinimumSet_Gen.json -func ExampleVmmServersClient_BeginDelete_vmmServersDeleteMinimumSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armscvmm.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewVmmServersClient().BeginDelete(ctx, "rgscvmm", "8", &armscvmm.VmmServersClientBeginDeleteOptions{Force: 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) - } -}