From 5a93710535291572a45f9c339a0ff1e5d5d28215 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 28 Oct 2022 03:10:48 +0000 Subject: [PATCH] CodeGen from PR 21284 in Azure/azure-rest-api-specs [Workloads - Sap Virtual Instance] (#21284) -Adds SAP software detection feature on a VIS -Changes were already checked-in to private repo in the PR: Azure/azure-rest-api-specs-pr#8871 The changes were verified. This commit just ports the same to the public repo. --- .../workloads/armworkloads/CHANGELOG.md | 30 ++ .../workloads/armworkloads/autorest.md | 6 +- .../workloads/armworkloads/client.go | 9 +- .../workloads/armworkloads/constants.go | 12 +- .../workloads/armworkloads/go.mod | 14 +- .../workloads/armworkloads/go.sum | 24 +- .../workloads/armworkloads/models.go | 202 ++++++----- .../workloads/armworkloads/models_serde.go | 35 ++ .../workloads/armworkloads/monitors_client.go | 2 - .../monitors_client_example_test.go | 184 ---------- .../armworkloads/operations_client.go | 1 - .../operations_client_example_test.go | 41 --- .../armworkloads/phpworkloads_client.go | 2 - .../phpworkloads_client_example_test.go | 271 --------------- .../armworkloads/polymorphic_helpers.go | 2 + .../armworkloads/providerinstances_client.go | 1 - .../providerinstances_client_example_test.go | 135 -------- .../sapapplicationserverinstances_client.go | 67 ++-- ...tionserverinstances_client_example_test.go | 158 --------- .../sapcentralinstances_client.go | 83 ++--- ...sapcentralinstances_client_example_test.go | 158 --------- .../sapdatabaseinstances_client.go | 67 ++-- ...apdatabaseinstances_client_example_test.go | 158 --------- .../sapvirtualinstances_client.go | 68 ++-- ...sapvirtualinstances_client_example_test.go | 321 ------------------ .../workloads/armworkloads/skus_client.go | 1 - .../armworkloads/skus_client_example_test.go | 41 --- .../armworkloads/wordpressinstances_client.go | 1 - .../wordpressinstances_client_example_test.go | 119 ------- .../workloadsclient_client_example_test.go | 80 ----- 30 files changed, 361 insertions(+), 1932 deletions(-) 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/phpworkloads_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/sapvirtualinstances_client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/skus_client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client_example_test.go delete mode 100644 sdk/resourcemanager/workloads/armworkloads/workloadsclient_client_example_test.go diff --git a/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md b/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md index 3e2c1000d1f6..7f1b5cb9a32f 100644 --- a/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md +++ b/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md @@ -1,5 +1,35 @@ # Release History +## 0.3.0 (2022-10-28) +### Breaking Changes + +- Function `*SAPDatabaseInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, SAPDatabaseInstance, *SAPDatabaseInstancesClientBeginCreateOptions)` to `(context.Context, string, string, string, *SAPDatabaseInstancesClientBeginCreateOptions)` +- Function `*SAPApplicationServerInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, SAPApplicationServerInstance, *SAPApplicationServerInstancesClientBeginCreateOptions)` to `(context.Context, string, string, string, *SAPApplicationServerInstancesClientBeginCreateOptions)` +- Function `*SAPVirtualInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, SAPVirtualInstance, *SAPVirtualInstancesClientBeginCreateOptions)` to `(context.Context, string, string, *SAPVirtualInstancesClientBeginCreateOptions)` +- Function `*SAPDatabaseInstancesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, UpdateSAPDatabaseInstanceRequest, *SAPDatabaseInstancesClientBeginUpdateOptions)` to `(context.Context, string, string, string, *SAPDatabaseInstancesClientBeginUpdateOptions)` +- Function `*SAPApplicationServerInstancesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, UpdateSAPApplicationInstanceRequest, *SAPApplicationServerInstancesClientBeginUpdateOptions)` to `(context.Context, string, string, string, *SAPApplicationServerInstancesClientBeginUpdateOptions)` +- Function `*SAPCentralInstancesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, UpdateSAPCentralInstanceRequest, *SAPCentralInstancesClientBeginUpdateOptions)` to `(context.Context, string, string, string, *SAPCentralInstancesClientBeginUpdateOptions)` +- Function `*SAPVirtualInstancesClient.Update` parameter(s) have been changed from `(context.Context, string, string, UpdateSAPVirtualInstanceRequest, *SAPVirtualInstancesClientUpdateOptions)` to `(context.Context, string, string, *SAPVirtualInstancesClientUpdateOptions)` +- Function `*SAPCentralInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, SAPCentralServerInstance, *SAPCentralInstancesClientBeginCreateOptions)` to `(context.Context, string, string, string, *SAPCentralInstancesClientBeginCreateOptions)` + +### Features Added + +- New const `SAPSoftwareInstallationTypeExternal` +- New const `SAPVirtualInstanceStateSoftwareDetectionFailed` +- New const `SAPVirtualInstanceStateSoftwareDetectionInProgress` +- New function `*ExternalInstallationSoftwareConfiguration.GetSoftwareConfiguration() *SoftwareConfiguration` +- New struct `ExternalInstallationSoftwareConfiguration` +- New field `Body` in struct `SAPDatabaseInstancesClientBeginUpdateOptions` +- New field `Body` in struct `SAPCentralInstancesClientBeginUpdateOptions` +- New field `Body` in struct `SAPVirtualInstancesClientUpdateOptions` +- New field `Body` in struct `SAPVirtualInstancesClientBeginCreateOptions` +- New field `ZoneRedundancyPreference` in struct `MonitorProperties` +- New field `Body` in struct `SAPApplicationServerInstancesClientBeginCreateOptions` +- New field `Body` in struct `SAPDatabaseInstancesClientBeginCreateOptions` +- New field `Body` in struct `SAPApplicationServerInstancesClientBeginUpdateOptions` +- New field `Body` in struct `SAPCentralInstancesClientBeginCreateOptions` + + ## 0.2.0 (2022-06-30) ### Breaking Changes diff --git a/sdk/resourcemanager/workloads/armworkloads/autorest.md b/sdk/resourcemanager/workloads/armworkloads/autorest.md index a3737c11c6e5..198c018f3a0d 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/45472ea9fc026c14e8962f78757a589b6586fe9d/specification/workloads/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/45472ea9fc026c14e8962f78757a589b6586fe9d/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.2.0 +module-version: 0.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/workloads/armworkloads/client.go b/sdk/resourcemanager/workloads/armworkloads/client.go index 60ed2d3ed885..98fc10980ef8 100644 --- a/sdk/resourcemanager/workloads/armworkloads/client.go +++ b/sdk/resourcemanager/workloads/armworkloads/client.go @@ -55,7 +55,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options return client, nil } -// SAPAvailabilityZoneDetails - Get SAP Availability Zone Details. +// 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 2021-12-01-preview // location - The name of Azure region. @@ -110,7 +110,7 @@ func (client *Client) sapAvailabilityZoneDetailsHandleResponse(resp *http.Respon return result, nil } -// SAPDiskConfigurations - Get SAP Disk Configurations. +// 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 2021-12-01-preview // location - The name of Azure region. @@ -164,7 +164,8 @@ func (client *Client) sapDiskConfigurationsHandleResponse(resp *http.Response) ( return result, nil } -// SAPSizingRecommendations - Get SAP sizing recommendations. +// SAPSizingRecommendations - Get SAP sizing recommendations by providing input SAPS for application tier and memory required +// for database tier // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // location - The name of Azure region. @@ -219,7 +220,7 @@ func (client *Client) sapSizingRecommendationsHandleResponse(resp *http.Response return result, nil } -// SAPSupportedSKU - Get SAP supported SKUs. +// 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 2021-12-01-preview // location - The name of Azure region. diff --git a/sdk/resourcemanager/workloads/armworkloads/constants.go b/sdk/resourcemanager/workloads/armworkloads/constants.go index bc47439234b8..264e91726340 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.2.0" + moduleVersion = "v0.3.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -552,7 +552,7 @@ func PossibleSAPDatabaseTypeValues() []SAPDatabaseType { } } -// SAPDeploymentType - The deployment Type. +// SAPDeploymentType - The type of SAP deployment, single server or Three tier. type SAPDeploymentType string const ( @@ -584,7 +584,7 @@ func PossibleSAPEnvironmentTypeValues() []SAPEnvironmentType { } } -// SAPHealthState - Defines the SAP Instance health. +// SAPHealthState - Defines the health of SAP Instances. type SAPHealthState string const ( @@ -643,6 +643,7 @@ func PossibleSAPProductTypeValues() []SAPProductType { type SAPSoftwareInstallationType string const ( + SAPSoftwareInstallationTypeExternal SAPSoftwareInstallationType = "External" SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig SAPSoftwareInstallationType = "SAPInstallWithoutOSConfig" SAPSoftwareInstallationTypeServiceInitiated SAPSoftwareInstallationType = "ServiceInitiated" ) @@ -650,6 +651,7 @@ const ( // PossibleSAPSoftwareInstallationTypeValues returns the possible values for the SAPSoftwareInstallationType const type. func PossibleSAPSoftwareInstallationTypeValues() []SAPSoftwareInstallationType { return []SAPSoftwareInstallationType{ + SAPSoftwareInstallationTypeExternal, SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig, SAPSoftwareInstallationTypeServiceInitiated, } @@ -666,6 +668,8 @@ const ( SAPVirtualInstanceStateInfrastructureDeploymentInProgress SAPVirtualInstanceState = "InfrastructureDeploymentInProgress" SAPVirtualInstanceStateInfrastructureDeploymentPending SAPVirtualInstanceState = "InfrastructureDeploymentPending" SAPVirtualInstanceStateRegistrationComplete SAPVirtualInstanceState = "RegistrationComplete" + SAPVirtualInstanceStateSoftwareDetectionFailed SAPVirtualInstanceState = "SoftwareDetectionFailed" + SAPVirtualInstanceStateSoftwareDetectionInProgress SAPVirtualInstanceState = "SoftwareDetectionInProgress" SAPVirtualInstanceStateSoftwareInstallationFailed SAPVirtualInstanceState = "SoftwareInstallationFailed" SAPVirtualInstanceStateSoftwareInstallationInProgress SAPVirtualInstanceState = "SoftwareInstallationInProgress" SAPVirtualInstanceStateSoftwareInstallationPending SAPVirtualInstanceState = "SoftwareInstallationPending" @@ -681,6 +685,8 @@ func PossibleSAPVirtualInstanceStateValues() []SAPVirtualInstanceState { SAPVirtualInstanceStateInfrastructureDeploymentInProgress, SAPVirtualInstanceStateInfrastructureDeploymentPending, SAPVirtualInstanceStateRegistrationComplete, + SAPVirtualInstanceStateSoftwareDetectionFailed, + SAPVirtualInstanceStateSoftwareDetectionInProgress, SAPVirtualInstanceStateSoftwareInstallationFailed, SAPVirtualInstanceStateSoftwareInstallationInProgress, SAPVirtualInstanceStateSoftwareInstallationPending, diff --git a/sdk/resourcemanager/workloads/armworkloads/go.mod b/sdk/resourcemanager/workloads/armworkloads/go.mod index 9e65349ccb34..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.1.0 -) +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.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // 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 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/workloads/armworkloads/go.sum +++ b/sdk/resourcemanager/workloads/armworkloads/go.sum @@ -1,33 +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.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= 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.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= 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 v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -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/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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 b9d24276bc67..fc0cf74749ff 100644 --- a/sdk/resourcemanager/workloads/armworkloads/models.go +++ b/sdk/resourcemanager/workloads/armworkloads/models.go @@ -62,7 +62,7 @@ type CentralServerConfiguration struct { VirtualMachineConfiguration *VirtualMachineConfiguration `json:"virtualMachineConfiguration,omitempty"` } -// CentralServerVMDetails - The Central Server VM Details. +// CentralServerVMDetails - The SAP Central Services Instance VM details. type CentralServerVMDetails struct { // READ-ONLY; Defines the type of central server VM. Type *CentralServerVirtualMachineType `json:"type,omitempty" azure:"ro"` @@ -183,7 +183,7 @@ type DatabaseProfile struct { ServerResourceID *string `json:"serverResourceId,omitempty" azure:"ro"` } -// DatabaseVMDetails - The Database VM Details. +// DatabaseVMDetails - Database VM details. type DatabaseVMDetails struct { // READ-ONLY; Defines the SAP Instance status. Status *SAPVirtualInstanceStatus `json:"status,omitempty" azure:"ro"` @@ -276,42 +276,42 @@ type DiskInfo struct { SizeInGB *int64 `json:"sizeInGB,omitempty"` } -// EnqueueReplicationServerProperties - Defines the SAP ERS Server properties. +// EnqueueReplicationServerProperties - Defines the SAP Enqueue Replication Server (ERS) properties. type EnqueueReplicationServerProperties struct { // READ-ONLY; Defines the type of Enqueue Replication Server. ErsVersion *EnqueueReplicationServerType `json:"ersVersion,omitempty" azure:"ro"` - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The ERS server SAP host name. + // READ-ONLY; ERS SAP Hostname. Hostname *string `json:"hostname,omitempty" azure:"ro"` - // READ-ONLY; The ERS server SAP IP Address. + // READ-ONLY; ERS SAP IP Address. IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` - // READ-ONLY; The ERS server instance id. + // READ-ONLY; ERS Instance Number. InstanceNo *string `json:"instanceNo,omitempty" azure:"ro"` - // READ-ONLY; The ERS server SAP kernel patch. + // READ-ONLY; ERS SAP Kernel Patch level. KernelPatch *string `json:"kernelPatch,omitempty" azure:"ro"` - // READ-ONLY; The ERS server SAP kernel version. + // READ-ONLY; ERS SAP Kernel Version. KernelVersion *string `json:"kernelVersion,omitempty" azure:"ro"` } -// EnqueueServerProperties - Defines the SAP enqueue server properties. +// EnqueueServerProperties - Defines the SAP Enqueue Server properties. type EnqueueServerProperties struct { - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The enqueue server SAP host name. + // READ-ONLY; Enqueue Server SAP Hostname. Hostname *string `json:"hostname,omitempty" azure:"ro"` - // READ-ONLY; The enqueue server SAP IP Address. + // READ-ONLY; Enqueue Server SAP IP Address. IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` - // READ-ONLY; The enqueue server Port. + // READ-ONLY; Enqueue Server Port. Port *int64 `json:"port,omitempty" azure:"ro"` } @@ -385,6 +385,23 @@ type ErrorResponse struct { Error *ErrorDetail `json:"error,omitempty"` } +// ExternalInstallationSoftwareConfiguration - The SAP Software configuration Input when the software is installed externally +// outside the service. +type ExternalInstallationSoftwareConfiguration struct { + // REQUIRED; The SAP software installation Type. + SoftwareInstallationType *SAPSoftwareInstallationType `json:"softwareInstallationType,omitempty"` + + // The resource ID of the virtual machine containing the central server instance. + CentralServerVMID *string `json:"centralServerVmId,omitempty"` +} + +// GetSoftwareConfiguration implements the SoftwareConfigurationClassification interface for type ExternalInstallationSoftwareConfiguration. +func (e *ExternalInstallationSoftwareConfiguration) GetSoftwareConfiguration() *SoftwareConfiguration { + return &SoftwareConfiguration{ + SoftwareInstallationType: e.SoftwareInstallationType, + } +} + // FileshareProfile - File share profile type FileshareProfile struct { // REQUIRED; Share type @@ -405,10 +422,10 @@ type FileshareProfile struct { // GatewayServerProperties - Defines the SAP Gateway Server properties. type GatewayServerProperties struct { - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The gateway Port. + // READ-ONLY; Gateway Port. Port *int64 `json:"port,omitempty" azure:"ro"` } @@ -512,7 +529,7 @@ type InfrastructureConfiguration struct { // REQUIRED; The application resource group where SAP system resources will be deployed. AppResourceGroup *string `json:"appResourceGroup,omitempty"` - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` } @@ -550,27 +567,27 @@ type ManagedRGConfiguration struct { Name *string `json:"name,omitempty"` } -// MessageServerProperties - Defines the SAP message server properties. +// MessageServerProperties - Defines the SAP Message Server properties. type MessageServerProperties struct { - // READ-ONLY; The message server http port. + // READ-ONLY; Message Server HTTP Port. HTTPPort *int64 `json:"httpPort,omitempty" azure:"ro"` - // READ-ONLY; The message server https port. + // READ-ONLY; Message Server HTTPS Port. HTTPSPort *int64 `json:"httpsPort,omitempty" azure:"ro"` - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The message server SAP host name. + // READ-ONLY; Message Server SAP Hostname. Hostname *string `json:"hostname,omitempty" azure:"ro"` - // READ-ONLY; The message server IP Address. + // READ-ONLY; Message server IP Address. IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` - // READ-ONLY; The message server internal MS port. + // READ-ONLY; Message Server internal MS port. InternalMsPort *int64 `json:"internalMsPort,omitempty" azure:"ro"` - // READ-ONLY; The message server port. + // READ-ONLY; Message Server port. MSPort *int64 `json:"msPort,omitempty" azure:"ro"` } @@ -628,6 +645,10 @@ type MonitorProperties struct { // Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer VNET. RoutingPreference *RoutingPreference `json:"routingPreference,omitempty"` + // Sets the preference for zone redundancy on resources created for the SAP monitor. By default resources will be created + // which do not support zone redundancy. + ZoneRedundancyPreference *string `json:"zoneRedundancyPreference,omitempty"` + // READ-ONLY; Defines the SAP monitor errors. Errors *MonitorPropertiesErrors `json:"errors,omitempty" azure:"ro"` @@ -719,9 +740,9 @@ func (m *MsSQLServerProviderInstanceProperties) GetProviderSpecificProperties() } } -// NetworkConfiguration - Defines the network configuration for SAP infrastructure +// NetworkConfiguration - Defines the network configuration type for SAP system infrastructure that is being deployed type NetworkConfiguration struct { - // Specifies whether a secondary IP address should be added to the network interface on all VMs + // Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed IsSecondaryIPEnabled *bool `json:"isSecondaryIpEnabled,omitempty"` } @@ -1356,12 +1377,12 @@ type RestrictionInfo struct { Zones []*string `json:"zones,omitempty"` } -// SAPApplicationServerInstance - Define the SAP Application Server Instance. +// SAPApplicationServerInstance - Define the SAP Application Server Instance resource. type SAPApplicationServerInstance struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Defines the SAP Application Server properties. + // Defines the SAP Application Server instance properties. Properties *SAPApplicationServerProperties `json:"properties,omitempty"` // Resource tags. @@ -1380,18 +1401,20 @@ type SAPApplicationServerInstance struct { Type *string `json:"type,omitempty" azure:"ro"` } -// SAPApplicationServerInstanceList - Defines the collection of SAP Application Server Instances. +// SAPApplicationServerInstanceList - Defines the collection of SAP Application Server Instance resources. type SAPApplicationServerInstanceList struct { // Gets the value of next link. NextLink *string `json:"nextLink,omitempty"` - // Gets the list of SAP Application Server instances. + // Gets the list of SAP Application Server instance resources. Value []*SAPApplicationServerInstance `json:"value,omitempty"` } // SAPApplicationServerInstancesClientBeginCreateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginCreate // method. type SAPApplicationServerInstancesClientBeginCreateOptions struct { + // The SAP Application Server Instance resource request body. + Body *SAPApplicationServerInstance // Resumes the LRO from the provided token. ResumeToken string } @@ -1406,6 +1429,8 @@ type SAPApplicationServerInstancesClientBeginDeleteOptions struct { // SAPApplicationServerInstancesClientBeginUpdateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginUpdate // method. type SAPApplicationServerInstancesClientBeginUpdateOptions struct { + // The SAP Application Server Instance resource request body. + Body *UpdateSAPApplicationInstanceRequest // Resumes the LRO from the provided token. ResumeToken string } @@ -1422,36 +1447,36 @@ type SAPApplicationServerInstancesClientListOptions struct { // placeholder for future optional parameters } -// SAPApplicationServerProperties - Defines the SAP Application Server properties. +// SAPApplicationServerProperties - Defines the SAP Application Server instance properties. type SAPApplicationServerProperties struct { // READ-ONLY; Defines the Application Instance errors. Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` - // READ-ONLY; The application server gateway Port. + // READ-ONLY; Application server instance gateway Port. GatewayPort *int64 `json:"gatewayPort,omitempty" azure:"ro"` - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The application server SAP host name. + // READ-ONLY; Application server instance SAP hostname. Hostname *string `json:"hostname,omitempty" azure:"ro"` - // READ-ONLY; The application server SAP IP Address. + // READ-ONLY; Application server instance SAP IP Address. IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` - // READ-ONLY; The application server ICM HTTP Port. + // READ-ONLY; Application server instance ICM HTTP Port. IcmHTTPPort *int64 `json:"icmHttpPort,omitempty" azure:"ro"` - // READ-ONLY; The application server ICM HTTPS Port. + // READ-ONLY; Application server instance ICM HTTPS Port. IcmHTTPSPort *int64 `json:"icmHttpsPort,omitempty" azure:"ro"` - // READ-ONLY; The application server instance id. + // READ-ONLY; Application server Instance Number. InstanceNo *string `json:"instanceNo,omitempty" azure:"ro"` - // READ-ONLY; The application server SAP kernel patch. + // READ-ONLY; Application server instance SAP Kernel Patch level. KernelPatch *string `json:"kernelPatch,omitempty" azure:"ro"` - // READ-ONLY; The application server SAP kernel version. + // READ-ONLY; Application server instance SAP Kernel Version. KernelVersion *string `json:"kernelVersion,omitempty" azure:"ro"` // READ-ONLY; Defines the provisioning states. @@ -1460,7 +1485,7 @@ type SAPApplicationServerProperties struct { // READ-ONLY; Defines the SAP Instance status. Status *SAPVirtualInstanceStatus `json:"status,omitempty" azure:"ro"` - // READ-ONLY; The application server subnet. + // READ-ONLY; Application server Subnet. Subnet *string `json:"subnet,omitempty" azure:"ro"` // READ-ONLY; The virtual machine. @@ -1494,18 +1519,20 @@ type SAPAvailabilityZonePair struct { ZoneB *int64 `json:"zoneB,omitempty"` } -// SAPCentralInstanceList - Defines the collection of SAP Central Instances. +// SAPCentralInstanceList - Defines the collection of SAP Central Services Instance resources. type SAPCentralInstanceList struct { // Gets the value of next link. NextLink *string `json:"nextLink,omitempty"` - // Gets the list of SAP central instances. + // Gets the list of SAP central services instance resources. Value []*SAPCentralServerInstance `json:"value,omitempty"` } // SAPCentralInstancesClientBeginCreateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginCreate // method. type SAPCentralInstancesClientBeginCreateOptions struct { + // The SAP Central Services Instance request body. + Body *SAPCentralServerInstance // Resumes the LRO from the provided token. ResumeToken string } @@ -1520,6 +1547,8 @@ type SAPCentralInstancesClientBeginDeleteOptions struct { // SAPCentralInstancesClientBeginUpdateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginUpdate // method. type SAPCentralInstancesClientBeginUpdateOptions struct { + // The SAP Central Services Instance resource request body. + Body *UpdateSAPCentralInstanceRequest // Resumes the LRO from the provided token. ResumeToken string } @@ -1534,12 +1563,12 @@ type SAPCentralInstancesClientListOptions struct { // placeholder for future optional parameters } -// SAPCentralServerInstance - Define the SAP Central Server Instance. +// SAPCentralServerInstance - Define the SAP Central Services Instance resource. type SAPCentralServerInstance struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Defines the SAP Central Server properties. + // Defines the SAP Central Services Instance properties. Properties *SAPCentralServerProperties `json:"properties,omitempty"` // Resource tags. @@ -1558,33 +1587,33 @@ type SAPCentralServerInstance struct { Type *string `json:"type,omitempty" azure:"ro"` } -// SAPCentralServerProperties - Defines the SAP Central Server properties. +// SAPCentralServerProperties - Defines the SAP Central Services Instance properties. type SAPCentralServerProperties struct { - // Defines the SAP ERS Server properties. + // Defines the SAP Enqueue Replication Server (ERS) properties. EnqueueReplicationServerProperties *EnqueueReplicationServerProperties `json:"enqueueReplicationServerProperties,omitempty"` - // Defines the SAP enqueue server properties. + // Defines the SAP Enqueue Server properties. EnqueueServerProperties *EnqueueServerProperties `json:"enqueueServerProperties,omitempty"` // Defines the SAP Gateway Server properties. GatewayServerProperties *GatewayServerProperties `json:"gatewayServerProperties,omitempty"` - // Defines the SAP message server properties. + // Defines the SAP Message Server properties. MessageServerProperties *MessageServerProperties `json:"messageServerProperties,omitempty"` - // READ-ONLY; Defines the Central Instance errors. + // READ-ONLY; Defines the errors related to SAP Central Services Instance resource. Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` - // READ-ONLY; The central server instance id. + // READ-ONLY; The central services instance number. InstanceNo *string `json:"instanceNo,omitempty" azure:"ro"` - // READ-ONLY; The central server kernel patch. + // READ-ONLY; The central services instance Kernel Patch level. KernelPatch *string `json:"kernelPatch,omitempty" azure:"ro"` - // READ-ONLY; The central server kernel version. + // READ-ONLY; The central services instance Kernel Version. KernelVersion *string `json:"kernelVersion,omitempty" azure:"ro"` // READ-ONLY; Defines the provisioning states. @@ -1593,10 +1622,10 @@ type SAPCentralServerProperties struct { // READ-ONLY; Defines the SAP Instance status. Status *SAPVirtualInstanceStatus `json:"status,omitempty" azure:"ro"` - // READ-ONLY; The central server subnet. + // READ-ONLY; The central services instance subnet. Subnet *string `json:"subnet,omitempty" azure:"ro"` - // READ-ONLY; The list of virtual machines. + // READ-ONLY; The list of virtual machines corresponding to the Central Services instance. VMDetails []*CentralServerVMDetails `json:"vmDetails,omitempty" azure:"ro"` } @@ -1618,12 +1647,12 @@ type SAPConfiguration struct { // GetSAPConfiguration implements the SAPConfigurationClassification interface for type SAPConfiguration. func (s *SAPConfiguration) GetSAPConfiguration() *SAPConfiguration { return s } -// SAPDatabaseInstance - Define the SAP Database Instance. +// SAPDatabaseInstance - Define the Database resource. type SAPDatabaseInstance struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // Defines the SAP Database properties. + // Defines the Database properties. Properties *SAPDatabaseProperties `json:"properties,omitempty"` // Resource tags. @@ -1654,6 +1683,8 @@ type SAPDatabaseInstanceList struct { // SAPDatabaseInstancesClientBeginCreateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginCreate // method. type SAPDatabaseInstancesClientBeginCreateOptions struct { + // Request body of Database resource of a SAP system. + Body *SAPDatabaseInstance // Resumes the LRO from the provided token. ResumeToken string } @@ -1668,6 +1699,8 @@ type SAPDatabaseInstancesClientBeginDeleteOptions struct { // SAPDatabaseInstancesClientBeginUpdateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginUpdate // method. type SAPDatabaseInstancesClientBeginUpdateOptions struct { + // Database resource update request body. + Body *UpdateSAPDatabaseInstanceRequest // Resumes the LRO from the provided token. ResumeToken string } @@ -1682,18 +1715,18 @@ type SAPDatabaseInstancesClientListOptions struct { // placeholder for future optional parameters } -// SAPDatabaseProperties - Defines the SAP Database properties. +// SAPDatabaseProperties - Defines the Database properties. type SAPDatabaseProperties struct { - // READ-ONLY; The database SID. + // READ-ONLY; Database SID name. DatabaseSid *string `json:"databaseSid,omitempty" azure:"ro"` - // READ-ONLY; The SAP database type. + // READ-ONLY; Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL Server. DatabaseType *string `json:"databaseType,omitempty" azure:"ro"` - // READ-ONLY; Defines the Database Instance errors. + // READ-ONLY; Defines the errors related to Database resource. Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` - // READ-ONLY; The database IP Address. + // READ-ONLY; Database IP Address. IPAddress *string `json:"ipAddress,omitempty" azure:"ro"` // READ-ONLY; Defines the provisioning states. @@ -1702,10 +1735,10 @@ type SAPDatabaseProperties struct { // READ-ONLY; Defines the SAP Instance status. Status *SAPVirtualInstanceStatus `json:"status,omitempty" azure:"ro"` - // READ-ONLY; The database subnet. + // READ-ONLY; Database subnet. Subnet *string `json:"subnet,omitempty" azure:"ro"` - // READ-ONLY; The list of virtual machines. + // READ-ONLY; The list of virtual machines corresponding to the Database resource. VMDetails []*DatabaseVMDetails `json:"vmDetails,omitempty" azure:"ro"` } @@ -1827,7 +1860,7 @@ type SAPSizingRecommendationResultClassification interface { // SAPSizingRecommendationResult - The SAP sizing recommendation result. type SAPSizingRecommendationResult struct { - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` } @@ -1875,12 +1908,12 @@ type SAPSupportedSKUsRequest struct { HighAvailabilityType *SAPHighAvailabilityType `json:"highAvailabilityType,omitempty"` } -// SAPVirtualInstance - Define the Virtual Instance for SAP. +// SAPVirtualInstance - Define the Virtual Instance for SAP solutions resource. type SAPVirtualInstance struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // REQUIRED; Defines the Virtual Instance for SAP properties. + // REQUIRED; Defines the Virtual Instance for SAP solutions resource properties. Properties *SAPVirtualInstanceProperties `json:"properties,omitempty"` // Managed service identity (user assigned identities) @@ -1908,18 +1941,19 @@ type SAPVirtualInstanceError struct { Properties *ErrorDefinition `json:"properties,omitempty"` } -// SAPVirtualInstanceList - Defines the collection of Virtual Instance for SAP. +// SAPVirtualInstanceList - Defines the collection of Virtual Instance for SAP solutions resources. type SAPVirtualInstanceList struct { // Gets the value of next link. NextLink *string `json:"nextLink,omitempty"` - // Gets the list of Virtual Instances for SAP. + // Gets the list of Virtual Instances for SAP solutions resources. Value []*SAPVirtualInstance `json:"value,omitempty"` } -// SAPVirtualInstanceProperties - Defines the Virtual Instance for SAP properties. +// SAPVirtualInstanceProperties - Defines the Virtual Instance for SAP solutions resource properties. type SAPVirtualInstanceProperties struct { - // REQUIRED; Defines if an existing SAP system is being registered or a new SAP system is being created + // REQUIRED; Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP + // system is being registered with ACSS Configuration SAPConfigurationClassification `json:"configuration,omitempty"` // REQUIRED; Defines the environment type - Production/Non Production. @@ -1931,10 +1965,10 @@ type SAPVirtualInstanceProperties struct { // Managed resource group configuration ManagedResourceGroupConfiguration *ManagedRGConfiguration `json:"managedResourceGroupConfiguration,omitempty"` - // READ-ONLY; Defines the Virtual Instance for SAP errors. + // READ-ONLY; Indicates any errors on the Virtual Instance for SAP solutions resource. Errors *SAPVirtualInstanceError `json:"errors,omitempty" azure:"ro"` - // READ-ONLY; Defines the SAP Instance health. + // READ-ONLY; Defines the health of SAP Instances. Health *SAPHealthState `json:"health,omitempty" azure:"ro"` // READ-ONLY; Defines the provisioning states. @@ -1950,6 +1984,8 @@ type SAPVirtualInstanceProperties struct { // SAPVirtualInstancesClientBeginCreateOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginCreate // method. type SAPVirtualInstancesClientBeginCreateOptions struct { + // Virtual Instance for SAP solutions resource request body. + Body *SAPVirtualInstance // Resumes the LRO from the provided token. ResumeToken string } @@ -1971,7 +2007,7 @@ type SAPVirtualInstancesClientBeginStartOptions struct { // SAPVirtualInstancesClientBeginStopOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStop // method. type SAPVirtualInstancesClientBeginStopOptions struct { - // The Virtual Instances for SAP stop request body. + // The Virtual Instance for SAP solutions resource stop request body. Body *StopRequest // Resumes the LRO from the provided token. ResumeToken string @@ -1996,7 +2032,8 @@ type SAPVirtualInstancesClientListBySubscriptionOptions struct { // SAPVirtualInstancesClientUpdateOptions contains the optional parameters for the SAPVirtualInstancesClient.Update method. type SAPVirtualInstancesClientUpdateOptions struct { - // placeholder for future optional parameters + // Request body to update a Virtual Instance for SAP solutions resource. + Body *UpdateSAPVirtualInstanceRequest } // SKU - The resource model definition representing SKU @@ -2280,7 +2317,7 @@ type SingleServerConfiguration struct { // REQUIRED; The application resource group where SAP system resources will be deployed. AppResourceGroup *string `json:"appResourceGroup,omitempty"` - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` // REQUIRED; The subnet id. @@ -2306,7 +2343,7 @@ func (s *SingleServerConfiguration) GetInfrastructureConfiguration() *Infrastruc // SingleServerRecommendationResult - The recommended configuration for a single server SAP system. type SingleServerRecommendationResult struct { - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` // The recommended VM SKU for single server. @@ -2329,7 +2366,8 @@ type SiteProfile struct { // SoftwareConfigurationClassification provides polymorphic access to related types. // Call the interface's GetSoftwareConfiguration() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *SAPInstallWithoutOSConfigSoftwareConfiguration, *ServiceInitiatedSoftwareConfiguration, *SoftwareConfiguration +// - *ExternalInstallationSoftwareConfiguration, *SAPInstallWithoutOSConfigSoftwareConfiguration, *ServiceInitiatedSoftwareConfiguration, +// - *SoftwareConfiguration type SoftwareConfigurationClassification interface { // GetSoftwareConfiguration returns the SoftwareConfiguration content of the underlying type. GetSoftwareConfiguration() *SoftwareConfiguration @@ -2391,7 +2429,7 @@ type ThreeTierConfiguration struct { // REQUIRED; The database configuration. DatabaseServer *DatabaseConfiguration `json:"databaseServer,omitempty"` - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` // The high availability configuration. @@ -2411,7 +2449,7 @@ func (t *ThreeTierConfiguration) GetInfrastructureConfiguration() *Infrastructur // ThreeTierRecommendationResult - The recommended configuration for a three tier SAP system. type ThreeTierRecommendationResult struct { - // REQUIRED; The deployment Type. + // REQUIRED; The type of SAP deployment, single server or Three tier. DeploymentType *SAPDeploymentType `json:"deploymentType,omitempty"` // The application server instance count. diff --git a/sdk/resourcemanager/workloads/armworkloads/models_serde.go b/sdk/resourcemanager/workloads/armworkloads/models_serde.go index 239c731b9e51..f4d1cc54383f 100644 --- a/sdk/resourcemanager/workloads/armworkloads/models_serde.go +++ b/sdk/resourcemanager/workloads/armworkloads/models_serde.go @@ -862,6 +862,37 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ExternalInstallationSoftwareConfiguration. +func (e ExternalInstallationSoftwareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "centralServerVmId", e.CentralServerVMID) + objectMap["softwareInstallationType"] = SAPSoftwareInstallationTypeExternal + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalInstallationSoftwareConfiguration. +func (e *ExternalInstallationSoftwareConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "centralServerVmId": + err = unpopulate(val, "CentralServerVMID", &e.CentralServerVMID) + delete(rawMsg, key) + case "softwareInstallationType": + err = unpopulate(val, "SoftwareInstallationType", &e.SoftwareInstallationType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FileshareProfile. func (f FileshareProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1349,6 +1380,7 @@ func (m MonitorProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "msiArmId", m.MsiArmID) populate(objectMap, "provisioningState", m.ProvisioningState) populate(objectMap, "routingPreference", m.RoutingPreference) + populate(objectMap, "zoneRedundancyPreference", m.ZoneRedundancyPreference) return json.Marshal(objectMap) } @@ -1385,6 +1417,9 @@ func (m *MonitorProperties) UnmarshalJSON(data []byte) error { case "routingPreference": err = unpopulate(val, "RoutingPreference", &m.RoutingPreference) delete(rawMsg, key) + case "zoneRedundancyPreference": + err = unpopulate(val, "ZoneRedundancyPreference", &m.ZoneRedundancyPreference) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) diff --git a/sdk/resourcemanager/workloads/armworkloads/monitors_client.go b/sdk/resourcemanager/workloads/armworkloads/monitors_client.go index c60d2be7eea7..5f71d59d2eda 100644 --- a/sdk/resourcemanager/workloads/armworkloads/monitors_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/monitors_client.go @@ -240,7 +240,6 @@ 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. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // options - MonitorsClientListOptions contains the optional parameters for the MonitorsClient.List method. func (client *MonitorsClient) NewListPager(options *MonitorsClientListOptions) *runtime.Pager[MonitorsClientListResponse] { @@ -299,7 +298,6 @@ func (client *MonitorsClient) listHandleResponse(resp *http.Response) (MonitorsC } // NewListByResourceGroupPager - Gets a list of SAP monitors in the specified resource group. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - MonitorsClientListByResourceGroupOptions contains the optional parameters for the MonitorsClient.ListByResourceGroup 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 113b95c9de9f..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/monitors_client_example_test.go +++ /dev/null @@ -1,184 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/monitors_PatchTags_Delete.json -func ExampleMonitorsClient_Update() { - 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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/workloads/armworkloads/operations_client.go b/sdk/resourcemanager/workloads/armworkloads/operations_client.go index 1d9139eae17f..c1ba9988c65d 100644 --- a/sdk/resourcemanager/workloads/armworkloads/operations_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/operations_client.go @@ -50,7 +50,6 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all the available API operations under this PR -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { 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 ff7705d5c349..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/operations_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client.go b/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client.go index b7cd69fd3f96..14acb78c5042 100644 --- a/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client.go @@ -246,7 +246,6 @@ func (client *PhpWorkloadsClient) getHandleResponse(resp *http.Response) (PhpWor } // NewListByResourceGroupPager - Lists PHP workload resources in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - PhpWorkloadsClientListByResourceGroupOptions contains the optional parameters for the PhpWorkloadsClient.ListByResourceGroup @@ -311,7 +310,6 @@ func (client *PhpWorkloadsClient) listByResourceGroupHandleResponse(resp *http.R } // NewListBySubscriptionPager - Lists PHP workload resources for a subscription. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // options - PhpWorkloadsClientListBySubscriptionOptions contains the optional parameters for the PhpWorkloadsClient.ListBySubscription // method. diff --git a/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client_example_test.go deleted file mode 100644 index 613c8a642ef4..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/phpworkloads_client_example_test.go +++ /dev/null @@ -1,271 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_ListBySubscription.json -func ExamplePhpWorkloadsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_ListByResourceGroup.json -func ExamplePhpWorkloadsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("test-rg", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Get.json -func ExamplePhpWorkloadsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("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", - "wp39", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_CreateOrUpdate.json -func ExamplePhpWorkloadsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "test-rg", - "wp39", - armworkloads.PhpWorkloadResource{ - Location: to.Ptr("eastus2"), - Tags: map[string]*string{}, - Kind: to.Ptr(armworkloads.WorkloadKindWordPress), - Properties: &armworkloads.PhpWorkloadResourceProperties{ - AdminUserProfile: &armworkloads.UserProfile{ - SSHPublicKey: to.Ptr("===SSH=PUBLIC=KEY==="), - UserName: to.Ptr("wpadmin"), - }, - AppLocation: to.Ptr("eastus"), - BackupProfile: &armworkloads.BackupProfile{ - BackupEnabled: to.Ptr(armworkloads.EnableBackupDisabled), - }, - CacheProfile: &armworkloads.CacheProfile{ - Name: to.Ptr("wp-cache"), - Capacity: to.Ptr[int64](0), - Family: to.Ptr(armworkloads.RedisCacheFamilyC), - SKUName: to.Ptr("Basic"), - }, - ControllerProfile: &armworkloads.NodeProfile{ - Name: to.Ptr("contoller-vm"), - DataDisks: []*armworkloads.DiskInfo{ - { - SizeInGB: to.Ptr[int64](100), - StorageType: to.Ptr(armworkloads.DiskStorageTypePremiumLRS), - }}, - NodeSKU: to.Ptr("Standard_DS2_v2"), - OSDisk: &armworkloads.DiskInfo{ - StorageType: to.Ptr(armworkloads.DiskStorageTypePremiumLRS), - }, - OSImage: &armworkloads.OsImageProfile{ - Offer: to.Ptr(armworkloads.OSImageOfferUbuntuServer), - Publisher: to.Ptr(armworkloads.OSImagePublisherCanonical), - SKU: to.Ptr(armworkloads.OSImageSKU("18.0-LTS")), - Version: to.Ptr(armworkloads.OSImageVersionLatest), - }, - }, - DatabaseProfile: &armworkloads.DatabaseProfile{ - Type: to.Ptr(armworkloads.DatabaseTypeMySQL), - BackupRetentionDays: to.Ptr[int32](7), - HaEnabled: to.Ptr(armworkloads.HAEnabledDisabled), - ServerName: to.Ptr("wp-db-server"), - SKU: to.Ptr("Standard_D32s_v4"), - SSLEnforcementEnabled: to.Ptr(armworkloads.EnableSSLEnforcementEnabled), - StorageInGB: to.Ptr[int64](128), - StorageIops: to.Ptr[int64](200), - StorageSKU: to.Ptr("Premium_LRS"), - Tier: to.Ptr(armworkloads.DatabaseTierGeneralPurpose), - Version: to.Ptr("5.7"), - }, - FileshareProfile: &armworkloads.FileshareProfile{ - ShareSizeInGB: to.Ptr[int64](100), - ShareType: to.Ptr(armworkloads.FileShareTypeAzureFiles), - StorageType: to.Ptr(armworkloads.FileShareStorageTypePremiumLRS), - }, - ManagedResourceGroupConfiguration: &armworkloads.ManagedRGConfiguration{ - Name: to.Ptr("php-mrg-wp39"), - }, - NetworkProfile: &armworkloads.NetworkProfile{ - AzureFrontDoorEnabled: to.Ptr(armworkloads.AzureFrontDoorEnabledEnabled), - LoadBalancerSKU: to.Ptr("Standard"), - LoadBalancerType: to.Ptr(armworkloads.LoadBalancerTypeLoadBalancer), - }, - PhpProfile: &armworkloads.PhpProfile{ - Version: to.Ptr(armworkloads.PHPVersionSeven3), - }, - SearchProfile: &armworkloads.SearchProfile{ - NodeSKU: to.Ptr("Standard_DS2_v2"), - OSDisk: &armworkloads.DiskInfo{ - StorageType: to.Ptr(armworkloads.DiskStorageTypePremiumLRS), - }, - OSImage: &armworkloads.OsImageProfile{ - Offer: to.Ptr(armworkloads.OSImageOfferUbuntuServer), - Publisher: to.Ptr(armworkloads.OSImagePublisherCanonical), - SKU: to.Ptr(armworkloads.OSImageSKU("18.0-LTS")), - Version: to.Ptr(armworkloads.OSImageVersionLatest), - }, - SearchType: to.Ptr(armworkloads.SearchTypeElastic), - }, - SiteProfile: &armworkloads.SiteProfile{ - DomainName: to.Ptr("www.example.com"), - }, - WebNodesProfile: &armworkloads.VmssNodesProfile{ - Name: to.Ptr("web-server"), - NodeSKU: to.Ptr("Standard_DS2_v2"), - OSDisk: &armworkloads.DiskInfo{ - StorageType: to.Ptr(armworkloads.DiskStorageTypePremiumLRS), - }, - OSImage: &armworkloads.OsImageProfile{ - Offer: to.Ptr(armworkloads.OSImageOfferUbuntuServer), - Publisher: to.Ptr(armworkloads.OSImagePublisherCanonical), - SKU: to.Ptr(armworkloads.OSImageSKU("18.0-LTS")), - Version: to.Ptr(armworkloads.OSImageVersionLatest), - }, - AutoScaleMaxCount: to.Ptr[int32](1), - AutoScaleMinCount: to.Ptr[int32](1), - }, - }, - SKU: &armworkloads.SKU{ - Name: to.Ptr("Large"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Update.json -func ExamplePhpWorkloadsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("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", - "wp39", - armworkloads.PatchResourceRequestBody{ - Identity: &armworkloads.PatchResourceRequestBodyIdentity{ - Type: to.Ptr(armworkloads.ManagedServiceIdentityTypeNone), - }, - Tags: map[string]*string{ - "tag_name": to.Ptr("tag_value"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/PhpWorkloads_Delete.json -func ExamplePhpWorkloadsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewPhpWorkloadsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "test-rg", - "wp39", - &armworkloads.PhpWorkloadsClientBeginDeleteOptions{DeleteInfra: to.Ptr("false")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/polymorphic_helpers.go b/sdk/resourcemanager/workloads/armworkloads/polymorphic_helpers.go index 147d91511eeb..b682839787a8 100644 --- a/sdk/resourcemanager/workloads/armworkloads/polymorphic_helpers.go +++ b/sdk/resourcemanager/workloads/armworkloads/polymorphic_helpers.go @@ -131,6 +131,8 @@ func unmarshalSoftwareConfigurationClassification(rawMsg json.RawMessage) (Softw } var b SoftwareConfigurationClassification switch m["softwareInstallationType"] { + case string(SAPSoftwareInstallationTypeExternal): + b = &ExternalInstallationSoftwareConfiguration{} case string(SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig): b = &SAPInstallWithoutOSConfigSoftwareConfiguration{} case string(SAPSoftwareInstallationTypeServiceInitiated): diff --git a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go index 55eed2586fde..5d9a673f4cc5 100644 --- a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go @@ -260,7 +260,6 @@ 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. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // monitorName - Name of the SAP monitor resource. 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 eafb312e2c07..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client_example_test.go +++ /dev/null @@ -1,135 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/Db2ProviderInstances_Get.json -func ExampleProviderInstancesClient_Get() { - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/workloadmonitor/Db2ProviderInstances_Create.json -func ExampleProviderInstancesClient_BeginCreate() { - 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"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go index b447b9ba13a7..e73ac8a410f1 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client.go @@ -55,19 +55,18 @@ func NewSAPApplicationServerInstancesClient(subscriptionID string, credential az return client, nil } -// BeginCreate - Puts the SAP Application Server Instance. +// BeginCreate - Puts the SAP Application Server Instance resource. // 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 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// applicationInstanceName - The name of SAP Application Server instance. -// body - The SAP Application Server instance request body. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// applicationInstanceName - The name of SAP Application Server instance resource. // options - SAPApplicationServerInstancesClientBeginCreateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginCreate // method. -func (client *SAPApplicationServerInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body SAPApplicationServerInstance, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*runtime.Poller[SAPApplicationServerInstancesClientCreateResponse], error) { +func (client *SAPApplicationServerInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*runtime.Poller[SAPApplicationServerInstancesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, options) + resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { return nil, err } @@ -79,12 +78,12 @@ func (client *SAPApplicationServerInstancesClient) BeginCreate(ctx context.Conte } } -// Create - Puts the SAP Application Server Instance. +// Create - Puts the SAP Application Server Instance resource. // 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 2021-12-01-preview -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) +func (client *SAPApplicationServerInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { return nil, err } @@ -99,7 +98,7 @@ func (client *SAPApplicationServerInstancesClient) create(ctx context.Context, r } // createCreateRequest creates the Create request. -func (client *SAPApplicationServerInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body SAPApplicationServerInstance, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*policy.Request, error) { +func (client *SAPApplicationServerInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -125,16 +124,19 @@ func (client *SAPApplicationServerInstancesClient) createCreateRequest(ctx conte reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } -// BeginDelete - Deletes the SAP Application Server Instance. +// BeginDelete - Deletes the SAP Application Server Instance resource. // 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 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// applicationInstanceName - The name of SAP Application Server instance. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// applicationInstanceName - The name of SAP Application Server instance resource. // options - SAPApplicationServerInstancesClientBeginDeleteOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginDelete // method. func (client *SAPApplicationServerInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginDeleteOptions) (*runtime.Poller[SAPApplicationServerInstancesClientDeleteResponse], error) { @@ -151,7 +153,7 @@ func (client *SAPApplicationServerInstancesClient) BeginDelete(ctx context.Conte } } -// Delete - Deletes the SAP Application Server Instance. +// Delete - Deletes the SAP Application Server Instance resource. // 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 2021-12-01-preview @@ -200,12 +202,12 @@ func (client *SAPApplicationServerInstancesClient) deleteCreateRequest(ctx conte return req, nil } -// Get - Gets the SAP Application Server Instance. +// 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 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// applicationInstanceName - The name of SAP Application Server instance. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// applicationInstanceName - The name of SAP Application Server instance resource. // options - SAPApplicationServerInstancesClientGetOptions contains the optional parameters for the SAPApplicationServerInstancesClient.Get // method. func (client *SAPApplicationServerInstancesClient) Get(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientGetOptions) (SAPApplicationServerInstancesClientGetResponse, error) { @@ -262,11 +264,10 @@ func (client *SAPApplicationServerInstancesClient) getHandleResponse(resp *http. return result, nil } -// NewListPager - Lists the SAP Application server Instances in an SVI. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // options - SAPApplicationServerInstancesClientListOptions contains the optional parameters for the SAPApplicationServerInstancesClient.List // method. func (client *SAPApplicationServerInstancesClient) NewListPager(resourceGroupName string, sapVirtualInstanceName string, options *SAPApplicationServerInstancesClientListOptions) *runtime.Pager[SAPApplicationServerInstancesClientListResponse] { @@ -332,18 +333,17 @@ func (client *SAPApplicationServerInstancesClient) listHandleResponse(resp *http return result, nil } -// BeginUpdate - Puts the SAP Application Server Instance. +// BeginUpdate - Puts the SAP Application Server Instance resource. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// applicationInstanceName - The name of SAP Application Server instance. -// body - The SAP Application Server instance request body. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource +// applicationInstanceName - The name of SAP Application Server instance resource. // options - SAPApplicationServerInstancesClientBeginUpdateOptions contains the optional parameters for the SAPApplicationServerInstancesClient.BeginUpdate // method. -func (client *SAPApplicationServerInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body UpdateSAPApplicationInstanceRequest, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPApplicationServerInstancesClientUpdateResponse], error) { +func (client *SAPApplicationServerInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPApplicationServerInstancesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, body, options) + resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { return nil, err } @@ -355,11 +355,11 @@ func (client *SAPApplicationServerInstancesClient) BeginUpdate(ctx context.Conte } } -// Update - Puts the SAP Application Server Instance. +// Update - Puts the SAP Application Server Instance resource. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview -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) +func (client *SAPApplicationServerInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, options) if err != nil { return nil, err } @@ -374,7 +374,7 @@ func (client *SAPApplicationServerInstancesClient) update(ctx context.Context, r } // updateCreateRequest creates the Update request. -func (client *SAPApplicationServerInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, body UpdateSAPApplicationInstanceRequest, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *SAPApplicationServerInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, applicationInstanceName string, options *SAPApplicationServerInstancesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -400,5 +400,8 @@ func (client *SAPApplicationServerInstancesClient) updateCreateRequest(ctx conte reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } 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 62d64d7abda8..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapapplicationserverinstances_client_example_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPApplicationServerInstances_Create.json -func ExampleSAPApplicationServerInstancesClient_BeginCreate() { - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go index 30f73802d398..fb2c3a1d4eaf 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client.go @@ -55,19 +55,18 @@ func NewSAPCentralInstancesClient(subscriptionID string, credential azcore.Token return client, nil } -// BeginCreate - Puts the SAP Central Instance. -// This will be used by service only. PUT by end user will return a Bad Request error. +// BeginCreate - Creates the SAP Central Services Instance resource. +// 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 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// centralInstanceName - Central Instance name string modeled as parameter for auto generation to work correctly. -// body - The SAP Central Server instance request body. +// 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. // options - SAPCentralInstancesClientBeginCreateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginCreate // method. -func (client *SAPCentralInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body SAPCentralServerInstance, options *SAPCentralInstancesClientBeginCreateOptions) (*runtime.Poller[SAPCentralInstancesClientCreateResponse], error) { +func (client *SAPCentralInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginCreateOptions) (*runtime.Poller[SAPCentralInstancesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, options) + resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { return nil, err } @@ -79,12 +78,12 @@ func (client *SAPCentralInstancesClient) BeginCreate(ctx context.Context, resour } } -// Create - Puts the SAP Central Instance. -// This will be used by service only. PUT by end user will return a Bad Request error. +// Create - Creates the SAP Central Services Instance resource. +// 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 2021-12-01-preview -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) +func (client *SAPCentralInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { return nil, err } @@ -99,7 +98,7 @@ func (client *SAPCentralInstancesClient) create(ctx context.Context, resourceGro } // createCreateRequest creates the Create request. -func (client *SAPCentralInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body SAPCentralServerInstance, options *SAPCentralInstancesClientBeginCreateOptions) (*policy.Request, error) { +func (client *SAPCentralInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -125,16 +124,21 @@ func (client *SAPCentralInstancesClient) createCreateRequest(ctx context.Context reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } -// BeginDelete - Deletes the SAP Central Instance. -// This will be used by service only. Delete by end user will return a Bad Request error. +// BeginDelete - Deletes the SAP Central Services Instance resource. +// This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can +// delete the parent resource, which is the Virtual Instance for SAP solutions +// resource, using the delete operation on it. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// centralInstanceName - Central Instance name string modeled as parameter for auto generation to work correctly. +// 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. // options - SAPCentralInstancesClientBeginDeleteOptions contains the optional parameters for the SAPCentralInstancesClient.BeginDelete // method. func (client *SAPCentralInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginDeleteOptions) (*runtime.Poller[SAPCentralInstancesClientDeleteResponse], error) { @@ -151,8 +155,10 @@ func (client *SAPCentralInstancesClient) BeginDelete(ctx context.Context, resour } } -// Delete - Deletes the SAP Central Instance. -// This will be used by service only. Delete by end user will return a Bad Request error. +// Delete - Deletes the SAP Central Services Instance resource. +// This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can +// delete the parent resource, which is the Virtual Instance for SAP solutions +// resource, using the delete operation on it. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview func (client *SAPCentralInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginDeleteOptions) (*http.Response, error) { @@ -200,12 +206,12 @@ func (client *SAPCentralInstancesClient) deleteCreateRequest(ctx context.Context return req, nil } -// Get - Gets the SAP Central Instance. +// Get - Gets the SAP Central Services Instance resource. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// centralInstanceName - Central Instance name string modeled as parameter for auto generation to work correctly. +// 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. // options - SAPCentralInstancesClientGetOptions contains the optional parameters for the SAPCentralInstancesClient.Get method. func (client *SAPCentralInstancesClient) Get(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientGetOptions) (SAPCentralInstancesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) @@ -261,11 +267,10 @@ func (client *SAPCentralInstancesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListPager - Lists the SAP Central Instances in an SVI. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // options - SAPCentralInstancesClientListOptions contains the optional parameters for the SAPCentralInstancesClient.List // method. func (client *SAPCentralInstancesClient) NewListPager(resourceGroupName string, sapVirtualInstanceName string, options *SAPCentralInstancesClientListOptions) *runtime.Pager[SAPCentralInstancesClientListResponse] { @@ -331,19 +336,18 @@ func (client *SAPCentralInstancesClient) listHandleResponse(resp *http.Response) return result, nil } -// BeginUpdate - Updates the SAP Central Instance. -// This can be used to update tags. +// BeginUpdate - Updates the SAP Central Services Instance resource. +// This can be used to update tags on the resource. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// centralInstanceName - Central Instance name string modeled as parameter for auto generation to work correctly. -// body - The SAP Central Server instance request body. +// 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. // options - SAPCentralInstancesClientBeginUpdateOptions contains the optional parameters for the SAPCentralInstancesClient.BeginUpdate // method. -func (client *SAPCentralInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body UpdateSAPCentralInstanceRequest, options *SAPCentralInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPCentralInstancesClientUpdateResponse], error) { +func (client *SAPCentralInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPCentralInstancesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, body, options) + resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { return nil, err } @@ -355,12 +359,12 @@ func (client *SAPCentralInstancesClient) BeginUpdate(ctx context.Context, resour } } -// Update - Updates the SAP Central Instance. -// This can be used to update tags. +// Update - Updates the SAP Central Services Instance resource. +// This can be used to update tags on the resource. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview -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) +func (client *SAPCentralInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, centralInstanceName, options) if err != nil { return nil, err } @@ -375,7 +379,7 @@ func (client *SAPCentralInstancesClient) update(ctx context.Context, resourceGro } // updateCreateRequest creates the Update request. -func (client *SAPCentralInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, body UpdateSAPCentralInstanceRequest, options *SAPCentralInstancesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *SAPCentralInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, centralInstanceName string, options *SAPCentralInstancesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -401,5 +405,8 @@ func (client *SAPCentralInstancesClient) updateCreateRequest(ctx context.Context reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } 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 90a0f52b96b7..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapcentralinstances_client_example_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPCentralInstances_Create.json -func ExampleSAPCentralInstancesClient_BeginCreate() { - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go index a2ef7e5a4e81..9bd5785e1461 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client.go @@ -55,19 +55,18 @@ func NewSAPDatabaseInstancesClient(subscriptionID string, credential azcore.Toke return client, nil } -// BeginCreate - Puts the SAP Database Instance. +// BeginCreate - Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. // 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 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// databaseInstanceName - Database Instance string modeled as parameter for auto generation to work correctly. -// body - The SAP Database Server instance request body. +// 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. // options - SAPDatabaseInstancesClientBeginCreateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginCreate // method. -func (client *SAPDatabaseInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body SAPDatabaseInstance, options *SAPDatabaseInstancesClientBeginCreateOptions) (*runtime.Poller[SAPDatabaseInstancesClientCreateResponse], error) { +func (client *SAPDatabaseInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginCreateOptions) (*runtime.Poller[SAPDatabaseInstancesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, options) + resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { return nil, err } @@ -79,12 +78,12 @@ func (client *SAPDatabaseInstancesClient) BeginCreate(ctx context.Context, resou } } -// Create - Puts the SAP Database Instance. +// Create - Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. // 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 2021-12-01-preview -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) +func (client *SAPDatabaseInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { return nil, err } @@ -99,7 +98,7 @@ func (client *SAPDatabaseInstancesClient) create(ctx context.Context, resourceGr } // createCreateRequest creates the Create request. -func (client *SAPDatabaseInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body SAPDatabaseInstance, options *SAPDatabaseInstancesClientBeginCreateOptions) (*policy.Request, error) { +func (client *SAPDatabaseInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -125,16 +124,19 @@ func (client *SAPDatabaseInstancesClient) createCreateRequest(ctx context.Contex reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } -// BeginDelete - Deletes the SAP Database Instance. +// BeginDelete - Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. // 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 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// databaseInstanceName - Database Instance string modeled as parameter for auto generation to work correctly. +// 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. // options - SAPDatabaseInstancesClientBeginDeleteOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginDelete // method. func (client *SAPDatabaseInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginDeleteOptions) (*runtime.Poller[SAPDatabaseInstancesClientDeleteResponse], error) { @@ -151,7 +153,7 @@ func (client *SAPDatabaseInstancesClient) BeginDelete(ctx context.Context, resou } } -// Delete - Deletes the SAP Database Instance. +// Delete - Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. // 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 2021-12-01-preview @@ -200,12 +202,12 @@ func (client *SAPDatabaseInstancesClient) deleteCreateRequest(ctx context.Contex return req, nil } -// Get - Gets the SAP Database Instance. +// Get - Gets the SAP Database Instance resource. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// databaseInstanceName - Database Instance string modeled as parameter for auto generation to work correctly. +// 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. // options - SAPDatabaseInstancesClientGetOptions contains the optional parameters for the SAPDatabaseInstancesClient.Get // method. func (client *SAPDatabaseInstancesClient) Get(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientGetOptions) (SAPDatabaseInstancesClientGetResponse, error) { @@ -262,11 +264,10 @@ func (client *SAPDatabaseInstancesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListPager - Lists the SAP Database Instances in an SVI. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Lists the Database resources associated with a Virtual Instance for SAP solutions resource. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // options - SAPDatabaseInstancesClientListOptions contains the optional parameters for the SAPDatabaseInstancesClient.List // method. func (client *SAPDatabaseInstancesClient) NewListPager(resourceGroupName string, sapVirtualInstanceName string, options *SAPDatabaseInstancesClientListOptions) *runtime.Pager[SAPDatabaseInstancesClientListResponse] { @@ -332,18 +333,17 @@ func (client *SAPDatabaseInstancesClient) listHandleResponse(resp *http.Response return result, nil } -// BeginUpdate - Puts the SAP Database Instance. +// BeginUpdate - Updates the Database resource. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// databaseInstanceName - Database Instance string modeled as parameter for auto generation to work correctly. -// body - The SAP Database Server instance request body. +// 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. // options - SAPDatabaseInstancesClientBeginUpdateOptions contains the optional parameters for the SAPDatabaseInstancesClient.BeginUpdate // method. -func (client *SAPDatabaseInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body UpdateSAPDatabaseInstanceRequest, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPDatabaseInstancesClientUpdateResponse], error) { +func (client *SAPDatabaseInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*runtime.Poller[SAPDatabaseInstancesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, body, options) + resp, err := client.update(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { return nil, err } @@ -355,11 +355,11 @@ func (client *SAPDatabaseInstancesClient) BeginUpdate(ctx context.Context, resou } } -// Update - Puts the SAP Database Instance. +// Update - Updates the Database resource. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview -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) +func (client *SAPDatabaseInstancesClient) update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, options) if err != nil { return nil, err } @@ -374,7 +374,7 @@ func (client *SAPDatabaseInstancesClient) update(ctx context.Context, resourceGr } // updateCreateRequest creates the Update request. -func (client *SAPDatabaseInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, body UpdateSAPDatabaseInstanceRequest, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*policy.Request, error) { +func (client *SAPDatabaseInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, databaseInstanceName string, options *SAPDatabaseInstancesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -400,5 +400,8 @@ func (client *SAPDatabaseInstancesClient) updateCreateRequest(ctx context.Contex reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } 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 6d2c02371e5c..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapdatabaseinstances_client_example_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDatabaseInstances_Create.json -func ExampleSAPDatabaseInstancesClient_BeginCreate() { - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go index 0c9e43dbf3f9..739b9b6c416e 100644 --- a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client.go @@ -55,17 +55,16 @@ func NewSAPVirtualInstancesClient(subscriptionID string, credential azcore.Token return client, nil } -// BeginCreate - Creates an Virtual Instance for SAP. +// BeginCreate - Creates a Virtual Instance for SAP solutions (VIS) resource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// body - The Virtual Instance for SAP request body. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // options - SAPVirtualInstancesClientBeginCreateOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginCreate // method. -func (client *SAPVirtualInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, body SAPVirtualInstance, options *SAPVirtualInstancesClientBeginCreateOptions) (*runtime.Poller[SAPVirtualInstancesClientCreateResponse], error) { +func (client *SAPVirtualInstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginCreateOptions) (*runtime.Poller[SAPVirtualInstancesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, body, options) + resp, err := client.create(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { return nil, err } @@ -77,11 +76,11 @@ func (client *SAPVirtualInstancesClient) BeginCreate(ctx context.Context, resour } } -// Create - Creates an Virtual Instance for SAP. +// Create - Creates a Virtual Instance for SAP solutions (VIS) resource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview -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) +func (client *SAPVirtualInstancesClient) create(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { return nil, err } @@ -96,7 +95,7 @@ func (client *SAPVirtualInstancesClient) create(ctx context.Context, resourceGro } // createCreateRequest creates the Create request. -func (client *SAPVirtualInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, body SAPVirtualInstance, options *SAPVirtualInstancesClientBeginCreateOptions) (*policy.Request, error) { +func (client *SAPVirtualInstancesClient) createCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -118,14 +117,18 @@ func (client *SAPVirtualInstancesClient) createCreateRequest(ctx context.Context reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } -// BeginDelete - Deletes an Virtual Instance for SAP. +// BeginDelete - Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central +// Services Instance, Application Server Instances and Database Instance. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // options - SAPVirtualInstancesClientBeginDeleteOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginDelete // method. func (client *SAPVirtualInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginDeleteOptions) (*runtime.Poller[SAPVirtualInstancesClientDeleteResponse], error) { @@ -142,7 +145,8 @@ func (client *SAPVirtualInstancesClient) BeginDelete(ctx context.Context, resour } } -// Delete - Deletes an Virtual Instance for SAP. +// Delete - Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central +// Services Instance, Application Server Instances and Database Instance. // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview func (client *SAPVirtualInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginDeleteOptions) (*http.Response, error) { @@ -186,11 +190,11 @@ func (client *SAPVirtualInstancesClient) deleteCreateRequest(ctx context.Context return req, nil } -// Get - Gets an Virtual Instance for SAP. +// Get - Gets a Virtual Instance for SAP solutions resource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // options - SAPVirtualInstancesClientGetOptions contains the optional parameters for the SAPVirtualInstancesClient.Get method. func (client *SAPVirtualInstancesClient) Get(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientGetOptions) (SAPVirtualInstancesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) @@ -242,8 +246,7 @@ func (client *SAPVirtualInstancesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListByResourceGroupPager - Gets all Virtual Instances for SAP in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListByResourceGroupPager - Gets all Virtual Instances for SAP solutions resources in a Resource Group. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - SAPVirtualInstancesClientListByResourceGroupOptions contains the optional parameters for the SAPVirtualInstancesClient.ListByResourceGroup @@ -307,8 +310,7 @@ func (client *SAPVirtualInstancesClient) listByResourceGroupHandleResponse(resp return result, nil } -// NewListBySubscriptionPager - Gets all Virtual Instances for SAP in the subscription. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListBySubscriptionPager - Gets all Virtual Instances for SAP solutions resources in a Subscription. // Generated from API version 2021-12-01-preview // options - SAPVirtualInstancesClientListBySubscriptionOptions contains the optional parameters for the SAPVirtualInstancesClient.ListBySubscription // method. @@ -367,11 +369,11 @@ func (client *SAPVirtualInstancesClient) listBySubscriptionHandleResponse(resp * return result, nil } -// BeginStart - Starts the SAP System. +// 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 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // options - SAPVirtualInstancesClientBeginStartOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStart // method. func (client *SAPVirtualInstancesClient) BeginStart(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStartOptions) (*runtime.Poller[SAPVirtualInstancesClientStartResponse], error) { @@ -388,7 +390,7 @@ func (client *SAPVirtualInstancesClient) BeginStart(ctx context.Context, resourc } } -// Start - Starts the SAP System. +// 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 2021-12-01-preview func (client *SAPVirtualInstancesClient) start(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStartOptions) (*http.Response, error) { @@ -432,11 +434,11 @@ func (client *SAPVirtualInstancesClient) startCreateRequest(ctx context.Context, return req, nil } -// BeginStop - Stops the SAP System. +// 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 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // options - SAPVirtualInstancesClientBeginStopOptions contains the optional parameters for the SAPVirtualInstancesClient.BeginStop // method. func (client *SAPVirtualInstancesClient) BeginStop(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStopOptions) (*runtime.Poller[SAPVirtualInstancesClientStopResponse], error) { @@ -453,7 +455,7 @@ func (client *SAPVirtualInstancesClient) BeginStop(ctx context.Context, resource } } -// Stop - Stops the SAP System. +// 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 2021-12-01-preview func (client *SAPVirtualInstancesClient) stop(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientBeginStopOptions) (*http.Response, error) { @@ -500,16 +502,15 @@ func (client *SAPVirtualInstancesClient) stopCreateRequest(ctx context.Context, return req, nil } -// Update - Updates an Virtual Instance for SAP. +// Update - Updates a Virtual Instance for SAP solutions resource // If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. -// sapVirtualInstanceName - The name of the Virtual Instances for SAP. -// body - The Update Virtual Instance for SAP request body. +// sapVirtualInstanceName - The name of the Virtual Instances for SAP solutions resource // options - SAPVirtualInstancesClientUpdateOptions contains the optional parameters for the SAPVirtualInstancesClient.Update // method. -func (client *SAPVirtualInstancesClient) Update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, body UpdateSAPVirtualInstanceRequest, options *SAPVirtualInstancesClientUpdateOptions) (SAPVirtualInstancesClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, body, options) +func (client *SAPVirtualInstancesClient) Update(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientUpdateOptions) (SAPVirtualInstancesClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, sapVirtualInstanceName, options) if err != nil { return SAPVirtualInstancesClientUpdateResponse{}, err } @@ -524,7 +525,7 @@ func (client *SAPVirtualInstancesClient) Update(ctx context.Context, resourceGro } // updateCreateRequest creates the Update request. -func (client *SAPVirtualInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, body UpdateSAPVirtualInstanceRequest, options *SAPVirtualInstancesClientUpdateOptions) (*policy.Request, error) { +func (client *SAPVirtualInstancesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, sapVirtualInstanceName string, options *SAPVirtualInstancesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -546,7 +547,10 @@ func (client *SAPVirtualInstancesClient) updateCreateRequest(ctx context.Context reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if options != nil && options.Body != nil { + return req, runtime.MarshalAsJSON(req, *options.Body) + } + return req, nil } // updateHandleResponse handles the Update response. 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 d24c73aa4fe5..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/sapvirtualinstances_client_example_test.go +++ /dev/null @@ -1,321 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPVirtualInstances_Create_Distributed.json -func ExampleSAPVirtualInstancesClient_BeginCreate() { - 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/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), - 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/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), - 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/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), - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-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{ - HardStop: to.Ptr(false), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/workloads/armworkloads/skus_client.go b/sdk/resourcemanager/workloads/armworkloads/skus_client.go index 1ba17d81bf0b..edc44d0f72db 100644 --- a/sdk/resourcemanager/workloads/armworkloads/skus_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/skus_client.go @@ -56,7 +56,6 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt } // NewListPager - Lists all the available SKUs under this PR -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // options - SKUsClientListOptions contains the optional parameters for the SKUsClient.List method. func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] { diff --git a/sdk/resourcemanager/workloads/armworkloads/skus_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/skus_client_example_test.go deleted file mode 100644 index 8b49e1928f00..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/skus_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/Skus_List.json -func ExampleSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewSKUsClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client.go b/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client.go index 1f58ad86c78e..f1dd18976b08 100644 --- a/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client.go @@ -226,7 +226,6 @@ func (client *WordpressInstancesClient) getHandleResponse(resp *http.Response) ( } // NewListPager - Lists WordPress instance resources under a phpWorkload resource. -// If the operation fails it returns an *azcore.ResponseError type. // Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // phpWorkloadName - Php workload name diff --git a/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client_example_test.go deleted file mode 100644 index f199a5780ad7..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/wordpressinstances_client_example_test.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_List.json -func ExampleWordpressInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewWordpressInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("test-rg", - "wp39", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_Get.json -func ExampleWordpressInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewWordpressInstancesClient("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", - "wp39", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_CreateOrUpdate.json -func ExampleWordpressInstancesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewWordpressInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "test-rg", - "wp39", - armworkloads.WordpressInstanceResource{ - Properties: &armworkloads.WordpressInstanceResourceProperties{ - DatabaseName: to.Ptr("wpdb"), - DatabaseUser: to.Ptr("wpuser"), - Version: to.Ptr(armworkloads.WordpressVersionsFive42), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/phpworkloads/WordpressInstances_Delete.json -func ExampleWordpressInstancesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armworkloads.NewWordpressInstancesClient("8e17e36c-42e9-4cd5-a078-7b44883414e0", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "test-rg", - "wp39", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/workloads/armworkloads/workloadsclient_client_example_test.go b/sdk/resourcemanager/workloads/armworkloads/workloadsclient_client_example_test.go deleted file mode 100644 index bec1160442ec..000000000000 --- a/sdk/resourcemanager/workloads/armworkloads/workloadsclient_client_example_test.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package 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/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPSizingRecommendations_S4HANA_Distributed.json -func ExampleClient_SAPSizingRecommendations() { - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPDiskConfigurations_NonProd.json -func ExampleClient_SAPDiskConfigurations() { - 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/workloads/resource-manager/Microsoft.Workloads/preview/2021-12-01-preview/examples/sapvirtualinstances/SAPAvailabilityZoneDetails_eastus.json -func ExampleClient_SAPAvailabilityZoneDetails() { - 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) - } - // TODO: use response item - _ = res -}