From 777c628503e38b9396f66a9ad55e26e3b49f4d29 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 3 Mar 2023 08:35:08 +0000 Subject: [PATCH] CodeGen from PR 22895 in Azure/azure-rest-api-specs Merge 9c8683d40b71dbc335c7f73137cebefc38c15731 into b92e9b3d716b490304bf0a288fb6ba4a0feed35a --- .../workloads/armworkloads/CHANGELOG.md | 7 + .../workloads/armworkloads/autorest.md | 6 +- .../workloads/armworkloads/client.go | 16 +- .../armworkloads/client_example_test.go | 1194 --- .../workloads/armworkloads/constants.go | 5 +- .../workloads/armworkloads/go.mod | 14 +- .../workloads/armworkloads/go.sum | 21 +- .../workloads/armworkloads/models.go | 48 +- .../workloads/armworkloads/models_serde.go | 8 - .../workloads/armworkloads/monitors_client.go | 28 +- .../monitors_client_example_test.go | 444 - .../armworkloads/operations_client.go | 4 +- .../operations_client_example_test.go | 124 - .../armworkloads/providerinstances_client.go | 20 +- .../providerinstances_client_example_test.go | 1235 --- .../sapapplicationserverinstances_client.go | 38 +- ...tionserverinstances_client_example_test.go | 466 -- .../sapcentralinstances_client.go | 38 +- ...sapcentralinstances_client_example_test.go | 547 -- .../sapdatabaseinstances_client.go | 38 +- ...apdatabaseinstances_client_example_test.go | 386 - .../saplandscapemonitor_client.go | 20 +- ...saplandscapemonitor_client_example_test.go | 361 - .../sapvirtualinstances_client.go | 40 +- ...sapvirtualinstances_client_example_test.go | 7211 ----------------- 25 files changed, 164 insertions(+), 12155 deletions(-) delete mode 100644 sdk/resourcemanager/workloads/armworkloads/client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/monitors_client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/providerinstances_client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client_example_test.go diff --git a/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md b/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md index e5268f84c2b7..8d7452ed5dd9 100644 --- a/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md +++ b/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 1.0.0 (2023-03-03) +### Breaking Changes + +- Field `ExactVersion` of struct `ImageReference` has been removed +- Field `SharedGalleryImageID` of struct `ImageReference` has been removed + + ## 0.3.0 (2023-02-24) ### Breaking Changes diff --git a/sdk/resourcemanager/workloads/armworkloads/autorest.md b/sdk/resourcemanager/workloads/armworkloads/autorest.md index 18c32f1531a0..ae8044e5274f 100644 --- a/sdk/resourcemanager/workloads/armworkloads/autorest.md +++ b/sdk/resourcemanager/workloads/armworkloads/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/workloads/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/workloads/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.3.0 +module-version: 1.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/workloads/armworkloads/client.go b/sdk/resourcemanager/workloads/armworkloads/client.go index fe55f26934a1..3ede4b4e5d89 100644 --- a/sdk/resourcemanager/workloads/armworkloads/client.go +++ b/sdk/resourcemanager/workloads/armworkloads/client.go @@ -58,7 +58,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // SAPAvailabilityZoneDetails - Get the recommended SAP Availability Zone Pair Details for your region. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - location - The name of Azure region. // - options - ClientSAPAvailabilityZoneDetailsOptions contains the optional parameters for the Client.SAPAvailabilityZoneDetails // method. @@ -93,7 +93,7 @@ func (client *Client) sapAvailabilityZoneDetailsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SAPAvailabilityZoneDetails != nil { @@ -114,7 +114,7 @@ func (client *Client) sapAvailabilityZoneDetailsHandleResponse(resp *http.Respon // SAPDiskConfigurations - Get the SAP Disk Configuration Layout prod/non-prod SAP System. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - location - The name of Azure region. // - options - ClientSAPDiskConfigurationsOptions contains the optional parameters for the Client.SAPDiskConfigurations method. func (client *Client) SAPDiskConfigurations(ctx context.Context, location string, options *ClientSAPDiskConfigurationsOptions) (ClientSAPDiskConfigurationsResponse, error) { @@ -148,7 +148,7 @@ func (client *Client) sapDiskConfigurationsCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SAPDiskConfigurations != nil { @@ -170,7 +170,7 @@ func (client *Client) sapDiskConfigurationsHandleResponse(resp *http.Response) ( // for database tier // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - location - The name of Azure region. // - options - ClientSAPSizingRecommendationsOptions contains the optional parameters for the Client.SAPSizingRecommendations // method. @@ -205,7 +205,7 @@ func (client *Client) sapSizingRecommendationsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SAPSizingRecommendation != nil { @@ -226,7 +226,7 @@ func (client *Client) sapSizingRecommendationsHandleResponse(resp *http.Response // SAPSupportedSKU - Get a list of SAP supported SKUs for ASCS, Application and Database tier. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - location - The name of Azure region. // - options - ClientSAPSupportedSKUOptions contains the optional parameters for the Client.SAPSupportedSKU method. func (client *Client) SAPSupportedSKU(ctx context.Context, location string, options *ClientSAPSupportedSKUOptions) (ClientSAPSupportedSKUResponse, error) { @@ -260,7 +260,7 @@ func (client *Client) sapSupportedSKUCreateRequest(ctx context.Context, location return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SAPSupportedSKU != nil { diff --git a/sdk/resourcemanager/workloads/armworkloads/client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/client_example_test.go deleted file mode 100644 index c2d325e01650..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/client_example_test.go +++ /dev/null @@ -1,1194 +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 armworkloads_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json -func ExampleClient_SAPSizingRecommendations_sapSizingRecommendationsS4HanaDistributed() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPSizingRecommendations(ctx, "centralus", &armworkloads.ClientSAPSizingRecommendationsOptions{SAPSizingRecommendation: 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 = armworkloads.ClientSAPSizingRecommendationsResponse{ - // SAPSizingRecommendationResultClassification: &armworkloads.ThreeTierRecommendationResult{ - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServerInstanceCount: to.Ptr[int64](2), - // ApplicationServerVMSKU: to.Ptr("Standard_E8ds_v4"), - // CentralServerInstanceCount: to.Ptr[int64](1), - // CentralServerVMSKU: to.Ptr("Standard_E4ds_v4"), - // DatabaseInstanceCount: to.Ptr[int64](1), - // DbVMSKU: to.Ptr("Standard_M64s"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvSet.json -func ExampleClient_SAPSizingRecommendations_sapSizingRecommendationsS4HanaDistributedHaAvSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPSizingRecommendations(ctx, "centralus", &armworkloads.ClientSAPSizingRecommendationsOptions{SAPSizingRecommendation: 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 = armworkloads.ClientSAPSizingRecommendationsResponse{ - // SAPSizingRecommendationResultClassification: &armworkloads.ThreeTierRecommendationResult{ - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServerInstanceCount: to.Ptr[int64](3), - // ApplicationServerVMSKU: to.Ptr("Standard_E16ds_v4"), - // CentralServerInstanceCount: to.Ptr[int64](2), - // CentralServerVMSKU: to.Ptr("Standard_E8ds_v4"), - // DatabaseInstanceCount: to.Ptr[int64](2), - // DbVMSKU: to.Ptr("Standard_M64s"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_HA_AvZone.json -func ExampleClient_SAPSizingRecommendations_sapSizingRecommendationsS4HanaDistributedHaAvZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPSizingRecommendations(ctx, "centralus", &armworkloads.ClientSAPSizingRecommendationsOptions{SAPSizingRecommendation: 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 = armworkloads.ClientSAPSizingRecommendationsResponse{ - // SAPSizingRecommendationResultClassification: &armworkloads.ThreeTierRecommendationResult{ - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServerInstanceCount: to.Ptr[int64](6), - // ApplicationServerVMSKU: to.Ptr("Standard_E8ds_v4"), - // CentralServerInstanceCount: to.Ptr[int64](2), - // CentralServerVMSKU: to.Ptr("Standard_E4ds_v4"), - // DatabaseInstanceCount: to.Ptr[int64](2), - // DbVMSKU: to.Ptr("Standard_M64s"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_SingleServer.json -func ExampleClient_SAPSizingRecommendations_sapSizingRecommendationsS4HanaSingleServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPSizingRecommendations(ctx, "centralus", &armworkloads.ClientSAPSizingRecommendationsOptions{SAPSizingRecommendation: 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 = armworkloads.ClientSAPSizingRecommendationsResponse{ - // SAPSizingRecommendationResultClassification: &armworkloads.SingleServerRecommendationResult{ - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - // VMSKU: to.Ptr("Standard_M128s"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_Distributed.json -func ExampleClient_SAPSupportedSKU_sapSupportedSkusDistributed() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPSupportedSKU(ctx, "centralus", &armworkloads.ClientSAPSupportedSKUOptions{SAPSupportedSKU: 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.SAPSupportedResourceSKUsResult = armworkloads.SAPSupportedResourceSKUsResult{ - // SupportedSKUs: []*armworkloads.SAPSupportedSKU{ - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E4ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E8ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E16ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E20ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E32ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E48ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E64ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M32Is"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M32ts"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M64Is"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M64ms"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M64s"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M128ms"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M128s"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M208ms_v2"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M208s_v2"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M416ms_v2"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M416s_v2"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvSet.json -func ExampleClient_SAPSupportedSKU_sapSupportedSkusDistributedHaAvSet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPSupportedSKU(ctx, "centralus", &armworkloads.ClientSAPSupportedSKUOptions{SAPSupportedSKU: 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.SAPSupportedResourceSKUsResult = armworkloads.SAPSupportedResourceSKUsResult{ - // SupportedSKUs: []*armworkloads.SAPSupportedSKU{ - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E4ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E8ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E16ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E20ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E32ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E48ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E64ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M32Is"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M32ts"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M64Is"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M64ms"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M64s"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M128ms"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M128s"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M208ms_v2"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M208s_v2"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M416ms_v2"), - // }, - // { - // IsAppServerCertified: to.Ptr(false), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M416s_v2"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_DistributedHA_AvZone.json -func ExampleClient_SAPSupportedSKU_sapSupportedSkusDistributedHaAvZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPSupportedSKU(ctx, "centralus", &armworkloads.ClientSAPSupportedSKUOptions{SAPSupportedSKU: 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.SAPSupportedResourceSKUsResult = armworkloads.SAPSupportedResourceSKUsResult{ - // SupportedSKUs: []*armworkloads.SAPSupportedSKU{ - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_E32ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_E48ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_E64ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M32Is"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M32ts"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M64Is"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M64ms"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M64s"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M128ms"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M128s"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M208ms_v2"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M208s_v2"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M416ms_v2"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M416s_v2"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPSupportedSkus_SingleServer.json -func ExampleClient_SAPSupportedSKU_sapSupportedSkusSingleServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPSupportedSKU(ctx, "centralus", &armworkloads.ClientSAPSupportedSKUOptions{SAPSupportedSKU: 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.SAPSupportedResourceSKUsResult = armworkloads.SAPSupportedResourceSKUsResult{ - // SupportedSKUs: []*armworkloads.SAPSupportedSKU{ - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E32ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E48ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(false), - // VMSKU: to.Ptr("Standard_E64ds_v4"), - // }, - // { - // IsAppServerCertified: to.Ptr(true), - // IsDatabaseCertified: to.Ptr(true), - // VMSKU: to.Ptr("Standard_M32ts"), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json -func ExampleClient_SAPDiskConfigurations_sapDiskConfigurationsNonProd() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPDiskConfigurations(ctx, "centralus", &armworkloads.ClientSAPDiskConfigurationsOptions{SAPDiskConfigurations: 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.SAPDiskConfigurationsResult = armworkloads.SAPDiskConfigurationsResult{ - // VolumeConfigurations: map[string]*armworkloads.SAPDiskConfiguration{ - // "backup": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](2), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("E10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](6), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](0), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("E15"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](6), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](0), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("E20"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](6), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](0), - // SizeGB: to.Ptr[int64](512), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](6), - // MbpsReadWrite: to.Ptr[int64](100), - // MinimumSupportedDiskCount: to.Ptr[int64](0), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P15"), - // IopsReadWrite: to.Ptr[int64](1100), - // MaximumSupportedDiskCount: to.Ptr[int64](6), - // MbpsReadWrite: to.Ptr[int64](125), - // MinimumSupportedDiskCount: to.Ptr[int64](0), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P20"), - // IopsReadWrite: to.Ptr[int64](2300), - // MaximumSupportedDiskCount: to.Ptr[int64](6), - // MbpsReadWrite: to.Ptr[int64](150), - // MinimumSupportedDiskCount: to.Ptr[int64](0), - // SizeGB: to.Ptr[int64](512), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }}, - // }, - // "hana/data": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](4), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](5), - // MbpsReadWrite: to.Ptr[int64](100), - // MinimumSupportedDiskCount: to.Ptr[int64](4), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }}, - // }, - // "hana/log": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](3), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](5), - // MbpsReadWrite: to.Ptr[int64](100), - // MinimumSupportedDiskCount: to.Ptr[int64](3), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }}, - // }, - // "hana/shared": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P15"), - // IopsReadWrite: to.Ptr[int64](1100), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](125), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P20"), - // IopsReadWrite: to.Ptr[int64](2300), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](150), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](512), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P30"), - // IopsReadWrite: to.Ptr[int64](5000), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](200), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](1024), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P40"), - // IopsReadWrite: to.Ptr[int64](7500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](250), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](2048), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P50"), - // IopsReadWrite: to.Ptr[int64](7500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](250), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](4096), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("E15"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("E20"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](512), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("E30"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](1024), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("E40"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](2048), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("E50"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](4096), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }}, - // }, - // "os": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](64), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P6"), - // IopsReadWrite: to.Ptr[int64](240), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](50), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](64), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](100), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P6"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](64), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }}, - // }, - // "usr/sap": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](100), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](1100), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](125), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](2300), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](150), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](512), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("E10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("E15"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("E20"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](60), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](512), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_Prod.json -func ExampleClient_SAPDiskConfigurations_sapDiskConfigurationsProd() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPDiskConfigurations(ctx, "centralus", &armworkloads.ClientSAPDiskConfigurationsOptions{SAPDiskConfigurations: 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.SAPDiskConfigurationsResult = armworkloads.SAPDiskConfigurationsResult{ - // VolumeConfigurations: map[string]*armworkloads.SAPDiskConfiguration{ - // "backup": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](2), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](6), - // MbpsReadWrite: to.Ptr[int64](100), - // MinimumSupportedDiskCount: to.Ptr[int64](0), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P15"), - // IopsReadWrite: to.Ptr[int64](1100), - // MaximumSupportedDiskCount: to.Ptr[int64](6), - // MbpsReadWrite: to.Ptr[int64](125), - // MinimumSupportedDiskCount: to.Ptr[int64](0), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P20"), - // IopsReadWrite: to.Ptr[int64](2300), - // MaximumSupportedDiskCount: to.Ptr[int64](6), - // MbpsReadWrite: to.Ptr[int64](150), - // MinimumSupportedDiskCount: to.Ptr[int64](0), - // SizeGB: to.Ptr[int64](512), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }}, - // }, - // "hana/data": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](4), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](5), - // MbpsReadWrite: to.Ptr[int64](100), - // MinimumSupportedDiskCount: to.Ptr[int64](4), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }}, - // }, - // "hana/log": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](3), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](5), - // MbpsReadWrite: to.Ptr[int64](100), - // MinimumSupportedDiskCount: to.Ptr[int64](3), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }}, - // }, - // "hana/shared": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P15"), - // IopsReadWrite: to.Ptr[int64](1100), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](125), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P20"), - // IopsReadWrite: to.Ptr[int64](2300), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](150), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](512), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P30"), - // IopsReadWrite: to.Ptr[int64](5000), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](200), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](1024), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P40"), - // IopsReadWrite: to.Ptr[int64](7500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](250), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](2048), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P50"), - // IopsReadWrite: to.Ptr[int64](7500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](250), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](4096), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }}, - // }, - // "os": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](64), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P6"), - // IopsReadWrite: to.Ptr[int64](240), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](50), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](64), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](100), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }}, - // }, - // "usr/sap": &armworkloads.SAPDiskConfiguration{ - // RecommendedConfiguration: &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // SupportedConfigurations: []*armworkloads.DiskDetails{ - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](500), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](100), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](1100), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](125), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // { - // DiskTier: to.Ptr("P10"), - // IopsReadWrite: to.Ptr[int64](2300), - // MaximumSupportedDiskCount: to.Ptr[int64](1), - // MbpsReadWrite: to.Ptr[int64](150), - // MinimumSupportedDiskCount: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](512), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json -func ExampleClient_SAPAvailabilityZoneDetails_sapAvailabilityZoneDetailsEastus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPAvailabilityZoneDetails(ctx, "centralus", &armworkloads.ClientSAPAvailabilityZoneDetailsOptions{SAPAvailabilityZoneDetails: 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.SAPAvailabilityZoneDetailsResult = armworkloads.SAPAvailabilityZoneDetailsResult{ - // AvailabilityZonePairs: []*armworkloads.SAPAvailabilityZonePair{ - // { - // ZoneA: to.Ptr[int64](1), - // ZoneB: to.Ptr[int64](2), - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_northeurope.json -func ExampleClient_SAPAvailabilityZoneDetails_sapAvailabilityZoneDetailsNortheurope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.SAPAvailabilityZoneDetails(ctx, "centralus", &armworkloads.ClientSAPAvailabilityZoneDetailsOptions{SAPAvailabilityZoneDetails: 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.SAPAvailabilityZoneDetailsResult = armworkloads.SAPAvailabilityZoneDetailsResult{ - // AvailabilityZonePairs: []*armworkloads.SAPAvailabilityZonePair{ - // { - // ZoneA: to.Ptr[int64](2), - // ZoneB: to.Ptr[int64](3), - // }}, - // } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/constants.go b/sdk/resourcemanager/workloads/armworkloads/constants.go index 5056ccc2abda..5b0180bf7ff0 100644 --- a/sdk/resourcemanager/workloads/armworkloads/constants.go +++ b/sdk/resourcemanager/workloads/armworkloads/constants.go @@ -11,7 +11,7 @@ package armworkloads const ( moduleName = "armworkloads" - moduleVersion = "v0.3.0" + moduleVersion = "v1.0.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -352,8 +352,7 @@ func PossibleSAPHealthStateValues() []SAPHealthState { } } -// SAPHighAvailabilityType - The high availability Type. AvailabilitySet guarantees 99.95% availability. Availability Zone -// guarantees 99.99% availability. +// SAPHighAvailabilityType - The high availability type (AvailabilitySet or AvailabilityZone). type SAPHighAvailabilityType string const ( diff --git a/sdk/resourcemanager/workloads/armworkloads/go.mod b/sdk/resourcemanager/workloads/armworkloads/go.mod index 815f75d4ecb9..e0313be1193b 100644 --- a/sdk/resourcemanager/workloads/armworkloads/go.mod +++ b/sdk/resourcemanager/workloads/armworkloads/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworklo go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/workloads/armworkloads/go.sum b/sdk/resourcemanager/workloads/armworkloads/go.sum index 67cfef6bdf6e..3afb578030a5 100644 --- a/sdk/resourcemanager/workloads/armworkloads/go.sum +++ b/sdk/resourcemanager/workloads/armworkloads/go.sum @@ -1,30 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1 h1:T8quHYlUGyb/oqtSTwqlCr1ilJHrDv+ZtpSfo+hm1BU= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.1/go.mod h1:gLa1CL2RNE4s7M3yopJ/p0iq5DdY6Yv5ZUt9MTRZOQM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1 h1:oPdPEZFSbl7oSPEAIPMPBMUmiL+mqgzBJwM/9qYcwNg= -github.com/AzureAD/microsoft-authentication-library-for-go v0.8.1/go.mod h1:4qFor3D/HDsvBME35Xy9rwW9DecL+M2sNw1ybjPtwA0= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/workloads/armworkloads/models.go b/sdk/resourcemanager/workloads/armworkloads/models.go index 24e1d9d18ea5..5c215e554428 100644 --- a/sdk/resourcemanager/workloads/armworkloads/models.go +++ b/sdk/resourcemanager/workloads/armworkloads/models.go @@ -109,12 +109,15 @@ type ClientSAPSupportedSKUOptions struct { SAPSupportedSKU *SAPSupportedSKUsRequest } -// CreateAndMountFileShareConfiguration - Gets or sets the file share configuration for file share created with the VIS case. +// CreateAndMountFileShareConfiguration - Gets or sets the file share configuration where the transport directory fileshare +// is created and mounted as a part of the create infra flow. Please pre-create the resource group you intend to place +// the transport directory in. The storage account and fileshare will be auto-created by the ACSS and doesn’t need to pre-created. type CreateAndMountFileShareConfiguration struct { // REQUIRED; The type of file share config. ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` - // The name of file share resource group. The app rg is used in case of missing input. + // The name of transport file share resource group. This should be pre created by the customer. The app rg is used in case + // of missing input. ResourceGroup *string `json:"resourceGroup,omitempty"` // The name of file share storage account name . A custom name is used in case of missing input. @@ -317,14 +320,14 @@ type DiskDetails struct { // The minimum supported disk count. MinimumSupportedDiskCount *int64 `json:"minimumSupportedDiskCount,omitempty"` - // The disk sku. + // The type of disk sku. For example, StandardLRS, StandardZRS, PremiumLRS, PremiumZRS. SKU *DiskSKU `json:"sku,omitempty"` // The disk size in GB. SizeGB *int64 `json:"sizeGB,omitempty"` } -// DiskSKU - The disk sku. +// DiskSKU - The type of disk sku. For example, StandardLRS, StandardZRS, PremiumLRS, PremiumZRS. type DiskSKU struct { // Defines the disk sku name. Name *DiskSKUName `json:"name,omitempty"` @@ -572,20 +575,12 @@ type ImageReference struct { // The image SKU. SKU *string `json:"sku,omitempty"` - // Specified the shared gallery image unique id for vm deployment. This can be fetched from shared gallery image GET call. - SharedGalleryImageID *string `json:"sharedGalleryImageId,omitempty"` - // Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats // are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. // Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image // will not automatically update after deploy time even if a new version becomes // available. Version *string `json:"version,omitempty"` - - // READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual - // machine. This readonly field differs from 'version', only if the value specified in - // 'version' field is 'latest'. - ExactVersion *string `json:"exactVersion,omitempty" azure:"ro"` } // InfrastructureConfigurationClassification provides polymorphic access to related types. @@ -692,7 +687,7 @@ type Monitor struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Managed service identity (user assigned identities) + // [currently not in use] Managed service identity(user assigned identities) Identity *UserAssignedServiceIdentity `json:"identity,omitempty"` // SAP monitor properties @@ -809,7 +804,8 @@ type MonitorsClientUpdateOptions struct { // placeholder for future optional parameters } -// MountFileShareConfiguration - Gets or sets the file share configuration for externally mounted cases. +// MountFileShareConfiguration - Gets or sets the file share configuration where the transport directory fileshare already +// exists, and user wishes to mount the fileshare as a part of the create infra flow. type MountFileShareConfiguration struct { // REQUIRED; The type of file share config. ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` @@ -1160,7 +1156,7 @@ func (p *PrometheusOSProviderInstanceProperties) GetProviderSpecificProperties() // ProviderInstance - A provider instance associated with SAP monitor. type ProviderInstance struct { - // Managed service identity (user assigned identities) + // [currently not in use] Managed service identity(user assigned identities) Identity *UserAssignedServiceIdentity `json:"identity,omitempty"` // Provider Instance properties @@ -1190,7 +1186,7 @@ type ProviderInstanceListResult struct { // ProviderInstanceProperties - Describes the properties of a provider instance. type ProviderInstanceProperties struct { - // Defines the provider instance errors. + // Defines the provider specific properties. ProviderSettings ProviderSpecificPropertiesClassification `json:"providerSettings,omitempty"` // READ-ONLY; Defines the provider instance errors. @@ -1866,7 +1862,8 @@ type SAPVirtualInstance struct { // REQUIRED; Defines the Virtual Instance for SAP solutions resource properties. Properties *SAPVirtualInstanceProperties `json:"properties,omitempty"` - // Managed service identity (user assigned identities) + // A pre-created user assigned identity with appropriate roles assigned. To learn more on identity and roles required, visit + // the ACSS how-to-guide. Identity *UserAssignedServiceIdentity `json:"identity,omitempty"` // Resource tags. @@ -2191,7 +2188,8 @@ type SharedStorageResourceNames struct { SharedStorageAccountPrivateEndPointName *string `json:"sharedStorageAccountPrivateEndPointName,omitempty"` } -// SingleServerConfiguration - Gets or sets the single server configuration. +// SingleServerConfiguration - Gets or sets the single server configuration. For prerequisites for creating the infrastructure, +// please see here [https://go.microsoft.com/fwlink/?linkid=2212611&clcid=0x409] type SingleServerConfiguration struct { // REQUIRED; The application resource group where SAP system resources will be deployed. AppResourceGroup *string `json:"appResourceGroup,omitempty"` @@ -2280,7 +2278,8 @@ func (s *SingleServerRecommendationResult) GetSAPSizingRecommendationResult() *S } } -// SkipFileShareConfiguration - Gets or sets the skip file share configuration +// SkipFileShareConfiguration - Gets or sets the file share configuration for scenarios where transport directory fileshare +// is not created or required. type SkipFileShareConfiguration struct { // REQUIRED; The type of file share config. ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` @@ -2360,7 +2359,8 @@ type Tags struct { Tags map[string]*string `json:"tags,omitempty"` } -// ThreeTierConfiguration - Gets or sets the three tier SAP configuration. +// ThreeTierConfiguration - Gets or sets the three tier SAP configuration. For prerequisites for creating the infrastructure, +// please see here [https://go.microsoft.com/fwlink/?linkid=2212611&clcid=0x409] type ThreeTierConfiguration struct { // REQUIRED; The application resource group where SAP system resources will be deployed. AppResourceGroup *string `json:"appResourceGroup,omitempty"` @@ -2502,7 +2502,7 @@ type TrackedResource struct { // UpdateMonitorRequest - Defines the request body for updating SAP monitor resource. type UpdateMonitorRequest struct { - // Managed service identity (user assigned identities) + // [currently not in use] Managed service identity(user assigned identities) Identity *UserAssignedServiceIdentity `json:"identity,omitempty"` // Gets or sets the Resource tags. @@ -2529,7 +2529,8 @@ type UpdateSAPDatabaseInstanceRequest struct { // UpdateSAPVirtualInstanceRequest - Defines the request body for updating Virtual Instance for SAP. type UpdateSAPVirtualInstanceRequest struct { - // Managed service identity (user assigned identities) + // A pre-created user assigned identity with appropriate roles assigned. To learn more on identity and roles required, visit + // the ACSS how-to-guide. Identity *UserAssignedServiceIdentity `json:"identity,omitempty"` // Gets or sets the Resource tags. @@ -2545,7 +2546,8 @@ type UserAssignedIdentity struct { PrincipalID *string `json:"principalId,omitempty" azure:"ro"` } -// UserAssignedServiceIdentity - Managed service identity (user assigned identities) +// UserAssignedServiceIdentity - A pre-created user assigned identity with appropriate roles assigned. To learn more on identity +// and roles required, visit the ACSS how-to-guide. type UserAssignedServiceIdentity struct { // REQUIRED; Type of manage identity Type *ManagedServiceIdentityType `json:"type,omitempty"` diff --git a/sdk/resourcemanager/workloads/armworkloads/models_serde.go b/sdk/resourcemanager/workloads/armworkloads/models_serde.go index 18860633e802..970297adbfc9 100644 --- a/sdk/resourcemanager/workloads/armworkloads/models_serde.go +++ b/sdk/resourcemanager/workloads/armworkloads/models_serde.go @@ -1242,11 +1242,9 @@ func (h *HighAvailabilitySoftwareConfiguration) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ImageReference. func (i ImageReference) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "exactVersion", i.ExactVersion) populate(objectMap, "offer", i.Offer) populate(objectMap, "publisher", i.Publisher) populate(objectMap, "sku", i.SKU) - populate(objectMap, "sharedGalleryImageId", i.SharedGalleryImageID) populate(objectMap, "version", i.Version) return json.Marshal(objectMap) } @@ -1260,9 +1258,6 @@ func (i *ImageReference) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "exactVersion": - err = unpopulate(val, "ExactVersion", &i.ExactVersion) - delete(rawMsg, key) case "offer": err = unpopulate(val, "Offer", &i.Offer) delete(rawMsg, key) @@ -1272,9 +1267,6 @@ func (i *ImageReference) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &i.SKU) delete(rawMsg, key) - case "sharedGalleryImageId": - err = unpopulate(val, "SharedGalleryImageID", &i.SharedGalleryImageID) - delete(rawMsg, key) case "version": err = unpopulate(val, "Version", &i.Version) delete(rawMsg, key) diff --git a/sdk/resourcemanager/workloads/armworkloads/monitors_client.go b/sdk/resourcemanager/workloads/armworkloads/monitors_client.go index 54966f777a06..c82e7fab7432 100644 --- a/sdk/resourcemanager/workloads/armworkloads/monitors_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/monitors_client.go @@ -58,7 +58,7 @@ func NewMonitorsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreate - Creates a SAP monitor for the specified subscription, resource group, and resource name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - monitorParameter - Request body representing a SAP monitor @@ -80,7 +80,7 @@ func (client *MonitorsClient) BeginCreate(ctx context.Context, resourceGroupName // Create - Creates a SAP monitor for the specified subscription, resource group, and resource name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *MonitorsClient) create(ctx context.Context, resourceGroupName string, monitorName string, monitorParameter Monitor, options *MonitorsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, monitorParameter, options) if err != nil { @@ -116,7 +116,7 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, monitorParameter) @@ -125,7 +125,7 @@ func (client *MonitorsClient) createCreateRequest(ctx context.Context, resourceG // BeginDelete - Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - options - MonitorsClientBeginDeleteOptions contains the optional parameters for the MonitorsClient.BeginDelete method. @@ -146,7 +146,7 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a SAP monitor with the specified subscription, resource group, and SAP monitor name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *MonitorsClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, options *MonitorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, options) if err != nil { @@ -182,7 +182,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *MonitorsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets properties of a SAP monitor for the specified subscription, resource group, and resource name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - options - MonitorsClientGetOptions contains the optional parameters for the MonitorsClient.Get method. @@ -230,7 +230,7 @@ func (client *MonitorsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *MonitorsClient) getHandleResponse(resp *http.Response) (MonitorsCl // NewListPager - Gets a list of SAP monitors in the specified subscription. The operations returns various properties of // each SAP monitor. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - options - MonitorsClientListOptions contains the optional parameters for the MonitorsClient.NewListPager method. func (client *MonitorsClient) NewListPager(options *MonitorsClientListOptions) *runtime.Pager[MonitorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[MonitorsClientListResponse]{ @@ -290,7 +290,7 @@ func (client *MonitorsClient) listCreateRequest(ctx context.Context, options *Mo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,7 +307,7 @@ func (client *MonitorsClient) listHandleResponse(resp *http.Response) (MonitorsC // NewListByResourceGroupPager - Gets a list of SAP monitors in the specified resource group. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.NewListByResourceGroupPager // method. @@ -355,7 +355,7 @@ func (client *MonitorsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,7 +373,7 @@ func (client *MonitorsClient) listByResourceGroupHandleResponse(resp *http.Respo // Update - Patches the Tags field of a SAP monitor for the specified subscription, resource group, and SAP monitor name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - body - The Update SAP workload monitor request body. @@ -413,7 +413,7 @@ func (client *MonitorsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/workloads/armworkloads/monitors_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/monitors_client_example_test.go deleted file mode 100644 index 779c67e8171d..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/monitors_client_example_test.go +++ /dev/null @@ -1,444 +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 armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_List.json -func ExampleMonitorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.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.MonitorListResult = armworkloads.MonitorListResult{ - // Value: []*armworkloads.Monitor{ - // { - // Name: to.Ptr("mySapMonitor1"), - // Type: to.Ptr("Microsoft.Workloads/workloads"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armworkloads.MonitorProperties{ - // AppLocation: to.Ptr("eastus"), - // Errors: &armworkloads.MonitorPropertiesErrors{ - // }, - // LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("myManagedRg1"), - // }, - // MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // MsiArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myMsi"), - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // RoutingPreference: to.Ptr(armworkloads.RoutingPreferenceRouteAll), - // StorageAccountArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"), - // ZoneRedundancyPreference: to.Ptr("ZoneRedundantApp"), - // }, - // }, - // { - // Name: to.Ptr("mySapMonitor2"), - // Type: to.Ptr("Microsoft.Workloads/workloads"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armworkloads.MonitorProperties{ - // AppLocation: to.Ptr("westus"), - // Errors: &armworkloads.MonitorPropertiesErrors{ - // }, - // LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("myManagedRg2"), - // }, - // MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // MsiArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myMsi"), - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // RoutingPreference: to.Ptr(armworkloads.RoutingPreferenceDefault), - // StorageAccountArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_ListByRG.json -func ExampleMonitorsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("example-rg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.MonitorListResult = armworkloads.MonitorListResult{ - // Value: []*armworkloads.Monitor{ - // { - // Name: to.Ptr("mySapMonitor1"), - // Type: to.Ptr("Microsoft.Workloads/workloads"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Workloads/monitors/mySapMonitor1"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armworkloads.MonitorProperties{ - // AppLocation: to.Ptr("eastus"), - // Errors: &armworkloads.MonitorPropertiesErrors{ - // }, - // LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/example-rg/providers/microsoft.operationalinsights/workspaces/myWorkspace"), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("myManagedRg1"), - // }, - // MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // MsiArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myMsi"), - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // RoutingPreference: to.Ptr(armworkloads.RoutingPreferenceRouteAll), - // StorageAccountArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"), - // ZoneRedundancyPreference: to.Ptr("ZoneRedundantApp"), - // }, - // }, - // { - // Name: to.Ptr("mySapMonitor2"), - // Type: to.Ptr("Microsoft.Workloads/workloads"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Workloads/workloads/mySapMonitor2"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armworkloads.MonitorProperties{ - // AppLocation: to.Ptr("westus"), - // Errors: &armworkloads.MonitorPropertiesErrors{ - // }, - // LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/example-rg/providers/microsoft.operationalinsights/workspaces/myWorkspace"), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("myManagedRg2"), - // }, - // MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // MsiArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myMsi"), - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // RoutingPreference: to.Ptr(armworkloads.RoutingPreferenceDefault), - // StorageAccountArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_Get.json -func ExampleMonitorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "mySapMonitor", 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.Monitor = armworkloads.Monitor{ - // Name: to.Ptr("mySapMonitor1"), - // Type: to.Ptr("Microsoft.Workloads/workloads"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armworkloads.MonitorProperties{ - // AppLocation: to.Ptr("eastus"), - // Errors: &armworkloads.MonitorPropertiesErrors{ - // }, - // LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("myManagedRg"), - // }, - // MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // MsiArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myMsi"), - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // RoutingPreference: to.Ptr(armworkloads.RoutingPreferenceRouteAll), - // StorageAccountArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"), - // ZoneRedundancyPreference: to.Ptr("ZoneRedundantApp"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_Create.json -func ExampleMonitorsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", armworkloads.Monitor{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "key": to.Ptr("value"), - }, - Properties: &armworkloads.MonitorProperties{ - AppLocation: to.Ptr("westus"), - LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"), - ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - Name: to.Ptr("myManagedRg"), - }, - MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - RoutingPreference: to.Ptr(armworkloads.RoutingPreferenceRouteAll), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Monitor = armworkloads.Monitor{ - // Name: to.Ptr("mySapMonitor"), - // Type: to.Ptr("Microsoft.Workloads/workloads"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "key": to.Ptr("value"), - // }, - // Properties: &armworkloads.MonitorProperties{ - // AppLocation: to.Ptr("eastus"), - // Errors: &armworkloads.MonitorPropertiesErrors{ - // }, - // LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("myManagedRg"), - // }, - // MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // MsiArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myMsi"), - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // RoutingPreference: to.Ptr(armworkloads.RoutingPreferenceRouteAll), - // StorageAccountArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"), - // ZoneRedundancyPreference: to.Ptr("ZoneRedundantApp"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_Delete.json -func ExampleMonitorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "mySapMonitor", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("1e4193c3-206e-4916-b124-1da16175eb0f"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/operations/locations/westus/1e4193c3-206e-4916-b124-1da16175eb0f"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_PatchTags_Delete.json -func ExampleMonitorsClient_Update_deleteTagsFieldOfASapMonitor() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "myResourceGroup", "mySapMonitor", armworkloads.UpdateMonitorRequest{ - Identity: &armworkloads.UserAssignedServiceIdentity{ - Type: to.Ptr(armworkloads.ManagedServiceIdentityTypeNone), - }, - Tags: map[string]*string{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Monitor = armworkloads.Monitor{ - // Name: to.Ptr("mySapMonitor"), - // Type: to.Ptr("Microsoft.Workloads/workloads"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("testvalue"), - // }, - // Identity: &armworkloads.UserAssignedServiceIdentity{ - // Type: to.Ptr(armworkloads.ManagedServiceIdentityTypeNone), - // }, - // Properties: &armworkloads.MonitorProperties{ - // AppLocation: to.Ptr("eastus"), - // Errors: &armworkloads.MonitorPropertiesErrors{ - // }, - // LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("myManagedRg"), - // }, - // MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // MsiArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myMsi"), - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // RoutingPreference: to.Ptr(armworkloads.RoutingPreferenceRouteAll), - // StorageAccountArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"), - // ZoneRedundancyPreference: to.Ptr("ZoneRedundantApp"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/monitors_PatchTags.json -func ExampleMonitorsClient_Update_updateTagsFieldOfASapMonitor() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewMonitorsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "myResourceGroup", "mySapMonitor", armworkloads.UpdateMonitorRequest{ - Identity: &armworkloads.UserAssignedServiceIdentity{ - Type: to.Ptr(armworkloads.ManagedServiceIdentityTypeNone), - }, - Tags: map[string]*string{ - "testkey": to.Ptr("testvalue"), - }, - }, 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.Monitor = armworkloads.Monitor{ - // Name: to.Ptr("mySapMonitor"), - // Type: to.Ptr("Microsoft.Workloads/workloads"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "testkey": to.Ptr("testvalue"), - // }, - // Identity: &armworkloads.UserAssignedServiceIdentity{ - // Type: to.Ptr(armworkloads.ManagedServiceIdentityTypeNone), - // }, - // Properties: &armworkloads.MonitorProperties{ - // AppLocation: to.Ptr("eastus"), - // Errors: &armworkloads.MonitorPropertiesErrors{ - // }, - // LogAnalyticsWorkspaceArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.operationalinsights/workspaces/myWorkspace"), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("myManagedRg"), - // }, - // MonitorSubnet: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"), - // MsiArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myMsi"), - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // RoutingPreference: to.Ptr(armworkloads.RoutingPreferenceRouteAll), - // StorageAccountArmID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageaccount"), - // ZoneRedundancyPreference: to.Ptr("ZoneRedundantApp"), - // }, - // } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/operations_client.go b/sdk/resourcemanager/workloads/armworkloads/operations_client.go index 0c5a58e3e09c..e707adc452e1 100644 --- a/sdk/resourcemanager/workloads/armworkloads/operations_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/operations_client.go @@ -51,7 +51,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all the available API operations under this PR // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-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]{ @@ -89,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/workloads/armworkloads/operations_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/operations_client_example_test.go deleted file mode 100644 index 184ff285cb11..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/operations_client_example_test.go +++ /dev/null @@ -1,124 +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 armworkloads_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.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 = armworkloads.OperationListResult{ - // Value: []*armworkloads.Operation{ - // { - // Name: to.Ptr("Microsoft.Workloads/phpWorkloads/Write"), - // Display: &armworkloads.OperationDisplay{ - // Description: to.Ptr("Set phpWorkloads"), - // Operation: to.Ptr("Creates or updates the phpWorkloads"), - // Provider: to.Ptr("Microsoft.Workloads"), - // Resource: to.Ptr("phpWorkloads"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Workloads/phpWorkloads/Delete"), - // Display: &armworkloads.OperationDisplay{ - // Description: to.Ptr("Delete phpWorkloads"), - // Operation: to.Ptr("Deletes the phpWorkloads"), - // Provider: to.Ptr("Microsoft.Workloads"), - // Resource: to.Ptr("phpWorkloads"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Workloads/phpWorkloads/Read"), - // Display: &armworkloads.OperationDisplay{ - // Description: to.Ptr("Read phpWorkloads"), - // Operation: to.Ptr("Reads the phpWorkloads"), - // Provider: to.Ptr("Microsoft.Workloads"), - // Resource: to.Ptr("phpWorkloads"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Workloads/phpWorkloads/wordpressInstances/Write"), - // Display: &armworkloads.OperationDisplay{ - // Description: to.Ptr("Set wordpressInstances"), - // Operation: to.Ptr("Creates or updates the wordpressInstances"), - // Provider: to.Ptr("Microsoft.Workloads"), - // Resource: to.Ptr("wordpressInstances"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Workloads/phpWorkloads/wordpressInstances/Delete"), - // Display: &armworkloads.OperationDisplay{ - // Description: to.Ptr("Delete wordpressInstances"), - // Operation: to.Ptr("Deletes the wordpressInstances"), - // Provider: to.Ptr("Microsoft.Workloads"), - // Resource: to.Ptr("wordpressInstances"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Workloads/phpWorkloads/wordpressInstances/Read"), - // Display: &armworkloads.OperationDisplay{ - // Description: to.Ptr("Read wordpressInstances"), - // Operation: to.Ptr("Reads the wordpressInstances"), - // Provider: to.Ptr("Microsoft.Workloads"), - // Resource: to.Ptr("wordpressInstances"), - // }, - // IsDataAction: to.Ptr(false), - // }, - // { - // Name: to.Ptr("Microsoft.Workloads/monitors/Read"), - // Display: &armworkloads.OperationDisplay{ - // Description: to.Ptr("Reads the Monitor workload."), - // Operation: to.Ptr("Read"), - // Provider: to.Ptr("Microsoft.Workloads"), - // Resource: to.Ptr("Microsoft.Workloads/monitors"), - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Workloads/monitors/Write"), - // Display: &armworkloads.OperationDisplay{ - // Description: to.Ptr("Creates or updates a Monitor workload."), - // Operation: to.Ptr("Read"), - // Provider: to.Ptr("Microsoft.Workloads"), - // Resource: to.Ptr("Microsoft.Workloads/monitors"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go index ae930dbc8b08..7c78bbd0f6fb 100644 --- a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go @@ -59,7 +59,7 @@ func NewProviderInstancesClient(subscriptionID string, credential azcore.TokenCr // name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - providerInstanceName - Name of the provider instance. @@ -83,7 +83,7 @@ func (client *ProviderInstancesClient) BeginCreate(ctx context.Context, resource // Create - Creates a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *ProviderInstancesClient) create(ctx context.Context, resourceGroupName string, monitorName string, providerInstanceName string, providerInstanceParameter ProviderInstance, options *ProviderInstancesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, monitorName, providerInstanceName, providerInstanceParameter, options) if err != nil { @@ -123,7 +123,7 @@ func (client *ProviderInstancesClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, providerInstanceParameter) @@ -133,7 +133,7 @@ func (client *ProviderInstancesClient) createCreateRequest(ctx context.Context, // name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - providerInstanceName - Name of the provider instance. @@ -156,7 +156,7 @@ func (client *ProviderInstancesClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a provider instance for the specified subscription, resource group, SAP monitor name, and resource name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *ProviderInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, monitorName string, providerInstanceName string, options *ProviderInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, monitorName, providerInstanceName, options) if err != nil { @@ -196,7 +196,7 @@ func (client *ProviderInstancesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -206,7 +206,7 @@ func (client *ProviderInstancesClient) deleteCreateRequest(ctx context.Context, // name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - providerInstanceName - Name of the provider instance. @@ -250,7 +250,7 @@ func (client *ProviderInstancesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -268,7 +268,7 @@ func (client *ProviderInstancesClient) getHandleResponse(resp *http.Response) (P // NewListPager - Gets a list of provider instances in the specified SAP monitor. The operations returns various properties // of each provider instances. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - options - ProviderInstancesClientListOptions contains the optional parameters for the ProviderInstancesClient.NewListPager @@ -321,7 +321,7 @@ func (client *ProviderInstancesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/providerinstances_client_example_test.go deleted file mode 100644 index 4e45734b6fe8..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client_example_test.go +++ /dev/null @@ -1,1235 +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 armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/ProviderInstances_List.json -func ExampleProviderInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", "mySapMonitor", 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.ProviderInstanceListResult = armworkloads.ProviderInstanceListResult{ - // Value: []*armworkloads.ProviderInstance{ - // { - // Name: to.Ptr("myProviderInstance1"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance1"), - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.HanaDbProviderInstanceProperties{ - // ProviderType: to.Ptr("SapHana"), - // DbName: to.Ptr("db"), - // DbPasswordURI: to.Ptr(""), - // DbUsername: to.Ptr("user"), - // Hostname: to.Ptr("name"), - // InstanceNumber: to.Ptr("00"), - // SapSid: to.Ptr("SID"), - // SQLPort: to.Ptr("0000"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLHostNameInCertificate: to.Ptr("xyz.domain.com"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("myProviderInstance2"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance1"), - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.SapNetWeaverProviderInstanceProperties{ - // ProviderType: to.Ptr("SapNetWeaver"), - // SapClientID: to.Ptr("111"), - // SapHostFileEntries: []*string{ - // to.Ptr("127.0.0.1 name fqdn")}, - // SapHostname: to.Ptr("name"), - // SapInstanceNr: to.Ptr("00"), - // SapPasswordURI: to.Ptr(""), - // SapPortNumber: to.Ptr("1234"), - // SapSid: to.Ptr("SID"), - // SapUsername: to.Ptr("username"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("myProviderInstance4"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance1"), - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.MsSQLServerProviderInstanceProperties{ - // ProviderType: to.Ptr("MsSqlServer"), - // DbPort: to.Ptr("5912"), - // DbUsername: to.Ptr("user"), - // Hostname: to.Ptr("hostname"), - // SapSid: to.Ptr("sid"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("myProviderInstance3"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance1"), - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.PrometheusOSProviderInstanceProperties{ - // ProviderType: to.Ptr("PrometheusOS"), - // PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - // SapSid: to.Ptr("SID"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("myProviderInstance3"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance1"), - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.PrometheusHaClusterProviderInstanceProperties{ - // ProviderType: to.Ptr("PrometheusHaCluster"), - // ClusterName: to.Ptr("clusterName"), - // Hostname: to.Ptr("hostname"), - // PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - // Sid: to.Ptr("sid"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("myProviderInstance3"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance1"), - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.DB2ProviderInstanceProperties{ - // ProviderType: to.Ptr("Db2"), - // DbName: to.Ptr("OPA"), - // DbPasswordURI: to.Ptr(""), - // DbPort: to.Ptr("5912"), - // DbUsername: to.Ptr("Db2OPA"), - // Hostname: to.Ptr("vmname.azure.com"), - // SapSid: to.Ptr("SID"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/Db2ProviderInstances_Get.json -func ExampleProviderInstancesClient_Get_getPropertiesOfADb2Provider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.DB2ProviderInstanceProperties{ - // ProviderType: to.Ptr("Db2"), - // DbName: to.Ptr("OPA"), - // DbPasswordURI: to.Ptr(""), - // DbPort: to.Ptr("5912"), - // DbUsername: to.Ptr("Db2OPA"), - // Hostname: to.Ptr("vmname.azure.com"), - // SapSid: to.Ptr("SID"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Get.json -func ExampleProviderInstancesClient_Get_getPropertiesOfAMsSqlServerProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.MsSQLServerProviderInstanceProperties{ - // ProviderType: to.Ptr("MsSqlServer"), - // DbPasswordURI: to.Ptr(""), - // DbPort: to.Ptr("5912"), - // DbUsername: to.Ptr("user"), - // Hostname: to.Ptr("hostname"), - // SapSid: to.Ptr("sid"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusOSProviderInstances_Get.json -func ExampleProviderInstancesClient_Get_getPropertiesOfAOsProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.PrometheusOSProviderInstanceProperties{ - // ProviderType: to.Ptr("PrometheusOS"), - // PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - // SapSid: to.Ptr("SID"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Get.json -func ExampleProviderInstancesClient_Get_getPropertiesOfAPrometheusHaClusterProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.PrometheusHaClusterProviderInstanceProperties{ - // ProviderType: to.Ptr("PrometheusHaCluster"), - // ClusterName: to.Ptr("clusterName"), - // Hostname: to.Ptr("hostname"), - // PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - // Sid: to.Ptr("sid"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/ProviderInstances_Get.json -func ExampleProviderInstancesClient_Get_getPropertiesOfASapMonitorHanaProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.HanaDbProviderInstanceProperties{ - // ProviderType: to.Ptr("SapHana"), - // DbName: to.Ptr("db"), - // DbPasswordURI: to.Ptr(""), - // DbUsername: to.Ptr("user"), - // Hostname: to.Ptr("name"), - // InstanceNumber: to.Ptr("00"), - // SapSid: to.Ptr("SID"), - // SQLPort: to.Ptr("0000"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLHostNameInCertificate: to.Ptr("xyz.domain.com"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/NetWeaverProviderInstances_Get.json -func ExampleProviderInstancesClient_Get_getPropertiesOfASapMonitorNetWeaverProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", 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.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.SapNetWeaverProviderInstanceProperties{ - // ProviderType: to.Ptr("SapNetWeaver"), - // SapClientID: to.Ptr("111"), - // SapHostFileEntries: []*string{ - // to.Ptr("127.0.0.1 name fqdn")}, - // SapHostname: to.Ptr("name"), - // SapInstanceNr: to.Ptr("00"), - // SapPasswordURI: to.Ptr(""), - // SapPortNumber: to.Ptr("1234"), - // SapSid: to.Ptr("SID"), - // SapUsername: to.Ptr("username"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/Db2ProviderInstances_Create.json -func ExampleProviderInstancesClient_BeginCreate_createADb2Provider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.DB2ProviderInstanceProperties{ - ProviderType: to.Ptr("Db2"), - DbName: to.Ptr("dbName"), - DbPassword: to.Ptr("password"), - DbPasswordURI: to.Ptr(""), - DbPort: to.Ptr("dbPort"), - DbUsername: to.Ptr("username"), - Hostname: to.Ptr("hostname"), - SapSid: to.Ptr("SID"), - SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.DB2ProviderInstanceProperties{ - // ProviderType: to.Ptr("Db2"), - // DbName: to.Ptr("OPA"), - // DbPasswordURI: to.Ptr(""), - // DbPort: to.Ptr("5912"), - // DbUsername: to.Ptr("Db2OPA"), - // Hostname: to.Ptr("vmname.azure.com"), - // SapSid: to.Ptr("SID"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/Db2ProviderInstances_Create_Root_Certificate.json -func ExampleProviderInstancesClient_BeginCreate_createADb2ProviderWithRootCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.DB2ProviderInstanceProperties{ - ProviderType: to.Ptr("Db2"), - DbName: to.Ptr("dbName"), - DbPassword: to.Ptr("password"), - DbPasswordURI: to.Ptr(""), - DbPort: to.Ptr("dbPort"), - DbUsername: to.Ptr("username"), - Hostname: to.Ptr("hostname"), - SapSid: to.Ptr("SID"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.DB2ProviderInstanceProperties{ - // ProviderType: to.Ptr("Db2"), - // DbName: to.Ptr("OPA"), - // DbPasswordURI: to.Ptr(""), - // DbPort: to.Ptr("5912"), - // DbUsername: to.Ptr("Db2OPA"), - // Hostname: to.Ptr("vmname.azure.com"), - // SapSid: to.Ptr("SID"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Create.json -func ExampleProviderInstancesClient_BeginCreate_createAMsSqlServerProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.MsSQLServerProviderInstanceProperties{ - ProviderType: to.Ptr("MsSqlServer"), - DbPassword: to.Ptr("****"), - DbPasswordURI: to.Ptr(""), - DbPort: to.Ptr("5912"), - DbUsername: to.Ptr("user"), - Hostname: to.Ptr("hostname"), - SapSid: to.Ptr("sid"), - SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.MsSQLServerProviderInstanceProperties{ - // ProviderType: to.Ptr("MsSqlServer"), - // DbPort: to.Ptr("5912"), - // DbUsername: to.Ptr("user"), - // Hostname: to.Ptr("hostname"), - // SapSid: to.Ptr("sid"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/MsSqlServerProviderInstance_Create_Root_Certificate.json -func ExampleProviderInstancesClient_BeginCreate_createAMsSqlServerProviderWithRootCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.MsSQLServerProviderInstanceProperties{ - ProviderType: to.Ptr("MsSqlServer"), - DbPassword: to.Ptr("****"), - DbPasswordURI: to.Ptr(""), - DbPort: to.Ptr("5912"), - DbUsername: to.Ptr("user"), - Hostname: to.Ptr("hostname"), - SapSid: to.Ptr("sid"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.MsSQLServerProviderInstanceProperties{ - // ProviderType: to.Ptr("MsSqlServer"), - // DbPort: to.Ptr("5912"), - // DbUsername: to.Ptr("user"), - // Hostname: to.Ptr("hostname"), - // SapSid: to.Ptr("sid"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusOSProviderInstances_Create.json -func ExampleProviderInstancesClient_BeginCreate_createAOsProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.PrometheusOSProviderInstanceProperties{ - ProviderType: to.Ptr("PrometheusOS"), - PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - SapSid: to.Ptr("SID"), - SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.PrometheusOSProviderInstanceProperties{ - // ProviderType: to.Ptr("PrometheusOS"), - // PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - // SapSid: to.Ptr("SID"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusOSProviderInstances_Create_Root_Certificate.json -func ExampleProviderInstancesClient_BeginCreate_createAOsProviderWithRootCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.PrometheusOSProviderInstanceProperties{ - ProviderType: to.Ptr("PrometheusOS"), - PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - SapSid: to.Ptr("SID"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.PrometheusOSProviderInstanceProperties{ - // ProviderType: to.Ptr("PrometheusOS"), - // PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - // SapSid: to.Ptr("SID"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create.json -func ExampleProviderInstancesClient_BeginCreate_createAPrometheusHaClusterProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.PrometheusHaClusterProviderInstanceProperties{ - ProviderType: to.Ptr("PrometheusHaCluster"), - ClusterName: to.Ptr("clusterName"), - Hostname: to.Ptr("hostname"), - PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - Sid: to.Ptr("sid"), - SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.PrometheusHaClusterProviderInstanceProperties{ - // ProviderType: to.Ptr("PrometheusHaCluster"), - // ClusterName: to.Ptr("clusterName"), - // Hostname: to.Ptr("hostname"), - // PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - // Sid: to.Ptr("sid"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/PrometheusHaClusterProviderInstances_Create_Root_Certificate.json -func ExampleProviderInstancesClient_BeginCreate_createAPrometheusHaClusterProviderWithRootCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.PrometheusHaClusterProviderInstanceProperties{ - ProviderType: to.Ptr("PrometheusHaCluster"), - ClusterName: to.Ptr("clusterName"), - Hostname: to.Ptr("hostname"), - PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - Sid: to.Ptr("sid"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.PrometheusHaClusterProviderInstanceProperties{ - // ProviderType: to.Ptr("PrometheusHaCluster"), - // ClusterName: to.Ptr("clusterName"), - // Hostname: to.Ptr("hostname"), - // PrometheusURL: to.Ptr("http://192.168.0.0:9090/metrics"), - // Sid: to.Ptr("sid"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/ProviderInstances_Create.json -func ExampleProviderInstancesClient_BeginCreate_createASapMonitorHanaProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.HanaDbProviderInstanceProperties{ - ProviderType: to.Ptr("SapHana"), - DbName: to.Ptr("db"), - DbPassword: to.Ptr("****"), - DbPasswordURI: to.Ptr(""), - DbUsername: to.Ptr("user"), - Hostname: to.Ptr("name"), - InstanceNumber: to.Ptr("00"), - SapSid: to.Ptr("SID"), - SQLPort: to.Ptr("0000"), - SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - SSLHostNameInCertificate: to.Ptr("xyz.domain.com"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.HanaDbProviderInstanceProperties{ - // ProviderType: to.Ptr("SapHana"), - // DbName: to.Ptr("db"), - // DbPasswordURI: to.Ptr(""), - // DbUsername: to.Ptr("user"), - // Hostname: to.Ptr("name"), - // InstanceNumber: to.Ptr("00"), - // SapSid: to.Ptr("SID"), - // SQLPort: to.Ptr("0000"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLHostNameInCertificate: to.Ptr("xyz.domain.com"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/ProviderInstances_Create_Root_Certificate.json -func ExampleProviderInstancesClient_BeginCreate_createASapMonitorHanaProviderWithRootCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.HanaDbProviderInstanceProperties{ - ProviderType: to.Ptr("SapHana"), - DbName: to.Ptr("db"), - DbPassword: to.Ptr("****"), - DbPasswordURI: to.Ptr(""), - DbUsername: to.Ptr("user"), - Hostname: to.Ptr("name"), - InstanceNumber: to.Ptr("00"), - SapSid: to.Ptr("SID"), - SQLPort: to.Ptr("0000"), - SSLHostNameInCertificate: to.Ptr("xyz.domain.com"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.HanaDbProviderInstanceProperties{ - // ProviderType: to.Ptr("SapHana"), - // DbName: to.Ptr("db"), - // DbPasswordURI: to.Ptr(""), - // DbUsername: to.Ptr("user"), - // Hostname: to.Ptr("name"), - // InstanceNumber: to.Ptr("00"), - // SapSid: to.Ptr("SID"), - // SQLPort: to.Ptr("0000"), - // SSLHostNameInCertificate: to.Ptr("xyz.domain.com"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/NetWeaverProviderInstances_Create.json -func ExampleProviderInstancesClient_BeginCreate_createASapMonitorNetWeaverProvider() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.SapNetWeaverProviderInstanceProperties{ - ProviderType: to.Ptr("SapNetWeaver"), - SapClientID: to.Ptr("111"), - SapHostFileEntries: []*string{ - to.Ptr("127.0.0.1 name fqdn")}, - SapHostname: to.Ptr("name"), - SapInstanceNr: to.Ptr("00"), - SapPassword: to.Ptr("****"), - SapPasswordURI: to.Ptr(""), - SapPortNumber: to.Ptr("1234"), - SapSid: to.Ptr("SID"), - SapUsername: to.Ptr("username"), - SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.SapNetWeaverProviderInstanceProperties{ - // ProviderType: to.Ptr("SapNetWeaver"), - // SapClientID: to.Ptr("111"), - // SapHostFileEntries: []*string{ - // to.Ptr("127.0.0.1 name fqdn")}, - // SapHostname: to.Ptr("name"), - // SapInstanceNr: to.Ptr("00"), - // SapPasswordURI: to.Ptr(""), - // SapPortNumber: to.Ptr("1234"), - // SapSid: to.Ptr("SID"), - // SapUsername: to.Ptr("username"), - // SSLCertificateURI: to.Ptr("https://storageaccount.blob.core.windows.net/containername/filename"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceServerCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/NetWeaverProviderInstances_Create_Root_Certificate.json -func ExampleProviderInstancesClient_BeginCreate_createASapMonitorNetWeaverProviderWithRootCertificate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", armworkloads.ProviderInstance{ - Properties: &armworkloads.ProviderInstanceProperties{ - ProviderSettings: &armworkloads.SapNetWeaverProviderInstanceProperties{ - ProviderType: to.Ptr("SapNetWeaver"), - SapClientID: to.Ptr("111"), - SapHostFileEntries: []*string{ - to.Ptr("127.0.0.1 name fqdn")}, - SapHostname: to.Ptr("name"), - SapInstanceNr: to.Ptr("00"), - SapPassword: to.Ptr("****"), - SapPasswordURI: to.Ptr(""), - SapPortNumber: to.Ptr("1234"), - SapSid: to.Ptr("SID"), - SapUsername: to.Ptr("username"), - SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProviderInstance = armworkloads.ProviderInstance{ - // Name: to.Ptr("myProviderInstance"), - // Type: to.Ptr("Microsoft.Workloads/workloads/providerInstances"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/workloads/mySapMonitor/providerInstances/myProviderInstance"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.ProviderInstanceProperties{ - // ProviderSettings: &armworkloads.SapNetWeaverProviderInstanceProperties{ - // ProviderType: to.Ptr("SapNetWeaver"), - // SapClientID: to.Ptr("111"), - // SapHostFileEntries: []*string{ - // to.Ptr("127.0.0.1 name fqdn")}, - // SapHostname: to.Ptr("name"), - // SapInstanceNr: to.Ptr("00"), - // SapPasswordURI: to.Ptr(""), - // SapPortNumber: to.Ptr("1234"), - // SapSid: to.Ptr("SID"), - // SapUsername: to.Ptr("username"), - // SSLPreference: to.Ptr(armworkloads.SSLPreferenceRootCertificate), - // }, - // ProvisioningState: to.Ptr(armworkloads.WorkloadMonitorProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/ProviderInstances_Delete.json -func ExampleProviderInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewProviderInstancesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "myResourceGroup", "mySapMonitor", "myProviderInstance", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("1e4193c3-206e-4916-b124-1da16175eb0f"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/operations/locations/westus/1e4193c3-206e-4916-b124-1da16175eb0f"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go index f38a1eb5e974..050e71c40738 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go @@ -59,7 +59,7 @@ func NewSAPApplicationServerInstancesClient(subscriptionID string, credential az // This will be used by service only. PUT by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - applicationInstanceName - The name of SAP Application Server instance resource. @@ -84,7 +84,7 @@ func (client *SAPApplicationServerInstancesClient) BeginCreate(ctx context.Conte // This will be used by service only. PUT by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPApplicationServerInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body SAPApplicationServerInstance, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, options) if err != nil { @@ -124,7 +124,7 @@ func (client *SAPApplicationServerInstancesClient) createCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -134,7 +134,7 @@ func (client *SAPApplicationServerInstancesClient) createCreateRequest(ctx conte // This operation will be used by service only. Delete by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - applicationInstanceName - The name of SAP Application Server instance resource. @@ -158,7 +158,7 @@ func (client *SAPApplicationServerInstancesClient) BeginDelete(ctx context.Conte // This operation will be used by service only. Delete by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPApplicationServerInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { @@ -198,7 +198,7 @@ func (client *SAPApplicationServerInstancesClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +207,7 @@ func (client *SAPApplicationServerInstancesClient) deleteCreateRequest(ctx conte // Get - Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - applicationInstanceName - The name of SAP Application Server instance resource. @@ -252,7 +252,7 @@ func (client *SAPApplicationServerInstancesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *SAPApplicationServerInstancesClient) getHandleResponse(resp *http. // NewListPager - Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - options - SAPApplicationServerInstancesClientListOptions contains the optional parameters for the SAPApplicationServerInstancesClient.NewListPager @@ -322,7 +322,7 @@ func (client *SAPApplicationServerInstancesClient) listCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,7 +340,7 @@ func (client *SAPApplicationServerInstancesClient) listHandleResponse(resp *http // BeginStartInstance - Starts the SAP Application Server Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - applicationInstanceName - The name of SAP Application Server instance resource. @@ -363,7 +363,7 @@ func (client *SAPApplicationServerInstancesClient) BeginStartInstance(ctx contex // StartInstance - Starts the SAP Application Server Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPApplicationServerInstancesClient) startInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginStartInstanceOptions) (*http.Response, error) { req, err := client.startInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { @@ -403,7 +403,7 @@ func (client *SAPApplicationServerInstancesClient) startInstanceCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -412,7 +412,7 @@ func (client *SAPApplicationServerInstancesClient) startInstanceCreateRequest(ct // BeginStopInstance - Stops the SAP Application Server Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - applicationInstanceName - The name of SAP Application Server instance resource. @@ -435,7 +435,7 @@ func (client *SAPApplicationServerInstancesClient) BeginStopInstance(ctx context // StopInstance - Stops the SAP Application Server Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPApplicationServerInstancesClient) stopInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginStopInstanceOptions) (*http.Response, error) { req, err := client.stopInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { @@ -475,7 +475,7 @@ func (client *SAPApplicationServerInstancesClient) stopInstanceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -487,7 +487,7 @@ func (client *SAPApplicationServerInstancesClient) stopInstanceCreateRequest(ctx // BeginUpdate - Puts the SAP Application Server Instance resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - applicationInstanceName - The name of SAP Application Server instance resource. @@ -511,7 +511,7 @@ func (client *SAPApplicationServerInstancesClient) BeginUpdate(ctx context.Conte // Update - Puts the SAP Application Server Instance resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPApplicationServerInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body UpdateSAPApplicationInstanceRequest, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, options) if err != nil { @@ -551,7 +551,7 @@ func (client *SAPApplicationServerInstancesClient) updateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client_example_test.go deleted file mode 100644 index d017bcec5e34..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client_example_test.go +++ /dev/null @@ -1,466 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Get.json -func ExampleSAPApplicationServerInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "test-rg", "X00", "app01", 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.SAPApplicationServerInstance = armworkloads.SAPApplicationServerInstance{ - // Name: to.Ptr("app01"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/applicationInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/applicationInstances/app01"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPApplicationServerProperties{ - // GatewayPort: to.Ptr[int64](3300), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // Hostname: to.Ptr("vh-nw1"), - // IcmHTTPPort: to.Ptr[int64](3312), - // IcmHTTPSPort: to.Ptr[int64](3313), - // InstanceNo: to.Ptr("00"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // VMDetails: []*armworkloads.ApplicationServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.ApplicationServerVirtualMachineTypeActive), - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/app01-vm"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Create_HA_AvSet.json -func ExampleSAPApplicationServerInstancesClient_BeginCreate_createSapApplicationServerInstancesForHaSystemWithAvailabilitySet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", "app01", armworkloads.SAPApplicationServerInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPApplicationServerProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPApplicationServerInstance = armworkloads.SAPApplicationServerInstance{ - // Name: to.Ptr("app01"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/applicationInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/applicationInstances/app01"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPApplicationServerProperties{ - // GatewayPort: to.Ptr[int64](3300), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // Hostname: to.Ptr("vh-nw1"), - // IcmHTTPPort: to.Ptr[int64](3312), - // IcmHTTPSPort: to.Ptr[int64](3313), - // InstanceNo: to.Ptr("01"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // LoadBalancerDetails: &armworkloads.LoadBalancerDetails{ - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Network/loadBalancers/cs-loadBalancer"), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // VMDetails: []*armworkloads.ApplicationServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.ApplicationServerVirtualMachineTypeActive), - // StorageDetails: []*armworkloads.StorageInformation{ - // { - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/nfsstorageaccount"), - // }}, - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/cs-vm1"), - // }, - // { - // Type: to.Ptr(armworkloads.ApplicationServerVirtualMachineTypeStandby), - // StorageDetails: []*armworkloads.StorageInformation{ - // { - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/nfsstorageaccount"), - // }}, - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/cs-vm2"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Create.json -func ExampleSAPApplicationServerInstancesClient_BeginCreate_sapApplicationServerInstancesCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", "app01", armworkloads.SAPApplicationServerInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPApplicationServerProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPApplicationServerInstance = armworkloads.SAPApplicationServerInstance{ - // Name: to.Ptr("app01"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/applicationInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/applicationInstances/app01"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPApplicationServerProperties{ - // GatewayPort: to.Ptr[int64](3300), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // Hostname: to.Ptr("vh-nw1"), - // IcmHTTPPort: to.Ptr[int64](3312), - // IcmHTTPSPort: to.Ptr[int64](3313), - // InstanceNo: to.Ptr("01"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // VMDetails: []*armworkloads.ApplicationServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.ApplicationServerVirtualMachineTypeActive), - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/app01-vm"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Update.json -func ExampleSAPApplicationServerInstancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "test-rg", "X00", "app01", armworkloads.UpdateSAPApplicationInstanceRequest{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPApplicationServerInstance = armworkloads.SAPApplicationServerInstance{ - // Name: to.Ptr("app01"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/applicationInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/applicationInstances/app01"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPApplicationServerProperties{ - // GatewayPort: to.Ptr[int64](3300), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // Hostname: to.Ptr("vh-nw1"), - // IcmHTTPPort: to.Ptr[int64](3312), - // IcmHTTPSPort: to.Ptr[int64](3313), - // InstanceNo: to.Ptr("01"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // VMDetails: []*armworkloads.ApplicationServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.ApplicationServerVirtualMachineTypeActive), - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/app01-vm"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Delete.json -func ExampleSAPApplicationServerInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "test-rg", "X00", "app01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("1e4193c3-206e-4916-b124-1da16175eb0e"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/operations/locations/centralus/1e4193c3-206e-4916-b124-1da16175eb0e"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_List.json -func ExampleSAPApplicationServerInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("test-rg", "X00", 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.SAPApplicationServerInstanceList = armworkloads.SAPApplicationServerInstanceList{ - // Value: []*armworkloads.SAPApplicationServerInstance{ - // { - // Name: to.Ptr("app01"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/applicationInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/applicationInstances/app01"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPApplicationServerProperties{ - // GatewayPort: to.Ptr[int64](3300), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // Hostname: to.Ptr("vh-nw1"), - // IcmHTTPPort: to.Ptr[int64](3312), - // IcmHTTPSPort: to.Ptr[int64](3313), - // InstanceNo: to.Ptr("00"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // VMDetails: []*armworkloads.ApplicationServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.ApplicationServerVirtualMachineTypeActive), - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/app01-vm"), - // }}, - // }, - // }, - // { - // Name: to.Ptr("app02"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/applicationInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/applicationInstances/app02"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPApplicationServerProperties{ - // GatewayPort: to.Ptr[int64](3300), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // Hostname: to.Ptr("vh-nw1"), - // IcmHTTPPort: to.Ptr[int64](3312), - // IcmHTTPSPort: to.Ptr[int64](3313), - // InstanceNo: to.Ptr("01"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // VMDetails: []*armworkloads.ApplicationServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.ApplicationServerVirtualMachineTypeActive), - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/app01-vm"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_StartInstance.json -func ExampleSAPApplicationServerInstancesClient_BeginStartInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStartInstance(ctx, "test-rg", "X00", "app01", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("app01"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/applicationInstances/app01"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_StopInstance.json -func ExampleSAPApplicationServerInstancesClient_BeginStopInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPApplicationServerInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStopInstance(ctx, "test-rg", "X00", "app01", &armworkloads.SAPApplicationServerInstancesClientBeginStopInstanceOptions{Body: &armworkloads.StopRequest{ - SoftStopTimeoutSeconds: to.Ptr[int64](0), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("app01"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/applicationInstances/app01"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go index 83e4c554b218..5fe071d4b9e2 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go @@ -59,7 +59,7 @@ func NewSAPCentralInstancesClient(subscriptionID string, credential azcore.Token // This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. @@ -84,7 +84,7 @@ func (client *SAPCentralInstancesClient) BeginCreate(ctx context.Context, resour // This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPCentralInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body SAPCentralServerInstance, options *SAPCentralInstancesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, options) if err != nil { @@ -124,7 +124,7 @@ func (client *SAPCentralInstancesClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -136,7 +136,7 @@ func (client *SAPCentralInstancesClient) createCreateRequest(ctx context.Context // resource, using the delete operation on it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. @@ -162,7 +162,7 @@ func (client *SAPCentralInstancesClient) BeginDelete(ctx context.Context, resour // resource, using the delete operation on it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPCentralInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { @@ -202,7 +202,7 @@ func (client *SAPCentralInstancesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -211,7 +211,7 @@ func (client *SAPCentralInstancesClient) deleteCreateRequest(ctx context.Context // Get - Gets the SAP Central Services Instance resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. @@ -255,7 +255,7 @@ func (client *SAPCentralInstancesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +272,7 @@ func (client *SAPCentralInstancesClient) getHandleResponse(resp *http.Response) // NewListPager - Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - options - SAPCentralInstancesClientListOptions contains the optional parameters for the SAPCentralInstancesClient.NewListPager @@ -325,7 +325,7 @@ func (client *SAPCentralInstancesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -343,7 +343,7 @@ func (client *SAPCentralInstancesClient) listHandleResponse(resp *http.Response) // BeginStartInstance - Starts the SAP Central Services Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. @@ -366,7 +366,7 @@ func (client *SAPCentralInstancesClient) BeginStartInstance(ctx context.Context, // StartInstance - Starts the SAP Central Services Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPCentralInstancesClient) startInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginStartInstanceOptions) (*http.Response, error) { req, err := client.startInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { @@ -406,7 +406,7 @@ func (client *SAPCentralInstancesClient) startInstanceCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -415,7 +415,7 @@ func (client *SAPCentralInstancesClient) startInstanceCreateRequest(ctx context. // BeginStopInstance - Stops the SAP Central Services Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. @@ -438,7 +438,7 @@ func (client *SAPCentralInstancesClient) BeginStopInstance(ctx context.Context, // StopInstance - Stops the SAP Central Services Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPCentralInstancesClient) stopInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginStopInstanceOptions) (*http.Response, error) { req, err := client.stopInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { @@ -478,7 +478,7 @@ func (client *SAPCentralInstancesClient) stopInstanceCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -491,7 +491,7 @@ func (client *SAPCentralInstancesClient) stopInstanceCreateRequest(ctx context.C // This can be used to update tags on the resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - centralInstanceName - Central Services Instance resource name string modeled as parameter for auto generation to work correctly. @@ -516,7 +516,7 @@ func (client *SAPCentralInstancesClient) BeginUpdate(ctx context.Context, resour // This can be used to update tags on the resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPCentralInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body UpdateSAPCentralInstanceRequest, options *SAPCentralInstancesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, options) if err != nil { @@ -556,7 +556,7 @@ func (client *SAPCentralInstancesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client_example_test.go deleted file mode 100644 index 5656fe75c1e0..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client_example_test.go +++ /dev/null @@ -1,547 +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 armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Get.json -func ExampleSAPCentralInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "test-rg", "X00", "centralServer", 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.SAPCentralServerInstance = armworkloads.SAPCentralServerInstance{ - // Name: to.Ptr("centralServer"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/centralInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/centralInstances/centralServer"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPCentralServerProperties{ - // EnqueueReplicationServerProperties: &armworkloads.EnqueueReplicationServerProperties{ - // ErsVersion: to.Ptr(armworkloads.EnqueueReplicationServerTypeEnqueueReplicator1), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ers1"), - // InstanceNo: to.Ptr("00"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // }, - // EnqueueServerProperties: &armworkloads.EnqueueServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // Hostname: to.Ptr("vh-ascs1"), - // IPAddress: to.Ptr("10.0.0.5"), - // Port: to.Ptr[int64](3600), - // }, - // GatewayServerProperties: &armworkloads.GatewayServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateDegraded), - // Port: to.Ptr[int64](3300), - // }, - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // InstanceNo: to.Ptr("00"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // MessageServerProperties: &armworkloads.MessageServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateUnhealthy), - // Hostname: to.Ptr("vh-ascs1"), - // HTTPPort: to.Ptr[int64](8100), - // HTTPSPort: to.Ptr[int64](44400), - // InternalMsPort: to.Ptr[int64](3900), - // IPAddress: to.Ptr("10.0.0.5"), - // MSPort: to.Ptr[int64](3600), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // VMDetails: []*armworkloads.CentralServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.CentralServerVirtualMachineTypePrimary), - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/cs-vm"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Create_HA_AvSet.json -func ExampleSAPCentralInstancesClient_BeginCreate_createSapCentralInstancesForHaSystemWithAvailabilitySet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", "centralServer", armworkloads.SAPCentralServerInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPCentralServerProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPCentralServerInstance = armworkloads.SAPCentralServerInstance{ - // Name: to.Ptr("centralServer"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/centralInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/centralInstances/centralServer"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPCentralServerProperties{ - // EnqueueReplicationServerProperties: &armworkloads.EnqueueReplicationServerProperties{ - // ErsVersion: to.Ptr(armworkloads.EnqueueReplicationServerTypeEnqueueReplicator1), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ers1"), - // InstanceNo: to.Ptr("00"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // }, - // EnqueueServerProperties: &armworkloads.EnqueueServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ascs1"), - // IPAddress: to.Ptr("10.0.0.5"), - // Port: to.Ptr[int64](3600), - // }, - // GatewayServerProperties: &armworkloads.GatewayServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Port: to.Ptr[int64](3300), - // }, - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // InstanceNo: to.Ptr("00"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // LoadBalancerDetails: &armworkloads.LoadBalancerDetails{ - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Network/loadBalancers/cs-ASCS-loadBalancer"), - // }, - // MessageServerProperties: &armworkloads.MessageServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ascs1"), - // HTTPPort: to.Ptr[int64](8100), - // HTTPSPort: to.Ptr[int64](44400), - // InternalMsPort: to.Ptr[int64](3900), - // IPAddress: to.Ptr("10.0.0.5"), - // MSPort: to.Ptr[int64](3600), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // VMDetails: []*armworkloads.CentralServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.CentralServerVirtualMachineTypePrimary), - // StorageDetails: []*armworkloads.StorageInformation{ - // { - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/nfsstorageaccount"), - // }}, - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/cs-vm1"), - // }, - // { - // Type: to.Ptr(armworkloads.CentralServerVirtualMachineTypePrimary), - // StorageDetails: []*armworkloads.StorageInformation{ - // { - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/nfsstorageaccount"), - // }}, - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/cs-vm2"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Create.json -func ExampleSAPCentralInstancesClient_BeginCreate_sapCentralInstancesCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", "centralServer", armworkloads.SAPCentralServerInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPCentralServerProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPCentralServerInstance = armworkloads.SAPCentralServerInstance{ - // Name: to.Ptr("centralServer"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/centralInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/centralInstances/centralServer"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPCentralServerProperties{ - // EnqueueReplicationServerProperties: &armworkloads.EnqueueReplicationServerProperties{ - // ErsVersion: to.Ptr(armworkloads.EnqueueReplicationServerTypeEnqueueReplicator1), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ers1"), - // InstanceNo: to.Ptr("00"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // }, - // EnqueueServerProperties: &armworkloads.EnqueueServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ascs1"), - // IPAddress: to.Ptr("10.0.0.5"), - // Port: to.Ptr[int64](3600), - // }, - // GatewayServerProperties: &armworkloads.GatewayServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Port: to.Ptr[int64](3300), - // }, - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // InstanceNo: to.Ptr("00"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // MessageServerProperties: &armworkloads.MessageServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ascs1"), - // HTTPPort: to.Ptr[int64](8100), - // HTTPSPort: to.Ptr[int64](44400), - // InternalMsPort: to.Ptr[int64](3900), - // IPAddress: to.Ptr("10.0.0.5"), - // MSPort: to.Ptr[int64](3600), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // VMDetails: []*armworkloads.CentralServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.CentralServerVirtualMachineTypePrimary), - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/cs-vm"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Update.json -func ExampleSAPCentralInstancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "test-rg", "X00", "centralServer", armworkloads.UpdateSAPCentralInstanceRequest{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPCentralServerInstance = armworkloads.SAPCentralServerInstance{ - // Name: to.Ptr("centralServer"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/centralInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/centralInstances/centralServer"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPCentralServerProperties{ - // EnqueueReplicationServerProperties: &armworkloads.EnqueueReplicationServerProperties{ - // ErsVersion: to.Ptr(armworkloads.EnqueueReplicationServerTypeEnqueueReplicator1), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ers1"), - // InstanceNo: to.Ptr("00"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // }, - // EnqueueServerProperties: &armworkloads.EnqueueServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ascs1"), - // IPAddress: to.Ptr("10.0.0.5"), - // Port: to.Ptr[int64](3600), - // }, - // GatewayServerProperties: &armworkloads.GatewayServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Port: to.Ptr[int64](3300), - // }, - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // InstanceNo: to.Ptr("00"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // MessageServerProperties: &armworkloads.MessageServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ascs1"), - // HTTPPort: to.Ptr[int64](8100), - // HTTPSPort: to.Ptr[int64](44400), - // InternalMsPort: to.Ptr[int64](3900), - // IPAddress: to.Ptr("10.0.0.5"), - // MSPort: to.Ptr[int64](3600), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // VMDetails: []*armworkloads.CentralServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.CentralServerVirtualMachineTypePrimary), - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/cs-vm"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Delete.json -func ExampleSAPCentralInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "test-rg", "X00", "centralServer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("1e4193c3-206e-4916-b124-1da16175eb0e"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/operations/locations/centralus/1e4193c3-206e-4916-b124-1da16175eb0e"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_List.json -func ExampleSAPCentralInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("test-rg", "X00", 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.SAPCentralInstanceList = armworkloads.SAPCentralInstanceList{ - // Value: []*armworkloads.SAPCentralServerInstance{ - // { - // Name: to.Ptr("centralServer"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/centralInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/centralInstances/centralServer"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPCentralServerProperties{ - // EnqueueReplicationServerProperties: &armworkloads.EnqueueReplicationServerProperties{ - // ErsVersion: to.Ptr(armworkloads.EnqueueReplicationServerTypeEnqueueReplicator1), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ers1"), - // InstanceNo: to.Ptr("00"), - // IPAddress: to.Ptr("10.0.0.5"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // }, - // EnqueueServerProperties: &armworkloads.EnqueueServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ascs1"), - // IPAddress: to.Ptr("10.0.0.5"), - // Port: to.Ptr[int64](3600), - // }, - // GatewayServerProperties: &armworkloads.GatewayServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Port: to.Ptr[int64](3300), - // }, - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // InstanceNo: to.Ptr("00"), - // KernelPatch: to.Ptr("patch 300"), - // KernelVersion: to.Ptr("777"), - // MessageServerProperties: &armworkloads.MessageServerProperties{ - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // Hostname: to.Ptr("vh-ascs1"), - // HTTPPort: to.Ptr[int64](8100), - // HTTPSPort: to.Ptr[int64](44400), - // InternalMsPort: to.Ptr[int64](3900), - // IPAddress: to.Ptr("10.0.0.5"), - // MSPort: to.Ptr[int64](3600), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // VMDetails: []*armworkloads.CentralServerVMDetails{ - // { - // Type: to.Ptr(armworkloads.CentralServerVirtualMachineTypePrimary), - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/cs-vm"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_StartInstance.json -func ExampleSAPCentralInstancesClient_BeginStartInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStartInstance(ctx, "test-rg", "X00", "centralServer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("centralServer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/centralInstances/centralServer"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPCentralInstances_StopInstance.json -func ExampleSAPCentralInstancesClient_BeginStopInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPCentralInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStopInstance(ctx, "test-rg", "X00", "centralServer", &armworkloads.SAPCentralInstancesClientBeginStopInstanceOptions{Body: &armworkloads.StopRequest{ - SoftStopTimeoutSeconds: to.Ptr[int64](1200), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("centralServer"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/centralInstances/centralServer"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go index db38b5a736cd..b0a9805519d9 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go @@ -59,7 +59,7 @@ func NewSAPDatabaseInstancesClient(subscriptionID string, credential azcore.Toke // This will be used by service only. PUT by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. @@ -84,7 +84,7 @@ func (client *SAPDatabaseInstancesClient) BeginCreate(ctx context.Context, resou // This will be used by service only. PUT by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPDatabaseInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body SAPDatabaseInstance, options *SAPDatabaseInstancesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, options) if err != nil { @@ -124,7 +124,7 @@ func (client *SAPDatabaseInstancesClient) createCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -134,7 +134,7 @@ func (client *SAPDatabaseInstancesClient) createCreateRequest(ctx context.Contex // This will be used by service only. Delete by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. @@ -158,7 +158,7 @@ func (client *SAPDatabaseInstancesClient) BeginDelete(ctx context.Context, resou // This will be used by service only. Delete by end user will return a Bad Request error. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPDatabaseInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { @@ -198,7 +198,7 @@ func (client *SAPDatabaseInstancesClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -207,7 +207,7 @@ func (client *SAPDatabaseInstancesClient) deleteCreateRequest(ctx context.Contex // Get - Gets the SAP Database Instance resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. @@ -252,7 +252,7 @@ func (client *SAPDatabaseInstancesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -269,7 +269,7 @@ func (client *SAPDatabaseInstancesClient) getHandleResponse(resp *http.Response) // NewListPager - Lists the Database resources associated with a Virtual Instance for SAP solutions resource. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - options - SAPDatabaseInstancesClientListOptions contains the optional parameters for the SAPDatabaseInstancesClient.NewListPager @@ -322,7 +322,7 @@ func (client *SAPDatabaseInstancesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,7 +340,7 @@ func (client *SAPDatabaseInstancesClient) listHandleResponse(resp *http.Response // BeginStartInstance - Starts the database instance of the SAP system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. @@ -363,7 +363,7 @@ func (client *SAPDatabaseInstancesClient) BeginStartInstance(ctx context.Context // StartInstance - Starts the database instance of the SAP system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPDatabaseInstancesClient) startInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginStartInstanceOptions) (*http.Response, error) { req, err := client.startInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { @@ -403,7 +403,7 @@ func (client *SAPDatabaseInstancesClient) startInstanceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -412,7 +412,7 @@ func (client *SAPDatabaseInstancesClient) startInstanceCreateRequest(ctx context // BeginStopInstance - Stops the database instance of the SAP system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. @@ -435,7 +435,7 @@ func (client *SAPDatabaseInstancesClient) BeginStopInstance(ctx context.Context, // StopInstance - Stops the database instance of the SAP system. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPDatabaseInstancesClient) stopInstance(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginStopInstanceOptions) (*http.Response, error) { req, err := client.stopInstanceCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { @@ -475,7 +475,7 @@ func (client *SAPDatabaseInstancesClient) stopInstanceCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -487,7 +487,7 @@ func (client *SAPDatabaseInstancesClient) stopInstanceCreateRequest(ctx context. // BeginUpdate - Updates the Database resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - databaseInstanceName - Database resource name string modeled as parameter for auto generation to work correctly. @@ -511,7 +511,7 @@ func (client *SAPDatabaseInstancesClient) BeginUpdate(ctx context.Context, resou // Update - Updates the Database resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPDatabaseInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body UpdateSAPDatabaseInstanceRequest, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, options) if err != nil { @@ -551,7 +551,7 @@ func (client *SAPDatabaseInstancesClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client_example_test.go deleted file mode 100644 index 79e7b8a2b381..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client_example_test.go +++ /dev/null @@ -1,386 +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 armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Get.json -func ExampleSAPDatabaseInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "test-rg", "X00", "databaseServer", 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.SAPDatabaseInstance = armworkloads.SAPDatabaseInstance{ - // Name: to.Ptr("databaseServer"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/databaseInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/databaseInstances/databaseServer"), - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPDatabaseProperties{ - // DatabaseSid: to.Ptr("X00"), - // DatabaseType: to.Ptr("hdb"), - // IPAddress: to.Ptr("10.0.0.5"), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // Subnet: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VMDetails: []*armworkloads.DatabaseVMDetails{ - // { - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/db-vm"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Create_HA_AvSet.json -func ExampleSAPDatabaseInstancesClient_BeginCreate_createSapDatabaseInstancesForHaSystemWithAvailabilitySet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", "databaseServer", armworkloads.SAPDatabaseInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPDatabaseProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPDatabaseInstance = armworkloads.SAPDatabaseInstance{ - // Name: to.Ptr("databaseServer"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/databaseInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/databaseInstances/databaseServer"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPDatabaseProperties{ - // DatabaseSid: to.Ptr("X00"), - // DatabaseType: to.Ptr("hdb"), - // IPAddress: to.Ptr("10.0.0.5"), - // LoadBalancerDetails: &armworkloads.LoadBalancerDetails{ - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Network/loadBalancers/db-loadBalancer"), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // Subnet: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VMDetails: []*armworkloads.DatabaseVMDetails{ - // { - // StorageDetails: []*armworkloads.StorageInformation{ - // { - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/nfsstorageaccount"), - // }}, - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/db-vm"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Create.json -func ExampleSAPDatabaseInstancesClient_BeginCreate_sapDatabaseInstancesCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", "databaseServer", armworkloads.SAPDatabaseInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPDatabaseProperties{}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPDatabaseInstance = armworkloads.SAPDatabaseInstance{ - // Name: to.Ptr("databaseServer"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/databaseInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/databaseInstances/databaseServer"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPDatabaseProperties{ - // DatabaseSid: to.Ptr("X00"), - // DatabaseType: to.Ptr("hdb"), - // IPAddress: to.Ptr("10.0.0.5"), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // Subnet: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VMDetails: []*armworkloads.DatabaseVMDetails{ - // { - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/db-vm"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Update.json -func ExampleSAPDatabaseInstancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, "test-rg", "X00", "databaseServer", armworkloads.UpdateSAPDatabaseInstanceRequest{ - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPDatabaseInstance = armworkloads.SAPDatabaseInstance{ - // Name: to.Ptr("databaseServer"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/databaseInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/databaseInstances/databaseServer"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPDatabaseProperties{ - // DatabaseSid: to.Ptr("X00"), - // DatabaseType: to.Ptr("hdb"), - // IPAddress: to.Ptr("10.0.0.5"), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // Subnet: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VMDetails: []*armworkloads.DatabaseVMDetails{ - // { - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/db-vm"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Delete.json -func ExampleSAPDatabaseInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "test-rg", "X00", "databaseServer", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("1e4193c3-206e-4916-b124-1da16175eb0e"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/operations/locations/centralus/1e4193c3-206e-4916-b124-1da16175eb0e"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_List.json -func ExampleSAPDatabaseInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("test-rg", "X00", 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.SAPDatabaseInstanceList = armworkloads.SAPDatabaseInstanceList{ - // Value: []*armworkloads.SAPDatabaseInstance{ - // { - // Name: to.Ptr("databaseServer"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances/databaseInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/databaseInstances/databaseServer"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPDatabaseProperties{ - // DatabaseSid: to.Ptr("X00"), - // DatabaseType: to.Ptr("hdb"), - // IPAddress: to.Ptr("10.0.0.5"), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // Subnet: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - // VMDetails: []*armworkloads.DatabaseVMDetails{ - // { - // VirtualMachineID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/db-vm"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_StartInstance.json -func ExampleSAPDatabaseInstancesClient_BeginStartInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStartInstance(ctx, "test-rg", "X00", "db0", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("db0"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/applicationInstances/db0"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_StopInstance.json -func ExampleSAPDatabaseInstancesClient_BeginStopInstance() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPDatabaseInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStopInstance(ctx, "test-rg", "X00", "db0", &armworkloads.SAPDatabaseInstancesClientBeginStopInstanceOptions{Body: &armworkloads.StopRequest{ - SoftStopTimeoutSeconds: to.Ptr[int64](0), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("db0"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00/applicationInstances/db0"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-01T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client.go b/sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client.go index 7836aa4bf5a9..bcdc4e38ad07 100644 --- a/sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client.go @@ -58,7 +58,7 @@ func NewSapLandscapeMonitorClient(subscriptionID string, credential azcore.Token // Create - Creates a SAP Landscape Monitor Dashboard for the specified subscription, resource group, and resource name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - sapLandscapeMonitorParameter - Request body representing a configuration for Sap Landscape Monitor Dashboard @@ -99,7 +99,7 @@ func (client *SapLandscapeMonitorClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, sapLandscapeMonitorParameter) @@ -117,7 +117,7 @@ func (client *SapLandscapeMonitorClient) createHandleResponse(resp *http.Respons // Delete - Deletes a SAP Landscape Monitor Dashboard with the specified subscription, resource group, and SAP monitor name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - options - SapLandscapeMonitorClientDeleteOptions contains the optional parameters for the SapLandscapeMonitorClient.Delete @@ -157,7 +157,7 @@ func (client *SapLandscapeMonitorClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -167,7 +167,7 @@ func (client *SapLandscapeMonitorClient) deleteCreateRequest(ctx context.Context // and resource name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - options - SapLandscapeMonitorClientGetOptions contains the optional parameters for the SapLandscapeMonitorClient.Get method. @@ -206,7 +206,7 @@ func (client *SapLandscapeMonitorClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -225,7 +225,7 @@ func (client *SapLandscapeMonitorClient) getHandleResponse(resp *http.Response) // and resource name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - options - SapLandscapeMonitorClientListOptions contains the optional parameters for the SapLandscapeMonitorClient.List @@ -265,7 +265,7 @@ func (client *SapLandscapeMonitorClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -283,7 +283,7 @@ func (client *SapLandscapeMonitorClient) listHandleResponse(resp *http.Response) // Update - Patches the SAP Landscape Monitor Dashboard for the specified subscription, resource group, and SAP monitor name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - monitorName - Name of the SAP monitor resource. // - sapLandscapeMonitorParameter - Request body representing a configuration for Sap Landscape Monitor Dashboard @@ -324,7 +324,7 @@ func (client *SapLandscapeMonitorClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, sapLandscapeMonitorParameter) diff --git a/sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client_example_test.go deleted file mode 100644 index 4f1b33857b97..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/saplandscapemonitor_client_example_test.go +++ /dev/null @@ -1,361 +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 armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_Get.json -func ExampleSapLandscapeMonitorClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSapLandscapeMonitorClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "mySapMonitor", 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.SapLandscapeMonitor = armworkloads.SapLandscapeMonitor{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Workloads/monitors/sapLandscapeMonitor"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/myMonitor/sapLandscapeMonitor/default"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.SapLandscapeMonitorProperties{ - // Grouping: &armworkloads.SapLandscapeMonitorPropertiesGrouping{ - // Landscape: []*armworkloads.SapLandscapeMonitorSidMapping{ - // { - // Name: to.Ptr("Prod"), - // TopSid: []*string{ - // to.Ptr("SID1"), - // to.Ptr("SID2")}, - // }}, - // SapApplication: []*armworkloads.SapLandscapeMonitorSidMapping{ - // { - // Name: to.Ptr("ERP1"), - // TopSid: []*string{ - // to.Ptr("SID1"), - // to.Ptr("SID2")}, - // }}, - // }, - // TopMetricsThresholds: []*armworkloads.SapLandscapeMonitorMetricThresholds{ - // { - // Name: to.Ptr("Instance Availability"), - // Green: to.Ptr[float32](90), - // Red: to.Ptr[float32](50), - // Yellow: to.Ptr[float32](75), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_Create.json -func ExampleSapLandscapeMonitorClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSapLandscapeMonitorClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "myResourceGroup", "mySapMonitor", armworkloads.SapLandscapeMonitor{ - Properties: &armworkloads.SapLandscapeMonitorProperties{ - Grouping: &armworkloads.SapLandscapeMonitorPropertiesGrouping{ - Landscape: []*armworkloads.SapLandscapeMonitorSidMapping{ - { - Name: to.Ptr("Prod"), - TopSid: []*string{ - to.Ptr("SID1"), - to.Ptr("SID2")}, - }}, - SapApplication: []*armworkloads.SapLandscapeMonitorSidMapping{ - { - Name: to.Ptr("ERP1"), - TopSid: []*string{ - to.Ptr("SID1"), - to.Ptr("SID2")}, - }}, - }, - TopMetricsThresholds: []*armworkloads.SapLandscapeMonitorMetricThresholds{ - { - Name: to.Ptr("Instance Availability"), - Green: to.Ptr[float32](90), - Red: to.Ptr[float32](50), - Yellow: to.Ptr[float32](75), - }}, - }, - }, 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.SapLandscapeMonitor = armworkloads.SapLandscapeMonitor{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Workloads/monitors/sapLandscapeMonitor"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/myMonitor/sapLandscapeMonitor/default"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.SapLandscapeMonitorProperties{ - // Grouping: &armworkloads.SapLandscapeMonitorPropertiesGrouping{ - // Landscape: []*armworkloads.SapLandscapeMonitorSidMapping{ - // { - // Name: to.Ptr("Prod"), - // TopSid: []*string{ - // to.Ptr("SID1"), - // to.Ptr("SID2")}, - // }}, - // SapApplication: []*armworkloads.SapLandscapeMonitorSidMapping{ - // { - // Name: to.Ptr("ERP1"), - // TopSid: []*string{ - // to.Ptr("SID1"), - // to.Ptr("SID2")}, - // }}, - // }, - // TopMetricsThresholds: []*armworkloads.SapLandscapeMonitorMetricThresholds{ - // { - // Name: to.Ptr("Instance Availability"), - // Green: to.Ptr[float32](90), - // Red: to.Ptr[float32](50), - // Yellow: to.Ptr[float32](75), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_Delete.json -func ExampleSapLandscapeMonitorClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSapLandscapeMonitorClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "myResourceGroup", "mySapMonitor", 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/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_Update.json -func ExampleSapLandscapeMonitorClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSapLandscapeMonitorClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "myResourceGroup", "mySapMonitor", armworkloads.SapLandscapeMonitor{ - Properties: &armworkloads.SapLandscapeMonitorProperties{ - Grouping: &armworkloads.SapLandscapeMonitorPropertiesGrouping{ - Landscape: []*armworkloads.SapLandscapeMonitorSidMapping{ - { - Name: to.Ptr("Prod"), - TopSid: []*string{ - to.Ptr("SID1"), - to.Ptr("SID2")}, - }}, - SapApplication: []*armworkloads.SapLandscapeMonitorSidMapping{ - { - Name: to.Ptr("ERP1"), - TopSid: []*string{ - to.Ptr("SID1"), - to.Ptr("SID2")}, - }}, - }, - TopMetricsThresholds: []*armworkloads.SapLandscapeMonitorMetricThresholds{ - { - Name: to.Ptr("Instance Availability"), - Green: to.Ptr[float32](90), - Red: to.Ptr[float32](50), - Yellow: to.Ptr[float32](75), - }}, - }, - }, 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.SapLandscapeMonitor = armworkloads.SapLandscapeMonitor{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Workloads/monitors/sapLandscapeMonitor"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/myMonitor/sapLandscapeMonitor/default"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.SapLandscapeMonitorProperties{ - // Grouping: &armworkloads.SapLandscapeMonitorPropertiesGrouping{ - // Landscape: []*armworkloads.SapLandscapeMonitorSidMapping{ - // { - // Name: to.Ptr("Prod"), - // TopSid: []*string{ - // to.Ptr("SID1"), - // to.Ptr("SID2")}, - // }}, - // SapApplication: []*armworkloads.SapLandscapeMonitorSidMapping{ - // { - // Name: to.Ptr("ERP1"), - // TopSid: []*string{ - // to.Ptr("SID1"), - // to.Ptr("SID2")}, - // }}, - // }, - // TopMetricsThresholds: []*armworkloads.SapLandscapeMonitorMetricThresholds{ - // { - // Name: to.Ptr("Instance Availability"), - // Green: to.Ptr[float32](90), - // Red: to.Ptr[float32](50), - // Yellow: to.Ptr[float32](75), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/workloadmonitor/SapLandscapeMonitor_List.json -func ExampleSapLandscapeMonitorClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSapLandscapeMonitorClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "myResourceGroup", "mySapMonitor", 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.SapLandscapeMonitorListResult = armworkloads.SapLandscapeMonitorListResult{ - // Value: []*armworkloads.SapLandscapeMonitor{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Workloads/monitors/sapLandscapeMonitor"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/myMonitor/sapLandscapeMonitor/default"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.SapLandscapeMonitorProperties{ - // Grouping: &armworkloads.SapLandscapeMonitorPropertiesGrouping{ - // Landscape: []*armworkloads.SapLandscapeMonitorSidMapping{ - // { - // Name: to.Ptr("Prod"), - // TopSid: []*string{ - // to.Ptr("SID1"), - // to.Ptr("SID2")}, - // }}, - // SapApplication: []*armworkloads.SapLandscapeMonitorSidMapping{ - // { - // Name: to.Ptr("ERP1"), - // TopSid: []*string{ - // to.Ptr("SID1"), - // to.Ptr("SID2")}, - // }}, - // }, - // TopMetricsThresholds: []*armworkloads.SapLandscapeMonitorMetricThresholds{ - // { - // Name: to.Ptr("Instance Availability"), - // Green: to.Ptr[float32](90), - // Red: to.Ptr[float32](50), - // Yellow: to.Ptr[float32](75), - // }}, - // }, - // }, - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Workloads/monitors/sapLandscapeMonitor"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Workloads/monitors/myMonitor/sapLandscapeMonitor/default"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Properties: &armworkloads.SapLandscapeMonitorProperties{ - // Grouping: &armworkloads.SapLandscapeMonitorPropertiesGrouping{ - // Landscape: []*armworkloads.SapLandscapeMonitorSidMapping{ - // { - // Name: to.Ptr("Prod"), - // TopSid: []*string{ - // to.Ptr("SID1"), - // to.Ptr("SID2")}, - // }}, - // SapApplication: []*armworkloads.SapLandscapeMonitorSidMapping{ - // { - // Name: to.Ptr("ERP1"), - // TopSid: []*string{ - // to.Ptr("SID1"), - // to.Ptr("SID2")}, - // }}, - // }, - // TopMetricsThresholds: []*armworkloads.SapLandscapeMonitorMetricThresholds{ - // { - // Name: to.Ptr("Instance Availability"), - // Green: to.Ptr[float32](90), - // Red: to.Ptr[float32](50), - // Yellow: to.Ptr[float32](75), - // }}, - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go index 284540a9fc58..e06f429823de 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go @@ -58,7 +58,7 @@ func NewSAPVirtualInstancesClient(subscriptionID string, credential azcore.Token // BeginCreate - Creates a Virtual Instance for SAP solutions (VIS) resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - body - Virtual Instance for SAP solutions resource request body. @@ -81,7 +81,7 @@ func (client *SAPVirtualInstancesClient) BeginCreate(ctx context.Context, resour // Create - Creates a Virtual Instance for SAP solutions (VIS) resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPVirtualInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, body SAPVirtualInstance, options *SAPVirtualInstancesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, body, options) if err != nil { @@ -117,7 +117,7 @@ func (client *SAPVirtualInstancesClient) createCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -127,7 +127,7 @@ func (client *SAPVirtualInstancesClient) createCreateRequest(ctx context.Context // Services Instance, Application Server Instances and Database Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - options - SAPVirtualInstancesClientBeginDeleteOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginDelete @@ -150,7 +150,7 @@ func (client *SAPVirtualInstancesClient) BeginDelete(ctx context.Context, resour // Services Instance, Application Server Instances and Database Instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPVirtualInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { @@ -186,7 +186,7 @@ func (client *SAPVirtualInstancesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,7 +195,7 @@ func (client *SAPVirtualInstancesClient) deleteCreateRequest(ctx context.Context // Get - Gets a Virtual Instance for SAP solutions resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - options - SAPVirtualInstancesClientGetOptions contains the optional parameters for the SAPVirtualInstancesClient.Get method. @@ -234,7 +234,7 @@ func (client *SAPVirtualInstancesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,7 +251,7 @@ func (client *SAPVirtualInstancesClient) getHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Gets all Virtual Instances for SAP solutions resources in a Resource Group. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - SAPVirtualInstancesClientListByResourceGroupOptions contains the optional parameters for the SAPVirtualInstancesClient.NewListByResourceGroupPager // method. @@ -299,7 +299,7 @@ func (client *SAPVirtualInstancesClient) listByResourceGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +316,7 @@ func (client *SAPVirtualInstancesClient) listByResourceGroupHandleResponse(resp // NewListBySubscriptionPager - Gets all Virtual Instances for SAP solutions resources in a Subscription. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - options - SAPVirtualInstancesClientListBySubscriptionOptions contains the optional parameters for the SAPVirtualInstancesClient.NewListBySubscriptionPager // method. func (client *SAPVirtualInstancesClient) NewListBySubscriptionPager(options *SAPVirtualInstancesClientListBySubscriptionOptions) *runtime.Pager[SAPVirtualInstancesClientListBySubscriptionResponse] { @@ -359,7 +359,7 @@ func (client *SAPVirtualInstancesClient) listBySubscriptionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -377,7 +377,7 @@ func (client *SAPVirtualInstancesClient) listBySubscriptionHandleResponse(resp * // BeginStart - Starts the SAP application, that is the Central Services instance and Application server instances. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - options - SAPVirtualInstancesClientBeginStartOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStart @@ -399,7 +399,7 @@ func (client *SAPVirtualInstancesClient) BeginStart(ctx context.Context, resourc // Start - Starts the SAP application, that is the Central Services instance and Application server instances. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPVirtualInstancesClient) start(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { @@ -435,7 +435,7 @@ func (client *SAPVirtualInstancesClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -444,7 +444,7 @@ func (client *SAPVirtualInstancesClient) startCreateRequest(ctx context.Context, // BeginStop - Stops the SAP Application, that is the Application server instances and Central Services instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - options - SAPVirtualInstancesClientBeginStopOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStop @@ -466,7 +466,7 @@ func (client *SAPVirtualInstancesClient) BeginStop(ctx context.Context, resource // Stop - Stops the SAP Application, that is the Application server instances and Central Services instance. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 func (client *SAPVirtualInstancesClient) stop(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { @@ -502,7 +502,7 @@ func (client *SAPVirtualInstancesClient) stopCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -514,7 +514,7 @@ func (client *SAPVirtualInstancesClient) stopCreateRequest(ctx context.Context, // Update - Updates a Virtual Instance for SAP solutions resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-11-01-preview +// Generated from API version 2023-04-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // - body - Request body to update a Virtual Instance for SAP solutions resource. @@ -555,7 +555,7 @@ func (client *SAPVirtualInstancesClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-01-preview") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client_example_test.go deleted file mode 100644 index 9232c91abc5e..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client_example_test.go +++ /dev/null @@ -1,7211 +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 armworkloads_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/workloads/armworkloads" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_Distributed.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithOsConfigurationWithCustomResourceNamesForDistributedSystem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - CustomResourceNames: &armworkloads.ThreeTierFullResourceNames{ - NamingPatternType: to.Ptr(armworkloads.NamingPatternTypeFullResourceName), - ApplicationServer: &armworkloads.ApplicationServerFullResourceNames{ - AvailabilitySetName: to.Ptr("appAvSet"), - VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - { - DataDiskNames: map[string][]*string{ - "default": { - to.Ptr("app0disk0")}, - }, - HostName: to.Ptr("apphostName0"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("appnic0"), - }}, - OSDiskName: to.Ptr("app0osdisk"), - VMName: to.Ptr("appvm0"), - }, - { - DataDiskNames: map[string][]*string{ - "default": { - to.Ptr("app1disk0")}, - }, - HostName: to.Ptr("apphostName1"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("appnic1"), - }}, - OSDiskName: to.Ptr("app1osdisk"), - VMName: to.Ptr("appvm1"), - }}, - }, - CentralServer: &armworkloads.CentralServerFullResourceNames{ - VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - { - DataDiskNames: map[string][]*string{ - "default": { - to.Ptr("ascsdisk0")}, - }, - HostName: to.Ptr("ascshostName"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("ascsnic"), - }}, - OSDiskName: to.Ptr("ascsosdisk"), - VMName: to.Ptr("ascsvm"), - }}, - }, - DatabaseServer: &armworkloads.DatabaseServerFullResourceNames{ - VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - { - DataDiskNames: map[string][]*string{ - "hanaData": { - to.Ptr("hanadata0"), - to.Ptr("hanadata1")}, - "hanaLog": { - to.Ptr("hanalog0"), - to.Ptr("hanalog1"), - to.Ptr("hanalog2")}, - "hanaShared": { - to.Ptr("hanashared0"), - to.Ptr("hanashared1")}, - "usrSap": { - to.Ptr("usrsap0")}, - }, - HostName: to.Ptr("dbhostName"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("dbnic"), - }}, - OSDiskName: to.Ptr("dbosdisk"), - VMName: to.Ptr("dbvm"), - }}, - }, - SharedStorage: &armworkloads.SharedStorageResourceNames{ - SharedStorageAccountName: to.Ptr("storageacc"), - SharedStorageAccountPrivateEndPointName: to.Ptr("peForxNFS"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // CustomResourceNames: &armworkloads.ThreeTierFullResourceNames{ - // NamingPatternType: to.Ptr(armworkloads.NamingPatternTypeFullResourceName), - // ApplicationServer: &armworkloads.ApplicationServerFullResourceNames{ - // AvailabilitySetName: to.Ptr("appAvSet"), - // VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - // { - // DataDiskNames: map[string][]*string{ - // "default": []*string{ - // to.Ptr("app0disk0")}, - // }, - // HostName: to.Ptr("apphostName0"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("appnic0"), - // }}, - // OSDiskName: to.Ptr("app0osdisk"), - // VMName: to.Ptr("appvm0"), - // }, - // { - // DataDiskNames: map[string][]*string{ - // "default": []*string{ - // to.Ptr("app1disk0")}, - // }, - // HostName: to.Ptr("apphostName1"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("appnic1"), - // }}, - // OSDiskName: to.Ptr("app1osdisk"), - // VMName: to.Ptr("appvm1"), - // }}, - // }, - // CentralServer: &armworkloads.CentralServerFullResourceNames{ - // VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - // { - // DataDiskNames: map[string][]*string{ - // "default": []*string{ - // to.Ptr("ascsdisk0")}, - // }, - // HostName: to.Ptr("ascshostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("ascsnic"), - // }}, - // OSDiskName: to.Ptr("ascsosdisk"), - // VMName: to.Ptr("ascsvm"), - // }}, - // }, - // DatabaseServer: &armworkloads.DatabaseServerFullResourceNames{ - // VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - // { - // DataDiskNames: map[string][]*string{ - // "hanaData": []*string{ - // to.Ptr("hanadata0"), - // to.Ptr("hanadata1")}, - // "hanaLog": []*string{ - // to.Ptr("hanalog0"), - // to.Ptr("hanalog1"), - // to.Ptr("hanalog2")}, - // "hanaShared": []*string{ - // to.Ptr("hanashared0"), - // to.Ptr("hanashared1")}, - // "usrSap": []*string{ - // to.Ptr("usrsap0")}, - // }, - // HostName: to.Ptr("dbhostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("dbnic"), - // }}, - // OSDiskName: to.Ptr("dbosdisk"), - // VMName: to.Ptr("dbvm"), - // }}, - // }, - // SharedStorage: &armworkloads.SharedStorageResourceNames{ - // SharedStorageAccountName: to.Ptr("storageacc"), - // SharedStorageAccountPrivateEndPointName: to.Ptr("peForxNFS"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvSet.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithOsConfigurationWithCustomResourceNamesForHaSystemWithAvailabilitySet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - CustomResourceNames: &armworkloads.ThreeTierFullResourceNames{ - NamingPatternType: to.Ptr(armworkloads.NamingPatternTypeFullResourceName), - ApplicationServer: &armworkloads.ApplicationServerFullResourceNames{ - AvailabilitySetName: to.Ptr("appAvSet"), - VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - { - DataDiskNames: map[string][]*string{ - "default": { - to.Ptr("app0disk0")}, - }, - HostName: to.Ptr("apphostName0"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("appnic0"), - }}, - OSDiskName: to.Ptr("app0osdisk"), - VMName: to.Ptr("appvm0"), - }, - { - DataDiskNames: map[string][]*string{ - "default": { - to.Ptr("app1disk0")}, - }, - HostName: to.Ptr("apphostName1"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("appnic1"), - }}, - OSDiskName: to.Ptr("app1osdisk"), - VMName: to.Ptr("appvm1"), - }}, - }, - CentralServer: &armworkloads.CentralServerFullResourceNames{ - AvailabilitySetName: to.Ptr("csAvSet"), - LoadBalancer: &armworkloads.LoadBalancerResourceNames{ - BackendPoolNames: []*string{ - to.Ptr("ascsBackendPool")}, - FrontendIPConfigurationNames: []*string{ - to.Ptr("ascsip0"), - to.Ptr("ersip0")}, - HealthProbeNames: []*string{ - to.Ptr("ascsHealthProbe"), - to.Ptr("ersHealthProbe")}, - LoadBalancerName: to.Ptr("ascslb"), - }, - VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - { - HostName: to.Ptr("ascshostName"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("ascsnic"), - }}, - OSDiskName: to.Ptr("ascsosdisk"), - VMName: to.Ptr("ascsvm"), - }, - { - HostName: to.Ptr("ershostName"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("ersnic"), - }}, - OSDiskName: to.Ptr("ersosdisk"), - VMName: to.Ptr("ersvm"), - }}, - }, - DatabaseServer: &armworkloads.DatabaseServerFullResourceNames{ - AvailabilitySetName: to.Ptr("dbAvSet"), - LoadBalancer: &armworkloads.LoadBalancerResourceNames{ - BackendPoolNames: []*string{ - to.Ptr("dbBackendPool")}, - FrontendIPConfigurationNames: []*string{ - to.Ptr("dbip")}, - HealthProbeNames: []*string{ - to.Ptr("dbHealthProbe")}, - LoadBalancerName: to.Ptr("dblb"), - }, - VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - { - DataDiskNames: map[string][]*string{ - "hanaData": { - to.Ptr("hanadatapr0"), - to.Ptr("hanadatapr1")}, - "hanaLog": { - to.Ptr("hanalogpr0"), - to.Ptr("hanalogpr1"), - to.Ptr("hanalogpr2")}, - "hanaShared": { - to.Ptr("hanasharedpr0"), - to.Ptr("hanasharedpr1")}, - "usrSap": { - to.Ptr("usrsappr0")}, - }, - HostName: to.Ptr("dbprhostName"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("dbprnic"), - }}, - OSDiskName: to.Ptr("dbprosdisk"), - VMName: to.Ptr("dbvmpr"), - }, - { - DataDiskNames: map[string][]*string{ - "hanaData": { - to.Ptr("hanadatasr0"), - to.Ptr("hanadatasr1")}, - "hanaLog": { - to.Ptr("hanalogsr0"), - to.Ptr("hanalogsr1"), - to.Ptr("hanalogsr2")}, - "hanaShared": { - to.Ptr("hanasharedsr0"), - to.Ptr("hanasharedsr1")}, - "usrSap": { - to.Ptr("usrsapsr0")}, - }, - HostName: to.Ptr("dbsrhostName"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("dbsrnic"), - }}, - OSDiskName: to.Ptr("dbsrosdisk"), - VMName: to.Ptr("dbvmsr"), - }}, - }, - SharedStorage: &armworkloads.SharedStorageResourceNames{ - SharedStorageAccountName: to.Ptr("storageacc"), - SharedStorageAccountPrivateEndPointName: to.Ptr("peForxNFS"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilitySet), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // CustomResourceNames: &armworkloads.ThreeTierFullResourceNames{ - // NamingPatternType: to.Ptr(armworkloads.NamingPatternTypeFullResourceName), - // ApplicationServer: &armworkloads.ApplicationServerFullResourceNames{ - // AvailabilitySetName: to.Ptr("appAvSet"), - // VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - // { - // DataDiskNames: map[string][]*string{ - // "default": []*string{ - // to.Ptr("app0disk0")}, - // }, - // HostName: to.Ptr("apphostName0"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("appnic0"), - // }}, - // OSDiskName: to.Ptr("app0osdisk"), - // VMName: to.Ptr("appvm0"), - // }, - // { - // DataDiskNames: map[string][]*string{ - // "default": []*string{ - // to.Ptr("app1disk0")}, - // }, - // HostName: to.Ptr("apphostName1"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("appnic1"), - // }}, - // OSDiskName: to.Ptr("app1osdisk"), - // VMName: to.Ptr("appvm1"), - // }}, - // }, - // CentralServer: &armworkloads.CentralServerFullResourceNames{ - // AvailabilitySetName: to.Ptr("csAvSet"), - // LoadBalancer: &armworkloads.LoadBalancerResourceNames{ - // BackendPoolNames: []*string{ - // to.Ptr("ascsBackendPool")}, - // FrontendIPConfigurationNames: []*string{ - // to.Ptr("ascsip0"), - // to.Ptr("ersip0")}, - // HealthProbeNames: []*string{ - // to.Ptr("ascsHealthProbe"), - // to.Ptr("ersHealthProbe")}, - // LoadBalancerName: to.Ptr("ascslb"), - // }, - // VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - // { - // HostName: to.Ptr("ascshostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("ascsnic"), - // }}, - // OSDiskName: to.Ptr("ascsosdisk"), - // VMName: to.Ptr("ascsvm"), - // }, - // { - // HostName: to.Ptr("ershostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("ersnic"), - // }}, - // OSDiskName: to.Ptr("ersosdisk"), - // VMName: to.Ptr("ersvm"), - // }}, - // }, - // DatabaseServer: &armworkloads.DatabaseServerFullResourceNames{ - // AvailabilitySetName: to.Ptr("dbAvSet"), - // LoadBalancer: &armworkloads.LoadBalancerResourceNames{ - // BackendPoolNames: []*string{ - // to.Ptr("dbBackendPool")}, - // FrontendIPConfigurationNames: []*string{ - // to.Ptr("dbip")}, - // HealthProbeNames: []*string{ - // to.Ptr("dbHealthProbe")}, - // LoadBalancerName: to.Ptr("dblb"), - // }, - // VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - // { - // DataDiskNames: map[string][]*string{ - // "hanaData": []*string{ - // to.Ptr("hanadatapr0"), - // to.Ptr("hanadatapr1")}, - // "hanaLog": []*string{ - // to.Ptr("hanalogpr0"), - // to.Ptr("hanalogpr1"), - // to.Ptr("hanalogpr2")}, - // "hanaShared": []*string{ - // to.Ptr("hanasharedpr0"), - // to.Ptr("hanasharedpr1")}, - // "usrSap": []*string{ - // to.Ptr("usrsappr0")}, - // }, - // HostName: to.Ptr("dbprhostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("dbprnic"), - // }}, - // OSDiskName: to.Ptr("dbprosdisk"), - // VMName: to.Ptr("dbvmpr"), - // }, - // { - // DataDiskNames: map[string][]*string{ - // "hanaData": []*string{ - // to.Ptr("hanadatasr0"), - // to.Ptr("hanadatasr1")}, - // "hanaLog": []*string{ - // to.Ptr("hanalogsr0"), - // to.Ptr("hanalogsr1"), - // to.Ptr("hanalogsr2")}, - // "hanaShared": []*string{ - // to.Ptr("hanasharedsr0"), - // to.Ptr("hanasharedsr1")}, - // "usrSap": []*string{ - // to.Ptr("usrsapsr0")}, - // }, - // HostName: to.Ptr("dbsrhostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("dbsrnic"), - // }}, - // OSDiskName: to.Ptr("dbsrosdisk"), - // VMName: to.Ptr("dbvmsr"), - // }}, - // }, - // SharedStorage: &armworkloads.SharedStorageResourceNames{ - // SharedStorageAccountName: to.Ptr("storageacc"), - // SharedStorageAccountPrivateEndPointName: to.Ptr("peForxNFS"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - // HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilitySet), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_HA_AvZone.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithOsConfigurationWithCustomResourceNamesForHaSystemWithAvailabilityZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - CustomResourceNames: &armworkloads.ThreeTierFullResourceNames{ - NamingPatternType: to.Ptr(armworkloads.NamingPatternTypeFullResourceName), - ApplicationServer: &armworkloads.ApplicationServerFullResourceNames{ - VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - { - DataDiskNames: map[string][]*string{ - "default": { - to.Ptr("app0disk0")}, - }, - HostName: to.Ptr("apphostName0"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("appnic0"), - }}, - OSDiskName: to.Ptr("app0osdisk"), - VMName: to.Ptr("appvm0"), - }, - { - DataDiskNames: map[string][]*string{ - "default": { - to.Ptr("app1disk0")}, - }, - HostName: to.Ptr("apphostName1"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("appnic1"), - }}, - OSDiskName: to.Ptr("app1osdisk"), - VMName: to.Ptr("appvm1"), - }}, - }, - CentralServer: &armworkloads.CentralServerFullResourceNames{ - LoadBalancer: &armworkloads.LoadBalancerResourceNames{ - BackendPoolNames: []*string{ - to.Ptr("ascsBackendPool")}, - FrontendIPConfigurationNames: []*string{ - to.Ptr("ascsip0"), - to.Ptr("ersip0")}, - HealthProbeNames: []*string{ - to.Ptr("ascsHealthProbe"), - to.Ptr("ersHealthProbe")}, - LoadBalancerName: to.Ptr("ascslb"), - }, - VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - { - HostName: to.Ptr("ascshostName"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("ascsnic"), - }}, - OSDiskName: to.Ptr("ascsosdisk"), - VMName: to.Ptr("ascsvm"), - }, - { - HostName: to.Ptr("ershostName"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("ersnic"), - }}, - OSDiskName: to.Ptr("ersosdisk"), - VMName: to.Ptr("ersvm"), - }}, - }, - DatabaseServer: &armworkloads.DatabaseServerFullResourceNames{ - LoadBalancer: &armworkloads.LoadBalancerResourceNames{ - BackendPoolNames: []*string{ - to.Ptr("dbBackendPool")}, - FrontendIPConfigurationNames: []*string{ - to.Ptr("dbip")}, - HealthProbeNames: []*string{ - to.Ptr("dbHealthProbe")}, - LoadBalancerName: to.Ptr("dblb"), - }, - VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - { - DataDiskNames: map[string][]*string{ - "hanaData": { - to.Ptr("hanadatapr0"), - to.Ptr("hanadatapr1")}, - "hanaLog": { - to.Ptr("hanalogpr0"), - to.Ptr("hanalogpr1"), - to.Ptr("hanalogpr2")}, - "hanaShared": { - to.Ptr("hanasharedpr0"), - to.Ptr("hanasharedpr1")}, - "usrSap": { - to.Ptr("usrsappr0")}, - }, - HostName: to.Ptr("dbprhostName"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("dbprnic"), - }}, - OSDiskName: to.Ptr("dbprosdisk"), - VMName: to.Ptr("dbvmpr"), - }, - { - DataDiskNames: map[string][]*string{ - "hanaData": { - to.Ptr("hanadatasr0"), - to.Ptr("hanadatasr1")}, - "hanaLog": { - to.Ptr("hanalogsr0"), - to.Ptr("hanalogsr1"), - to.Ptr("hanalogsr2")}, - "hanaShared": { - to.Ptr("hanasharedsr0"), - to.Ptr("hanasharedsr1")}, - "usrSap": { - to.Ptr("usrsapsr0")}, - }, - HostName: to.Ptr("dbsrhostName"), - NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - { - NetworkInterfaceName: to.Ptr("dbsrnic"), - }}, - OSDiskName: to.Ptr("dbsrosdisk"), - VMName: to.Ptr("dbvmsr"), - }}, - }, - SharedStorage: &armworkloads.SharedStorageResourceNames{ - SharedStorageAccountName: to.Ptr("storageacc"), - SharedStorageAccountPrivateEndPointName: to.Ptr("peForxNFS"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilityZone), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // CustomResourceNames: &armworkloads.ThreeTierFullResourceNames{ - // NamingPatternType: to.Ptr(armworkloads.NamingPatternTypeFullResourceName), - // ApplicationServer: &armworkloads.ApplicationServerFullResourceNames{ - // VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - // { - // DataDiskNames: map[string][]*string{ - // "default": []*string{ - // to.Ptr("app0disk0")}, - // }, - // HostName: to.Ptr("apphostName0"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("appnic0"), - // }}, - // OSDiskName: to.Ptr("app0osdisk"), - // VMName: to.Ptr("appvm0"), - // }, - // { - // DataDiskNames: map[string][]*string{ - // "default": []*string{ - // to.Ptr("app1disk0")}, - // }, - // HostName: to.Ptr("apphostName1"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("appnic1"), - // }}, - // OSDiskName: to.Ptr("app1osdisk"), - // VMName: to.Ptr("appvm1"), - // }}, - // }, - // CentralServer: &armworkloads.CentralServerFullResourceNames{ - // LoadBalancer: &armworkloads.LoadBalancerResourceNames{ - // BackendPoolNames: []*string{ - // to.Ptr("ascsBackendPool")}, - // FrontendIPConfigurationNames: []*string{ - // to.Ptr("ascsip0"), - // to.Ptr("ersip0")}, - // HealthProbeNames: []*string{ - // to.Ptr("ascsHealthProbe"), - // to.Ptr("ersHealthProbe")}, - // LoadBalancerName: to.Ptr("ascslb"), - // }, - // VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - // { - // HostName: to.Ptr("ascshostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("ascsnic"), - // }}, - // OSDiskName: to.Ptr("ascsosdisk"), - // VMName: to.Ptr("ascsvm"), - // }, - // { - // HostName: to.Ptr("ershostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("ersnic"), - // }}, - // OSDiskName: to.Ptr("ersosdisk"), - // VMName: to.Ptr("ersvm"), - // }}, - // }, - // DatabaseServer: &armworkloads.DatabaseServerFullResourceNames{ - // LoadBalancer: &armworkloads.LoadBalancerResourceNames{ - // BackendPoolNames: []*string{ - // to.Ptr("dbBackendPool")}, - // FrontendIPConfigurationNames: []*string{ - // to.Ptr("dbip")}, - // HealthProbeNames: []*string{ - // to.Ptr("dbHealthProbe")}, - // LoadBalancerName: to.Ptr("dblb"), - // }, - // VirtualMachines: []*armworkloads.VirtualMachineResourceNames{ - // { - // DataDiskNames: map[string][]*string{ - // "hanaData": []*string{ - // to.Ptr("hanadatapr0"), - // to.Ptr("hanadatapr1")}, - // "hanaLog": []*string{ - // to.Ptr("hanalogpr0"), - // to.Ptr("hanalogpr1"), - // to.Ptr("hanalogpr2")}, - // "hanaShared": []*string{ - // to.Ptr("hanasharedpr0"), - // to.Ptr("hanasharedpr1")}, - // "usrSap": []*string{ - // to.Ptr("usrsappr0")}, - // }, - // HostName: to.Ptr("dbprhostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("dbprnic"), - // }}, - // OSDiskName: to.Ptr("dbprosdisk"), - // VMName: to.Ptr("dbvmpr"), - // }, - // { - // DataDiskNames: map[string][]*string{ - // "hanaData": []*string{ - // to.Ptr("hanadatasr0"), - // to.Ptr("hanadatasr1")}, - // "hanaLog": []*string{ - // to.Ptr("hanalogsr0"), - // to.Ptr("hanalogsr1"), - // to.Ptr("hanalogsr2")}, - // "hanaShared": []*string{ - // to.Ptr("hanasharedsr0"), - // to.Ptr("hanasharedsr1")}, - // "usrSap": []*string{ - // to.Ptr("usrsapsr0")}, - // }, - // HostName: to.Ptr("dbsrhostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("dbsrnic"), - // }}, - // OSDiskName: to.Ptr("dbsrosdisk"), - // VMName: to.Ptr("dbvmsr"), - // }}, - // }, - // SharedStorage: &armworkloads.SharedStorageResourceNames{ - // SharedStorageAccountName: to.Ptr("storageacc"), - // SharedStorageAccountPrivateEndPointName: to.Ptr("peForxNFS"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - // HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilityZone), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_CustomFullResourceNames_SingleServer.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithOsConfigurationWithCustomResourceNamesForSingleServerSystem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - NetworkConfiguration: &armworkloads.NetworkConfiguration{ - IsSecondaryIPEnabled: to.Ptr(true), - }, - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - // CustomResourceNames: &armworkloads.SingleServerFullResourceNames{ - // NamingPatternType: to.Ptr(armworkloads.NamingPatternTypeFullResourceName), - // VirtualMachine: &armworkloads.VirtualMachineResourceNames{ - // DataDiskNames: map[string][]*string{ - // "hanaData": []*string{ - // to.Ptr("hanadata0"), - // to.Ptr("hanadata1")}, - // "hanaLog": []*string{ - // to.Ptr("hanalog0"), - // to.Ptr("hanalog1"), - // to.Ptr("hanalog2")}, - // "hanaShared": []*string{ - // to.Ptr("hanashared0"), - // to.Ptr("hanashared1")}, - // "usrSap": []*string{ - // to.Ptr("usrsap0")}, - // }, - // HostName: to.Ptr("sshostName"), - // NetworkInterfaces: []*armworkloads.NetworkInterfaceResourceNames{ - // { - // NetworkInterfaceName: to.Ptr("ssnic"), - // }}, - // OSDiskName: to.Ptr("ssosdisk"), - // VMName: to.Ptr("ssvm"), - // }, - // }, - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // NetworkConfiguration: &armworkloads.NetworkConfiguration{ - // IsSecondaryIPEnabled: to.Ptr(true), - // }, - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureOnlyForDistributedSystem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvSet.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureOnlyForHaSystemWithAvailabilitySet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](5), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilitySet), - }, - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](5), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - // HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilitySet), - // }, - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_HA_AvZone.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureOnlyForHaSystemWithAvailabilityZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilityZone), - }, - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - // HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilityZone), - // }, - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_SingleServer.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureOnlyForSingleServerSystem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - NetworkConfiguration: &armworkloads.NetworkConfiguration{ - IsSecondaryIPEnabled: to.Ptr(true), - }, - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSH: &armworkloads.SSHConfiguration{ - PublicKeys: []*armworkloads.SSHPublicKey{ - { - KeyData: to.Ptr("ssh-rsa public key"), - }}, - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_Distributed.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithDiskAndOsConfigurationForDistributedSystemRecommended() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - DiskConfiguration: &armworkloads.DiskConfiguration{ - DiskVolumeConfigurations: map[string]*armworkloads.DiskVolumeConfiguration{ - "backup": { - Count: to.Ptr[int64](2), - SizeGB: to.Ptr[int64](256), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "hana/data": { - Count: to.Ptr[int64](4), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - "hana/log": { - Count: to.Ptr[int64](3), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - "hana/shared": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](256), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "os": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](64), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "usr/sap": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - }, - }, - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // DiskConfiguration: &armworkloads.DiskConfiguration{ - // DiskVolumeConfigurations: map[string]*armworkloads.DiskVolumeConfiguration{ - // "backup": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](2), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "hana/data": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](4), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // "hana/log": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](3), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // "hana/shared": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "os": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](64), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "usr/sap": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // }, - // }, - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvSet.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithDiskAndOsConfigurationForHaSystemWithAvailabilitySetRecommended() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - DiskConfiguration: &armworkloads.DiskConfiguration{ - DiskVolumeConfigurations: map[string]*armworkloads.DiskVolumeConfiguration{ - "backup": { - Count: to.Ptr[int64](2), - SizeGB: to.Ptr[int64](256), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "hana/data": { - Count: to.Ptr[int64](4), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - "hana/log": { - Count: to.Ptr[int64](3), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - "hana/shared": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](256), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "os": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](64), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "usr/sap": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - }, - }, - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilitySet), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // DiskConfiguration: &armworkloads.DiskConfiguration{ - // DiskVolumeConfigurations: map[string]*armworkloads.DiskVolumeConfiguration{ - // "backup": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](2), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "hana/data": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](4), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // "hana/log": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](3), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // "hana/shared": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "os": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](64), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "usr/sap": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // }, - // }, - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - // HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilitySet), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_HA_AvZone.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithDiskAndOsConfigurationForHaSystemWithAvailabilityZoneRecommended() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - DiskConfiguration: &armworkloads.DiskConfiguration{ - DiskVolumeConfigurations: map[string]*armworkloads.DiskVolumeConfiguration{ - "backup": { - Count: to.Ptr[int64](2), - SizeGB: to.Ptr[int64](256), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "hana/data": { - Count: to.Ptr[int64](4), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - "hana/log": { - Count: to.Ptr[int64](3), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - "hana/shared": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](256), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "os": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](64), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "usr/sap": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - }, - }, - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilityZone), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // DiskConfiguration: &armworkloads.DiskConfiguration{ - // DiskVolumeConfigurations: map[string]*armworkloads.DiskVolumeConfiguration{ - // "backup": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](2), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "hana/data": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](4), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // "hana/log": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](3), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // "hana/shared": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "os": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](64), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "usr/sap": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // }, - // }, - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - // HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilityZone), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_DiskDetails_SingleServer.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithDiskAndOsConfigurationsForSingleServerSystemRecommended() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - DbDiskConfiguration: &armworkloads.DiskConfiguration{ - DiskVolumeConfigurations: map[string]*armworkloads.DiskVolumeConfiguration{ - "backup": { - Count: to.Ptr[int64](2), - SizeGB: to.Ptr[int64](256), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "hana/data": { - Count: to.Ptr[int64](4), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - "hana/log": { - Count: to.Ptr[int64](3), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - "hana/shared": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](256), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "os": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](64), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - }, - }, - "usr/sap": { - Count: to.Ptr[int64](1), - SizeGB: to.Ptr[int64](128), - SKU: &armworkloads.DiskSKU{ - Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - }, - }, - }, - }, - NetworkConfiguration: &armworkloads.NetworkConfiguration{ - IsSecondaryIPEnabled: to.Ptr(true), - }, - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // DbDiskConfiguration: &armworkloads.DiskConfiguration{ - // DiskVolumeConfigurations: map[string]*armworkloads.DiskVolumeConfiguration{ - // "backup": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](2), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "hana/data": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](4), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // "hana/log": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](3), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // "hana/shared": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](256), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "os": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](64), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNameStandardSSDLRS), - // }, - // }, - // "usr/sap": &armworkloads.DiskVolumeConfiguration{ - // Count: to.Ptr[int64](1), - // SizeGB: to.Ptr[int64](128), - // SKU: &armworkloads.DiskSKU{ - // Name: to.Ptr(armworkloads.DiskSKUNamePremiumLRS), - // }, - // }, - // }, - // }, - // NetworkConfiguration: &armworkloads.NetworkConfiguration{ - // IsSecondaryIPEnabled: to.Ptr(true), - // }, - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_Distributed.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithOsConfigurationForDistributedSystemRecommended() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvSet.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithOsConfigurationForHaSystemWithAvailabilitySetRecommended() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilitySet), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - // HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilitySet), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_HA_AvZone.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithOsConfigurationForHaSystemWithAvailabilityZoneRecommended() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilityZone), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - // HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilityZone), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_WithOSConfig_SingleServer.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithOsConfigurationForSingleServerSystemRecommended() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - NetworkConfiguration: &armworkloads.NetworkConfiguration{ - IsSecondaryIPEnabled: to.Ptr(true), - }, - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // NetworkConfiguration: &armworkloads.NetworkConfiguration{ - // IsSecondaryIPEnabled: to.Ptr(true), - // }, - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_CreateTrans.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithANewSapTransFileshare() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - StorageConfiguration: &armworkloads.StorageConfiguration{ - TransportFileShareConfiguration: &armworkloads.CreateAndMountFileShareConfiguration{ - ConfigurationType: to.Ptr(armworkloads.ConfigurationTypeCreateAndMount), - ResourceGroup: to.Ptr("test-rg"), - StorageAccountName: to.Ptr("input-sa-name"), - }, - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // StorageConfiguration: &armworkloads.StorageConfiguration{ - // TransportFileShareConfiguration: &armworkloads.CreateAndMountFileShareConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.ConfigurationTypeCreateAndMount), - // ResourceGroup: to.Ptr("test-rg"), - // StorageAccountName: to.Ptr("input-sa-name"), - // }, - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_MountTrans.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithAnExistingSapTransFileshare() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - StorageConfiguration: &armworkloads.StorageConfiguration{ - TransportFileShareConfiguration: &armworkloads.MountFileShareConfiguration{ - ConfigurationType: to.Ptr(armworkloads.ConfigurationTypeMount), - ID: to.Ptr("fileshareID"), - PrivateEndpointID: to.Ptr("pe-arm-id"), - }, - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // StorageConfiguration: &armworkloads.StorageConfiguration{ - // TransportFileShareConfiguration: &armworkloads.MountFileShareConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.ConfigurationTypeMount), - // ID: to.Ptr("fileshareID"), - // PrivateEndpointID: to.Ptr("pe-arm-id"), - // }, - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed_SkipTransMount.json -func ExampleSAPVirtualInstancesClient_BeginCreate_createInfrastructureWithoutSapTransFileshare() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("7.4"), - Version: to.Ptr("7.4.2019062505"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - StorageConfiguration: &armworkloads.StorageConfiguration{ - TransportFileShareConfiguration: &armworkloads.SkipFileShareConfiguration{ - ConfigurationType: to.Ptr(armworkloads.ConfigurationTypeSkip), - }, - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // StorageConfiguration: &armworkloads.StorageConfiguration{ - // TransportFileShareConfiguration: &armworkloads.SkipFileShareConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.ConfigurationTypeSkip), - // }, - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatus("Unknown")), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_Distributed.json -func ExampleSAPVirtualInstancesClient_BeginCreate_detectSapSoftwareInstallationOnADistributedSystem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("eastus2"), - Tags: map[string]*string{ - "created by": to.Ptr("azureuser"), - }, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("{{resourcegrp}}"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("84sapha-gen2"), - Version: to.Ptr("8.4.2021091202"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("azureuser"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("{{privateKey}}"), - PublicKey: to.Ptr("{{sshkey}}"), - }, - }, - }, - VMSize: to.Ptr("Standard_E4ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("84sapha-gen2"), - Version: to.Ptr("8.4.2021091202"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("azureuser"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("{{privateKey}}"), - PublicKey: to.Ptr("{{sshkey}}"), - }, - }, - }, - VMSize: to.Ptr("Standard_E4ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("84sapha-gen2"), - Version: to.Ptr("8.4.2021091202"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("azureuser"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("{{privateKey}}"), - PublicKey: to.Ptr("{{sshkey}}"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - NetworkConfiguration: &armworkloads.NetworkConfiguration{ - IsSecondaryIPEnabled: to.Ptr(true), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("sap.bpaas.com"), - }, - SoftwareConfiguration: &armworkloads.ExternalInstallationSoftwareConfiguration{ - SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeExternal), - CentralServerVMID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("microsoft.workloads/sapvirtualinstances"), - // ID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-18T18:25:55.2406546Z"); return t}()), - // CreatedBy: to.Ptr("f1bc9460-9d57-4c16-99a8-5a19378a3a93"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-18T18:50:59.1945444Z"); return t}()), - // LastModifiedBy: to.Ptr("f1bc9460-9d57-4c16-99a8-5a19378a3a93"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeApplication), - // }, - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // "created by": to.Ptr("azureuser"), - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("aa-rg"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("azureuser"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("ssh-rsa AAA generated-by-azure"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E4ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("azureuser"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("ssh-rsa AAA generated-by-azure"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E4ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("azureuser"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("ssh-rsa AAA generated-by-azure"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // NetworkConfiguration: &armworkloads.NetworkConfiguration{ - // IsSecondaryIPEnabled: to.Ptr(true), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("sap.bpaas.com"), - // }, - // SoftwareConfiguration: &armworkloads.ExternalInstallationSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeExternal), - // CentralServerVMID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_SingleServer.json -func ExampleSAPVirtualInstancesClient_BeginCreate_detectSapSoftwareInstallationOnASingleServerSystem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - NetworkConfiguration: &armworkloads.NetworkConfiguration{ - IsSecondaryIPEnabled: to.Ptr(true), - }, - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("84sapha-gen2"), - Version: to.Ptr("8.4.2021091202"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - SoftwareConfiguration: &armworkloads.ExternalInstallationSoftwareConfiguration{ - SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeExternal), - CentralServerVMID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // NetworkConfiguration: &armworkloads.NetworkConfiguration{ - // IsSecondaryIPEnabled: to.Ptr(true), - // }, - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // SoftwareConfiguration: &armworkloads.ExternalInstallationSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeExternal), - // CentralServerVMID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvSet.json -func ExampleSAPVirtualInstancesClient_BeginCreate_detectSapSoftwareInstallationOnAnHaSystemWithAvailabilitySet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("84sapha-gen2"), - Version: to.Ptr("8.4.2021091202"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("84sapha-gen2"), - Version: to.Ptr("8.4.2021091202"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("84sapha-gen2"), - Version: to.Ptr("8.4.2021091202"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilitySet), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - SoftwareConfiguration: &armworkloads.ExternalInstallationSoftwareConfiguration{ - SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeExternal), - CentralServerVMID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - // HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilitySet), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // SoftwareConfiguration: &armworkloads.ExternalInstallationSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeExternal), - // CentralServerVMID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_DetectInstallation_HA_AvZone.json -func ExampleSAPVirtualInstancesClient_BeginCreate_detectSapSoftwareInstallationOnAnHaSystemWithAvailabilityZone() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("westcentralus"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("X00-RG"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](6), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("84sapha-gen2"), - Version: to.Ptr("8.4.2021091202"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("84sapha-gen2"), - Version: to.Ptr("8.4.2021091202"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_E16ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("84sapha-gen2"), - Version: to.Ptr("8.4.2021091202"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("{your-username}"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("xyz"), - PublicKey: to.Ptr("abc"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilityZone), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("xyz.test.com"), - }, - SoftwareConfiguration: &armworkloads.ExternalInstallationSoftwareConfiguration{ - SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeExternal), - CentralServerVMID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](6), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E32ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E16ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("abc"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // HighAvailabilityConfig: &armworkloads.HighAvailabilityConfiguration{ - // HighAvailabilityType: to.Ptr(armworkloads.SAPHighAvailabilityTypeAvailabilityZone), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("xyz.test.com"), - // }, - // SoftwareConfiguration: &armworkloads.ExternalInstallationSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeExternal), - // CentralServerVMID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Install_Distributed.json -func ExampleSAPVirtualInstancesClient_BeginCreate_installSapSoftwareOnDistributedSystem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("eastus2"), - Tags: map[string]*string{ - "created by": to.Ptr("azureuser"), - }, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - AppResourceGroup: to.Ptr("{{resourcegrp}}"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - InstanceCount: to.Ptr[int64](2), - SubnetID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("8.2"), - Version: to.Ptr("8.2.2021091201"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("azureuser"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("{{privateKey}}"), - PublicKey: to.Ptr("{{sshkey}}"), - }, - }, - }, - VMSize: to.Ptr("Standard_E4ds_v4"), - }, - }, - CentralServer: &armworkloads.CentralServerConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("8.2"), - Version: to.Ptr("8.2.2021091201"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("azureuser"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("{{privateKey}}"), - PublicKey: to.Ptr("{{sshkey}}"), - }, - }, - }, - VMSize: to.Ptr("Standard_E4ds_v4"), - }, - }, - DatabaseServer: &armworkloads.DatabaseConfiguration{ - InstanceCount: to.Ptr[int64](1), - SubnetID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("RHEL-SAP-HA"), - Publisher: to.Ptr("RedHat"), - SKU: to.Ptr("8.2"), - Version: to.Ptr("8.2.2021091201"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("azureuser"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("{{privateKey}}"), - PublicKey: to.Ptr("{{sshkey}}"), - }, - }, - }, - VMSize: to.Ptr("Standard_M32ts"), - }, - }, - NetworkConfiguration: &armworkloads.NetworkConfiguration{ - IsSecondaryIPEnabled: to.Ptr(true), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("sap.bpaas.com"), - }, - SoftwareConfiguration: &armworkloads.SAPInstallWithoutOSConfigSoftwareConfiguration{ - SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig), - BomURL: to.Ptr("https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml"), - SapBitsStorageAccountID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - SoftwareVersion: to.Ptr("SAP S/4HANA 1909 SPS 03"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("microsoft.workloads/sapvirtualinstances"), - // ID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/aa-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-18T18:25:55.2406546Z"); return t}()), - // CreatedBy: to.Ptr("f1bc9460-9d57-4c16-99a8-5a19378a3a93"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-18T18:50:59.1945444Z"); return t}()), - // LastModifiedBy: to.Ptr("f1bc9460-9d57-4c16-99a8-5a19378a3a93"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeApplication), - // }, - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // "created by": to.Ptr("azureuser"), - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("aa-rg"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("azureuser"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("ssh-rsa AAA generated-by-azure"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E4ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("azureuser"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("ssh-rsa AAA generated-by-azure"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E4ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("azureuser"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("ssh-rsa AAA generated-by-azure"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // NetworkConfiguration: &armworkloads.NetworkConfiguration{ - // IsSecondaryIPEnabled: to.Ptr(true), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("sap.bpaas.com"), - // }, - // SoftwareConfiguration: &armworkloads.SAPInstallWithoutOSConfigSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig), - // BomURL: to.Ptr("https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml"), - // SapBitsStorageAccountID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - // SoftwareVersion: to.Ptr("SAP S/4HANA 1909 SPS 03"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationInProgress), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Install_SingleServer.json -func ExampleSAPVirtualInstancesClient_BeginCreate_installSapSoftwareOnSingleServerSystem() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("eastus2"), - Tags: map[string]*string{}, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DeploymentWithOSConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - AppLocation: to.Ptr("eastus"), - InfrastructureConfiguration: &armworkloads.SingleServerConfiguration{ - AppResourceGroup: to.Ptr("test-rg"), - DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeSingleServer), - SubnetID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet"), - VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - ImageReference: &armworkloads.ImageReference{ - Offer: to.Ptr("SLES-SAP"), - Publisher: to.Ptr("SUSE"), - SKU: to.Ptr("12-sp4-gen2"), - Version: to.Ptr("2022.02.01"), - }, - OSProfile: &armworkloads.OSProfile{ - AdminUsername: to.Ptr("azureappadmin"), - OSConfiguration: &armworkloads.LinuxConfiguration{ - OSType: to.Ptr(armworkloads.OSTypeLinux), - DisablePasswordAuthentication: to.Ptr(true), - SSHKeyPair: &armworkloads.SSHKeyPair{ - PrivateKey: to.Ptr("{{privateKey}}"), - PublicKey: to.Ptr("{{sshkey}}"), - }, - }, - }, - VMSize: to.Ptr("Standard_E32ds_v4"), - }, - }, - OSSapConfiguration: &armworkloads.OsSapConfiguration{ - SapFqdn: to.Ptr("sap.bpaas.com"), - }, - SoftwareConfiguration: &armworkloads.SAPInstallWithoutOSConfigSoftwareConfiguration{ - SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig), - BomURL: to.Ptr("https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml"), - SapBitsStorageAccountID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - SoftwareVersion: to.Ptr("SAP S/4HANA 1909 SPS 03"), - }, - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("microsoft.workloads/sapvirtualinstances"), - // ID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/aa-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-18T18:25:55.2406546Z"); return t}()), - // CreatedBy: to.Ptr("f1bc9460-9d57-4c16-99a8-5a19378a3a93"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeApplication), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-08-18T18:50:59.1945444Z"); return t}()), - // LastModifiedBy: to.Ptr("f1bc9460-9d57-4c16-99a8-5a19378a3a93"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeApplication), - // }, - // Location: to.Ptr("eastus2"), - // Tags: map[string]*string{ - // "created by": to.Ptr("azureuser"), - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentWithOSConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeploymentWithOSConfig), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("aa-rg"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](2), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("azureuser"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("ssh-rsa AAA generated-by-azure"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E4ds_v4"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("azureuser"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("ssh-rsa AAA generated-by-azure"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_E4ds_v4"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP-HA"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("84sapha-gen2"), - // Version: to.Ptr("8.4.2021091202"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("azureuser"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSHKeyPair: &armworkloads.SSHKeyPair{ - // PublicKey: to.Ptr("ssh-rsa AAA generated-by-azure"), - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_M32ts"), - // }, - // }, - // NetworkConfiguration: &armworkloads.NetworkConfiguration{ - // IsSecondaryIPEnabled: to.Ptr(true), - // }, - // }, - // OSSapConfiguration: &armworkloads.OsSapConfiguration{ - // SapFqdn: to.Ptr("sap.bpaas.com"), - // }, - // SoftwareConfiguration: &armworkloads.SAPInstallWithoutOSConfigSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig), - // BomURL: to.Ptr("https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml"), - // SapBitsStorageAccountID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount"), - // SoftwareVersion: to.Ptr("SAP S/4HANA 1909 SPS 03"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateSoftwareInstallationInProgress), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover_CustomMrgStorageAccountName.json -func ExampleSAPVirtualInstancesClient_BeginCreate_registerExistingSapSystemAsVirtualInstanceForSapSolutionsWithOptionalCustomizations() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("northeurope"), - Tags: map[string]*string{ - "createdby": to.Ptr("abc@microsoft.com"), - "test": to.Ptr("abc"), - }, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DiscoveryConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDiscovery), - CentralServerVMID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0"), - ManagedRgStorageAccountName: to.Ptr("q20saacssgrs"), - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("Q20"), - // Type: to.Ptr("microsoft.workloads/sapvirtualinstances"), - // ID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/Q20"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-27T08:22:52.3318907Z"); return t}()), - // CreatedBy: to.Ptr("abc@microsoft.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-27T11:44:17.9310503Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@microsoft.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("northeurope"), - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DiscoveryConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDiscovery), - // AppLocation: to.Ptr("westeurope"), - // CentralServerVMID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg-infra/providers/Microsoft.Compute/virtualMachines/q20ascsvm0"), - // ManagedRgStorageAccountName: to.Ptr("q20saacssgrs"), - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("mrg-Q20-5b0097"), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Discover.json -func ExampleSAPVirtualInstancesClient_BeginCreate_registerExistingSapSystemAsVirtualInstanceForSapSolutions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, "test-rg", "X00", armworkloads.SAPVirtualInstance{ - Location: to.Ptr("northeurope"), - Tags: map[string]*string{ - "createdby": to.Ptr("abc@microsoft.com"), - "test": to.Ptr("abc"), - }, - Properties: &armworkloads.SAPVirtualInstanceProperties{ - Configuration: &armworkloads.DiscoveryConfiguration{ - ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDiscovery), - CentralServerVMID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0"), - }, - Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("Q20"), - // Type: to.Ptr("microsoft.workloads/sapvirtualinstances"), - // ID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/Q20"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-27T08:22:52.3318907Z"); return t}()), - // CreatedBy: to.Ptr("abc@microsoft.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-07-27T11:44:17.9310503Z"); return t}()), - // LastModifiedBy: to.Ptr("abc@microsoft.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("northeurope"), - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DiscoveryConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDiscovery), - // AppLocation: to.Ptr("westeurope"), - // CentralServerVMID: to.Ptr("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg-infra/providers/Microsoft.Compute/virtualMachines/q20ascsvm0"), - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeNonProd), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("mrg-Q20-5b0097"), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Get.json -func ExampleSAPVirtualInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "test-rg", "X00", 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.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](10), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId3"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId1"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId2"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // }, - // SoftwareConfiguration: &armworkloads.ServiceInitiatedSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeServiceInitiated), - // BomURL: to.Ptr("https://myaccount.blob.core.windows.net/mycontainer/myblob"), - // SapBitsStorageAccountID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/ajgupt-test/providers/Microsoft.Storage/storageAccounts/ajguptsavnet"), - // SapFqdn: to.Ptr("sapsystem.contoso.net"), - // SoftwareVersion: to.Ptr("SAP S/4HANA 2020 FPS01"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("mrg-x00-6d875e77-e412-4d7d-9af4-8895278b4443"), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Update.json -func ExampleSAPVirtualInstancesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "test-rg", "X00", armworkloads.UpdateSAPVirtualInstanceRequest{ - Identity: &armworkloads.UserAssignedServiceIdentity{ - Type: to.Ptr(armworkloads.ManagedServiceIdentityTypeNone), - }, - Tags: map[string]*string{ - "key1": to.Ptr("svi1"), - }, - }, 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.SAPVirtualInstance = armworkloads.SAPVirtualInstance{ - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // "key1": to.Ptr("svi1"), - // }, - // Identity: &armworkloads.UserAssignedServiceIdentity{ - // Type: to.Ptr(armworkloads.ManagedServiceIdentityTypeNone), - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateUnknown), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("mrg-x00-6d875e77-e412-4d7d-9af4-8895278b4443"), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateInfrastructureDeploymentPending), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusStarting), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Delete.json -func ExampleSAPVirtualInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "test-rg", "X00", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("1e4193c3-206e-4916-b124-1da16175eb0e"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/operations/locations/centralus/1e4193c3-206e-4916-b124-1da16175eb0e"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListByResourceGroup.json -func ExampleSAPVirtualInstancesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("test-rg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SAPVirtualInstanceList = armworkloads.SAPVirtualInstanceList{ - // Value: []*armworkloads.SAPVirtualInstance{ - // { - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](10), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId3"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId1"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId2"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // }, - // SoftwareConfiguration: &armworkloads.ServiceInitiatedSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeServiceInitiated), - // BomURL: to.Ptr("https://myaccount.blob.core.windows.net/mycontainer/myblob"), - // SapBitsStorageAccountID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/ajgupt-test/providers/Microsoft.Storage/storageAccounts/ajguptsavnet"), - // SapFqdn: to.Ptr("sapsystem.contoso.net"), - // SoftwareVersion: to.Ptr("SAP S/4HANA 2020 FPS01"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("mrg-x00-6d875e77-e412-4d7d-9af4-8895278b4443"), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // }, - // }, - // { - // Name: to.Ptr("X01"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X01"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](10), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId3"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId1"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId2"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // }, - // SoftwareConfiguration: &armworkloads.ServiceInitiatedSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeServiceInitiated), - // BomURL: to.Ptr("https://myaccount.blob.core.windows.net/mycontainer/myblob"), - // SapBitsStorageAccountID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/ajgupt-test/providers/Microsoft.Storage/storageAccounts/ajguptsavnet"), - // SapFqdn: to.Ptr("sapsystem.contoso.net"), - // SoftwareVersion: to.Ptr("SAP S/4HANA 2020 FPS01"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_ListBySubscription.json -func ExampleSAPVirtualInstancesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("6d875e77-e412-4d7d-9af4-8895278b4443", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.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.SAPVirtualInstanceList = armworkloads.SAPVirtualInstanceList{ - // Value: []*armworkloads.SAPVirtualInstance{ - // { - // Name: to.Ptr("X00"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X00"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](10), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId3"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId1"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId2"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // }, - // SoftwareConfiguration: &armworkloads.ServiceInitiatedSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeServiceInitiated), - // BomURL: to.Ptr("https://myaccount.blob.core.windows.net/mycontainer/myblob"), - // SapBitsStorageAccountID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/ajgupt-test/providers/Microsoft.Storage/storageAccounts/ajguptsavnet"), - // SapFqdn: to.Ptr("sapsystem.contoso.net"), - // SoftwareVersion: to.Ptr("SAP S/4HANA 2020 FPS01"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - // Name: to.Ptr("mrg-x00-6d875e77-e412-4d7d-9af4-8895278b4443"), - // }, - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // }, - // }, - // { - // Name: to.Ptr("X01"), - // Type: to.Ptr("Microsoft.Workloads/sapVirtualInstances"), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/sapVirtualInstances/X01"), - // SystemData: &armworkloads.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // CreatedBy: to.Ptr("user@xyz.com"), - // CreatedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T15:10:46.196Z"); return t}()), - // LastModifiedBy: to.Ptr("user@xyz.com"), - // LastModifiedByType: to.Ptr(armworkloads.CreatedByTypeUser), - // }, - // Location: to.Ptr("westcentralus"), - // Tags: map[string]*string{ - // }, - // Properties: &armworkloads.SAPVirtualInstanceProperties{ - // Configuration: &armworkloads.DeploymentConfiguration{ - // ConfigurationType: to.Ptr(armworkloads.SAPConfigurationTypeDeployment), - // AppLocation: to.Ptr("eastus"), - // InfrastructureConfiguration: &armworkloads.ThreeTierConfiguration{ - // AppResourceGroup: to.Ptr("X00-RG"), - // DeploymentType: to.Ptr(armworkloads.SAPDeploymentTypeThreeTier), - // ApplicationServer: &armworkloads.ApplicationServerConfiguration{ - // InstanceCount: to.Ptr[int64](10), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId3"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // CentralServer: &armworkloads.CentralServerConfiguration{ - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId1"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // DatabaseServer: &armworkloads.DatabaseConfiguration{ - // DatabaseType: to.Ptr(armworkloads.SAPDatabaseTypeHANA), - // InstanceCount: to.Ptr[int64](1), - // SubnetID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/vnet1/subnets/subnetId2"), - // VirtualMachineConfiguration: &armworkloads.VirtualMachineConfiguration{ - // ImageReference: &armworkloads.ImageReference{ - // Offer: to.Ptr("RHEL-SAP"), - // Publisher: to.Ptr("RedHat"), - // SKU: to.Ptr("7.4"), - // Version: to.Ptr("7.4.2019062505"), - // }, - // OSProfile: &armworkloads.OSProfile{ - // AdminUsername: to.Ptr("{your-username}"), - // OSConfiguration: &armworkloads.LinuxConfiguration{ - // OSType: to.Ptr(armworkloads.OSTypeLinux), - // DisablePasswordAuthentication: to.Ptr(true), - // SSH: &armworkloads.SSHConfiguration{ - // PublicKeys: []*armworkloads.SSHPublicKey{ - // { - // KeyData: to.Ptr("ssh-rsa public key"), - // }}, - // }, - // }, - // }, - // VMSize: to.Ptr("Standard_D8s_v3"), - // }, - // }, - // }, - // SoftwareConfiguration: &armworkloads.ServiceInitiatedSoftwareConfiguration{ - // SoftwareInstallationType: to.Ptr(armworkloads.SAPSoftwareInstallationTypeServiceInitiated), - // BomURL: to.Ptr("https://myaccount.blob.core.windows.net/mycontainer/myblob"), - // SapBitsStorageAccountID: to.Ptr("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/ajgupt-test/providers/Microsoft.Storage/storageAccounts/ajguptsavnet"), - // SapFqdn: to.Ptr("sapsystem.contoso.net"), - // SoftwareVersion: to.Ptr("SAP S/4HANA 2020 FPS01"), - // }, - // }, - // Environment: to.Ptr(armworkloads.SAPEnvironmentTypeProd), - // Health: to.Ptr(armworkloads.SAPHealthStateHealthy), - // ProvisioningState: to.Ptr(armworkloads.SapVirtualInstanceProvisioningStateSucceeded), - // SapProduct: to.Ptr(armworkloads.SAPProductTypeS4HANA), - // State: to.Ptr(armworkloads.SAPVirtualInstanceStateRegistrationComplete), - // Status: to.Ptr(armworkloads.SAPVirtualInstanceStatusRunning), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Start.json -func ExampleSAPVirtualInstancesClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, "test-rg", "X00", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("1e4193c3-206e-4916-b124-1da16175eb0e"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/operations/locations/centralus/1e4193c3-206e-4916-b124-1da16175eb0e"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/630ec444f8dd7c09b9cdd5fa99951f8a0d1ad41f/specification/workloads/resource-manager/Microsoft.Workloads/preview/2022-11-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Stop.json -func ExampleSAPVirtualInstancesClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSAPVirtualInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, "test-rg", "X00", &armworkloads.SAPVirtualInstancesClientBeginStopOptions{Body: &armworkloads.StopRequest{ - SoftStopTimeoutSeconds: to.Ptr[int64](0), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armworkloads.OperationStatusResult{ - // Name: to.Ptr("1e4193c3-206e-4916-b124-1da16175eb0e"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:38:07.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/6d875e77-e412-4d7d-9af4-8895278b4443/resourceGroups/test-rg/providers/Microsoft.Workloads/operations/locations/centralus/1e4193c3-206e-4916-b124-1da16175eb0e"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-19T03:36:07.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -}