From 1fefd701ab266bab44f6aa6f9df54e9d12e7a6b1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 18 Nov 2022 12:09:02 +0000 Subject: [PATCH] CodeGen from PR 21604 in Azure/azure-rest-api-specs Merge a12a6d334468ffa679270307c71f7f032ffe0b09 into be6cd9ccfcb6ba08c1c206627026eabfbff31fc1 --- .../workloads/armworkloads/CHANGELOG.md | 84 ++++ .../workloads/armworkloads/autorest.md | 6 +- .../workloads/armworkloads/client.go | 9 +- .../workloads/armworkloads/constants.go | 74 +++- .../workloads/armworkloads/go.mod | 14 +- .../workloads/armworkloads/go.sum | 24 +- .../workloads/armworkloads/models.go | 382 ++++++++++++---- .../workloads/armworkloads/models_serde.go | 413 ++++++++++++++++++ .../workloads/armworkloads/monitors_client.go | 6 +- .../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 | 24 + .../armworkloads/providerinstances_client.go | 5 +- .../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, 1063 insertions(+), 1934 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..d7d57d51c8a5 100644 --- a/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md +++ b/sdk/resourcemanager/workloads/armworkloads/CHANGELOG.md @@ -1,5 +1,89 @@ # Release History +## 0.3.0 (2022-11-18) +### Breaking Changes + +- Function `*SAPVirtualInstancesClient.Update` parameter(s) have been changed from `(context.Context, string, string, UpdateSAPVirtualInstanceRequest, *SAPVirtualInstancesClientUpdateOptions)` to `(context.Context, string, string, *SAPVirtualInstancesClientUpdateOptions)` +- Function `*SAPDatabaseInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, SAPDatabaseInstance, *SAPDatabaseInstancesClientBeginCreateOptions)` to `(context.Context, string, string, string, *SAPDatabaseInstancesClientBeginCreateOptions)` +- Function `*SAPVirtualInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, SAPVirtualInstance, *SAPVirtualInstancesClientBeginCreateOptions)` to `(context.Context, string, string, *SAPVirtualInstancesClientBeginCreateOptions)` +- Function `*SAPApplicationServerInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, SAPApplicationServerInstance, *SAPApplicationServerInstancesClientBeginCreateOptions)` to `(context.Context, string, string, string, *SAPApplicationServerInstancesClientBeginCreateOptions)` +- Function `*SAPCentralInstancesClient.BeginCreate` parameter(s) have been changed from `(context.Context, string, string, string, SAPCentralServerInstance, *SAPCentralInstancesClientBeginCreateOptions)` to `(context.Context, string, string, string, *SAPCentralInstancesClientBeginCreateOptions)` +- Function `*SAPCentralInstancesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, UpdateSAPCentralInstanceRequest, *SAPCentralInstancesClientBeginUpdateOptions)` to `(context.Context, string, string, string, *SAPCentralInstancesClientBeginUpdateOptions)` +- Function `*SAPApplicationServerInstancesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, UpdateSAPApplicationInstanceRequest, *SAPApplicationServerInstancesClientBeginUpdateOptions)` to `(context.Context, string, string, string, *SAPApplicationServerInstancesClientBeginUpdateOptions)` +- Function `*SAPDatabaseInstancesClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, string, string, UpdateSAPDatabaseInstanceRequest, *SAPDatabaseInstancesClientBeginUpdateOptions)` to `(context.Context, string, string, string, *SAPDatabaseInstancesClientBeginUpdateOptions)` + +### Features Added + +- New const `DiskSKUNamePremiumZRS` +- New const `SAPSoftwareInstallationTypeExternal` +- New const `DiskSKUNameUltraSSDLRS` +- New const `DiskSKUNameStandardSSDLRS` +- New const `SAPVirtualInstanceStateSoftwareDetectionFailed` +- New const `DiskSKUNamePremiumV2LRS` +- New const `ConfigurationTypeMount` +- New const `ConfigurationTypeSkip` +- New const `ConfigurationTypeCreateAndMount` +- New const `DiskSKUNamePremiumLRS` +- New const `SSLPreferenceDisabled` +- New const `SSLPreferenceServerCertificate` +- New const `SAPVirtualInstanceStateSoftwareDetectionInProgress` +- New const `SSLPreferenceRootCertificate` +- New const `DiskSKUNameStandardLRS` +- New const `DiskSKUNameStandardSSDZRS` +- New type alias `ConfigurationType` +- New type alias `DiskSKUName` +- New type alias `SSLPreference` +- New function `*SkipFileShareConfiguration.GetFileShareConfiguration() *FileShareConfiguration` +- New function `PossibleDiskSKUNameValues() []DiskSKUName` +- New function `*FileShareConfiguration.GetFileShareConfiguration() *FileShareConfiguration` +- New function `*CreateAndMountFileShareConfiguration.GetFileShareConfiguration() *FileShareConfiguration` +- New function `*ExternalInstallationSoftwareConfiguration.GetSoftwareConfiguration() *SoftwareConfiguration` +- New function `*MountFileShareConfiguration.GetFileShareConfiguration() *FileShareConfiguration` +- New function `PossibleSSLPreferenceValues() []SSLPreference` +- New function `PossibleConfigurationTypeValues() []ConfigurationType` +- New struct `CreateAndMountFileShareConfiguration` +- New struct `DiskConfiguration` +- New struct `DiskSKU` +- New struct `DiskVolumeConfiguration` +- New struct `ExternalInstallationSoftwareConfiguration` +- New struct `FileShareConfiguration` +- New struct `LoadBalancerDetails` +- New struct `MountFileShareConfiguration` +- New struct `SkipFileShareConfiguration` +- New struct `StorageConfiguration` +- New struct `StorageInformation` +- New field `StorageConfiguration` in struct `ThreeTierConfiguration` +- New field `SSLCertificateURI` in struct `PrometheusOSProviderInstanceProperties` +- New field `SSLPreference` in struct `PrometheusOSProviderInstanceProperties` +- New field `SSLCertificateURI` in struct `MsSQLServerProviderInstanceProperties` +- New field `SSLPreference` in struct `MsSQLServerProviderInstanceProperties` +- New field `Body` in struct `SAPDatabaseInstancesClientBeginUpdateOptions` +- New field `DiskConfiguration` in struct `DatabaseConfiguration` +- New field `SSLPreference` in struct `PrometheusHaClusterProviderInstanceProperties` +- New field `SSLCertificateURI` in struct `PrometheusHaClusterProviderInstanceProperties` +- New field `Body` in struct `SAPDatabaseInstancesClientBeginCreateOptions` +- New field `Body` in struct `SAPVirtualInstancesClientBeginCreateOptions` +- New field `StorageDetails` in struct `SAPApplicationServerProperties` +- New field `SSLPreference` in struct `HanaDbProviderInstanceProperties` +- New field `SSLCertificateURI` in struct `HanaDbProviderInstanceProperties` +- New field `LoadBalancerDetails` in struct `SAPDatabaseProperties` +- New field `DbDiskConfiguration` in struct `SingleServerConfiguration` +- New field `Body` in struct `SAPVirtualInstancesClientUpdateOptions` +- New field `SSLPreference` in struct `DB2ProviderInstanceProperties` +- New field `SSLCertificateURI` in struct `DB2ProviderInstanceProperties` +- New field `ZoneRedundancyPreference` in struct `MonitorProperties` +- New field `StorageAccountArmID` in struct `MonitorProperties` +- New field `Body` in struct `SAPCentralInstancesClientBeginUpdateOptions` +- New field `LoadBalancerDetails` in struct `SAPCentralServerProperties` +- New field `SSLPreference` in struct `SapNetWeaverProviderInstanceProperties` +- New field `SSLCertificateURI` in struct `SapNetWeaverProviderInstanceProperties` +- New field `Body` in struct `SAPApplicationServerInstancesClientBeginUpdateOptions` +- New field `Body` in struct `SAPCentralInstancesClientBeginCreateOptions` +- New field `StorageDetails` in struct `CentralServerVMDetails` +- New field `Body` in struct `SAPApplicationServerInstancesClientBeginCreateOptions` +- New field `StorageDetails` in struct `DatabaseVMDetails` + + ## 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..8bd2a93e2f01 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. @@ -96,6 +96,24 @@ func PossibleCentralServerVirtualMachineTypeValues() []CentralServerVirtualMachi } } +// ConfigurationType - The type of file share config. +type ConfigurationType string + +const ( + ConfigurationTypeCreateAndMount ConfigurationType = "CreateAndMount" + ConfigurationTypeMount ConfigurationType = "Mount" + ConfigurationTypeSkip ConfigurationType = "Skip" +) + +// PossibleConfigurationTypeValues returns the possible values for the ConfigurationType const type. +func PossibleConfigurationTypeValues() []ConfigurationType { + return []ConfigurationType{ + ConfigurationTypeCreateAndMount, + ConfigurationTypeMount, + ConfigurationTypeSkip, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -148,6 +166,32 @@ func PossibleDatabaseTypeValues() []DatabaseType { } } +// DiskSKUName - Defines the disk sku name. +type DiskSKUName string + +const ( + DiskSKUNamePremiumLRS DiskSKUName = "Premium_LRS" + DiskSKUNamePremiumV2LRS DiskSKUName = "PremiumV2_LRS" + DiskSKUNamePremiumZRS DiskSKUName = "Premium_ZRS" + DiskSKUNameStandardLRS DiskSKUName = "Standard_LRS" + DiskSKUNameStandardSSDLRS DiskSKUName = "StandardSSD_LRS" + DiskSKUNameStandardSSDZRS DiskSKUName = "StandardSSD_ZRS" + DiskSKUNameUltraSSDLRS DiskSKUName = "UltraSSD_LRS" +) + +// PossibleDiskSKUNameValues returns the possible values for the DiskSKUName const type. +func PossibleDiskSKUNameValues() []DiskSKUName { + return []DiskSKUName{ + DiskSKUNamePremiumLRS, + DiskSKUNamePremiumV2LRS, + DiskSKUNamePremiumZRS, + DiskSKUNameStandardLRS, + DiskSKUNameStandardSSDLRS, + DiskSKUNameStandardSSDZRS, + DiskSKUNameUltraSSDLRS, + } +} + // DiskStorageType - Storage type type DiskStorageType string @@ -552,7 +596,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 +628,7 @@ func PossibleSAPEnvironmentTypeValues() []SAPEnvironmentType { } } -// SAPHealthState - Defines the SAP Instance health. +// SAPHealthState - Defines the health of SAP Instances. type SAPHealthState string const ( @@ -643,6 +687,7 @@ func PossibleSAPProductTypeValues() []SAPProductType { type SAPSoftwareInstallationType string const ( + SAPSoftwareInstallationTypeExternal SAPSoftwareInstallationType = "External" SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig SAPSoftwareInstallationType = "SAPInstallWithoutOSConfig" SAPSoftwareInstallationTypeServiceInitiated SAPSoftwareInstallationType = "ServiceInitiated" ) @@ -650,6 +695,7 @@ const ( // PossibleSAPSoftwareInstallationTypeValues returns the possible values for the SAPSoftwareInstallationType const type. func PossibleSAPSoftwareInstallationTypeValues() []SAPSoftwareInstallationType { return []SAPSoftwareInstallationType{ + SAPSoftwareInstallationTypeExternal, SAPSoftwareInstallationTypeSAPInstallWithoutOSConfig, SAPSoftwareInstallationTypeServiceInitiated, } @@ -666,6 +712,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 +729,8 @@ func PossibleSAPVirtualInstanceStateValues() []SAPVirtualInstanceState { SAPVirtualInstanceStateInfrastructureDeploymentInProgress, SAPVirtualInstanceStateInfrastructureDeploymentPending, SAPVirtualInstanceStateRegistrationComplete, + SAPVirtualInstanceStateSoftwareDetectionFailed, + SAPVirtualInstanceStateSoftwareDetectionInProgress, SAPVirtualInstanceStateSoftwareInstallationFailed, SAPVirtualInstanceStateSoftwareInstallationInProgress, SAPVirtualInstanceStateSoftwareInstallationPending, @@ -786,6 +836,24 @@ func PossibleSKUTierValues() []SKUTier { } } +// SSLPreference - Gets or sets certificate preference if secure communication is enabled. +type SSLPreference string + +const ( + SSLPreferenceDisabled SSLPreference = "Disabled" + SSLPreferenceRootCertificate SSLPreference = "RootCertificate" + SSLPreferenceServerCertificate SSLPreference = "ServerCertificate" +) + +// PossibleSSLPreferenceValues returns the possible values for the SSLPreference const type. +func PossibleSSLPreferenceValues() []SSLPreference { + return []SSLPreference{ + SSLPreferenceDisabled, + SSLPreferenceRootCertificate, + SSLPreferenceServerCertificate, + } +} + // SapVirtualInstanceProvisioningState - Defines the provisioning states. type SapVirtualInstanceProvisioningState string 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..5140f47bf449 100644 --- a/sdk/resourcemanager/workloads/armworkloads/models.go +++ b/sdk/resourcemanager/workloads/armworkloads/models.go @@ -62,8 +62,12 @@ 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; Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared + // Storage. + StorageDetails []*StorageInformation `json:"storageDetails,omitempty" azure:"ro"` + // READ-ONLY; Defines the type of central server VM. Type *CentralServerVirtualMachineType `json:"type,omitempty" azure:"ro"` @@ -95,6 +99,25 @@ type ClientSAPSupportedSKUOptions struct { SAPSupportedSKU *SAPSupportedSKUsRequest } +// CreateAndMountFileShareConfiguration - Gets or sets the file share configuration for file share created with the VIS case. +type CreateAndMountFileShareConfiguration struct { + // REQUIRED; The type of file share config. + ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` + + // The name of file share resource group. The app rg is used in case of missing input. + ResourceGroup *string `json:"resourceGroup,omitempty"` + + // The name of file share storage account name . A custom name is used in case of missing input. + StorageAccountName *string `json:"storageAccountName,omitempty"` +} + +// GetFileShareConfiguration implements the FileShareConfigurationClassification interface for type CreateAndMountFileShareConfiguration. +func (c *CreateAndMountFileShareConfiguration) GetFileShareConfiguration() *FileShareConfiguration { + return &FileShareConfiguration{ + ConfigurationType: c.ConfigurationType, + } +} + // DB2ProviderInstanceProperties - Gets or sets the DB2 provider properties. type DB2ProviderInstanceProperties struct { // REQUIRED; The provider type. For example, the value can be SapHana. @@ -118,6 +141,12 @@ type DB2ProviderInstanceProperties struct { // Gets or sets the target virtual machine name. Hostname *string `json:"hostname,omitempty"` + // Gets or sets the blob URI to SSL certificate for the DB2 Database. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` + // Gets or sets the SAP System Identifier SapSid *string `json:"sapSid,omitempty"` } @@ -142,6 +171,9 @@ type DatabaseConfiguration struct { // The database type. DatabaseType *SAPDatabaseType `json:"databaseType,omitempty"` + + // Gets or sets the disk configuration. + DiskConfiguration *DiskConfiguration `json:"diskConfiguration,omitempty"` } // DatabaseProfile - Workload database profile @@ -183,11 +215,15 @@ 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"` + // READ-ONLY; Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared + // Storage. + StorageDetails []*StorageInformation `json:"storageDetails,omitempty" azure:"ro"` + // READ-ONLY VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` } @@ -267,6 +303,13 @@ func (d *DiscoveryConfiguration) GetSAPConfiguration() *SAPConfiguration { } } +// DiskConfiguration - The Disk Configuration Details. +type DiskConfiguration struct { + // The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', + // 'os'], Optional volume : ['backup']. + DiskVolumeConfigurations map[string]*DiskVolumeConfiguration `json:"diskVolumeConfigurations,omitempty"` +} + // DiskInfo - Disk resource creation details type DiskInfo struct { // REQUIRED; Storage type @@ -276,42 +319,60 @@ type DiskInfo struct { SizeInGB *int64 `json:"sizeInGB,omitempty"` } -// EnqueueReplicationServerProperties - Defines the SAP ERS Server properties. +// DiskSKU - The disk sku. +type DiskSKU struct { + // Defines the disk sku name. + Name *DiskSKUName `json:"name,omitempty"` +} + +// DiskVolumeConfiguration - The disk configuration required for the selected volume. +type DiskVolumeConfiguration struct { + // The total number of disks required for the concerned volume. + Count *int64 `json:"count,omitempty"` + + // The disk SKU details. + SKU *DiskSKU `json:"sku,omitempty"` + + // The disk size in GB. + SizeGB *int64 `json:"sizeGB,omitempty"` +} + +// 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 +446,42 @@ 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, + } +} + +// FileShareConfigurationClassification provides polymorphic access to related types. +// Call the interface's GetFileShareConfiguration() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *CreateAndMountFileShareConfiguration, *FileShareConfiguration, *MountFileShareConfiguration, *SkipFileShareConfiguration +type FileShareConfigurationClassification interface { + // GetFileShareConfiguration returns the FileShareConfiguration content of the underlying type. + GetFileShareConfiguration() *FileShareConfiguration +} + +// FileShareConfiguration - File Share configuration details, populated with information on storage configuration mounted +// on the VIS. The createAndMount option is selected in case of missing input. +type FileShareConfiguration struct { + // REQUIRED; The type of file share config. + ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` +} + +// GetFileShareConfiguration implements the FileShareConfigurationClassification interface for type FileShareConfiguration. +func (f *FileShareConfiguration) GetFileShareConfiguration() *FileShareConfiguration { return f } + // FileshareProfile - File share profile type FileshareProfile struct { // REQUIRED; Share type @@ -405,10 +502,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"` } @@ -441,8 +538,14 @@ type HanaDbProviderInstanceProperties struct { // Gets or sets the database sql port. SQLPort *string `json:"sqlPort,omitempty"` + // Gets or sets the blob URI to SSL certificate for the DB. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + // Gets or sets the hostname(s) in the SSL certificate. SSLHostNameInCertificate *string `json:"sslHostNameInCertificate,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` } // GetProviderSpecificProperties implements the ProviderSpecificPropertiesClassification interface for type HanaDbProviderInstanceProperties. @@ -512,7 +615,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"` } @@ -544,33 +647,39 @@ func (l *LinuxConfiguration) GetOSConfiguration() *OSConfiguration { } } +// LoadBalancerDetails - The Load Balancer details such as Load Balancer ID. +type LoadBalancerDetails struct { + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` +} + // ManagedRGConfiguration - Managed resource group configuration type ManagedRGConfiguration struct { // Managed resource group name 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 +737,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"` @@ -636,6 +749,9 @@ type MonitorProperties struct { // READ-ONLY; State of provisioning of the SAP monitor. ProvisioningState *WorkloadMonitorProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The ARM ID of the Storage account used for SAP monitoring. + StorageAccountArmID *string `json:"storageAccountArmId,omitempty" azure:"ro"` } // MonitorPropertiesErrors - Defines the SAP monitor errors. @@ -688,6 +804,25 @@ type MonitorsClientUpdateOptions struct { // placeholder for future optional parameters } +// MountFileShareConfiguration - Gets or sets the file share configuration for externally mounted cases. +type MountFileShareConfiguration struct { + // REQUIRED; The type of file share config. + ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` + + // REQUIRED; The fileshare resource ID + ID *string `json:"id,omitempty"` + + // REQUIRED; The private endpoint resource ID + PrivateEndpointID *string `json:"privateEndpointId,omitempty"` +} + +// GetFileShareConfiguration implements the FileShareConfigurationClassification interface for type MountFileShareConfiguration. +func (m *MountFileShareConfiguration) GetFileShareConfiguration() *FileShareConfiguration { + return &FileShareConfiguration{ + ConfigurationType: m.ConfigurationType, + } +} + // MsSQLServerProviderInstanceProperties - Gets or sets the SQL server provider properties. type MsSQLServerProviderInstanceProperties struct { // REQUIRED; The provider type. For example, the value can be SapHana. @@ -708,6 +843,12 @@ type MsSQLServerProviderInstanceProperties struct { // Gets or sets the SQL server host name. Hostname *string `json:"hostname,omitempty"` + // Gets or sets the blob URI to SSL certificate for the SQL Database. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` + // Gets or sets the SAP System Identifier SapSid *string `json:"sapSid,omitempty"` } @@ -719,9 +860,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"` } @@ -1184,6 +1325,12 @@ type PrometheusHaClusterProviderInstanceProperties struct { // URL of the Node Exporter endpoint. PrometheusURL *string `json:"prometheusUrl,omitempty"` + // Gets or sets the blob URI to SSL certificate for the HA cluster exporter. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` + // Gets or sets the cluster sid. Sid *string `json:"sid,omitempty"` } @@ -1202,6 +1349,12 @@ type PrometheusOSProviderInstanceProperties struct { // URL of the Node Exporter endpoint PrometheusURL *string `json:"prometheusUrl,omitempty"` + + // Gets or sets the blob URI to SSL certificate for the prometheus node exporter. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` } // GetProviderSpecificProperties implements the ProviderSpecificPropertiesClassification interface for type PrometheusOSProviderInstanceProperties. @@ -1356,12 +1509,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 +1533,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 +1561,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 +1579,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 +1617,11 @@ 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; Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared + // Storage. + StorageDetails []*StorageInformation `json:"storageDetails,omitempty" azure:"ro"` + + // READ-ONLY; Application server Subnet. Subnet *string `json:"subnet,omitempty" azure:"ro"` // READ-ONLY; The virtual machine. @@ -1494,18 +1655,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 +1683,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 +1699,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,45 +1723,48 @@ 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; The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines + LoadBalancerDetails *LoadBalancerDetails `json:"loadBalancerDetails,omitempty" azure:"ro"` + // READ-ONLY; Defines the provisioning states. ProvisioningState *SapVirtualInstanceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // 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 +1786,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 +1822,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 +1838,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,30 +1854,33 @@ 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; The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines + LoadBalancerDetails *LoadBalancerDetails `json:"loadBalancerDetails,omitempty" azure:"ro"` + // READ-ONLY; Defines the provisioning states. ProvisioningState *SapVirtualInstanceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` // 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 +2002,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 +2050,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 +2083,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 +2107,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 +2126,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 +2149,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 +2174,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 @@ -2182,6 +2361,12 @@ type SapNetWeaverProviderInstanceProperties struct { // REQUIRED; The provider type. For example, the value can be SapHana. ProviderType *string `json:"providerType,omitempty"` + // Gets or sets the blob URI to SSL certificate for the SAP system. + SSLCertificateURI *string `json:"sslCertificateUri,omitempty"` + + // Gets or sets certificate preference if secure communication is enabled. + SSLPreference *SSLPreference `json:"sslPreference,omitempty"` + // Gets or sets the SAP Client ID. SapClientID *string `json:"sapClientId,omitempty"` @@ -2280,7 +2465,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. @@ -2292,6 +2477,9 @@ type SingleServerConfiguration struct { // The database type. DatabaseType *SAPDatabaseType `json:"databaseType,omitempty"` + // Gets or sets the disk configuration. + DbDiskConfiguration *DiskConfiguration `json:"dbDiskConfiguration,omitempty"` + // Network configuration for the server NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` } @@ -2306,7 +2494,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. @@ -2326,10 +2514,24 @@ type SiteProfile struct { DomainName *string `json:"domainName,omitempty"` } +// SkipFileShareConfiguration - Gets or sets the skip file share configuration +type SkipFileShareConfiguration struct { + // REQUIRED; The type of file share config. + ConfigurationType *ConfigurationType `json:"configurationType,omitempty"` +} + +// GetFileShareConfiguration implements the FileShareConfigurationClassification interface for type SkipFileShareConfiguration. +func (s *SkipFileShareConfiguration) GetFileShareConfiguration() *FileShareConfiguration { + return &FileShareConfiguration{ + ConfigurationType: s.ConfigurationType, + } +} + // 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 @@ -2350,6 +2552,19 @@ type StopRequest struct { HardStop *bool `json:"hardStop,omitempty"` } +// StorageConfiguration - Gets or sets the storage configuration. +type StorageConfiguration struct { + // The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration is the createAndMount + // flow if storage configuration is missing. + TransportFileShareConfiguration FileShareConfigurationClassification `json:"transportFileShareConfiguration,omitempty"` +} + +// StorageInformation - Storage details of all the Storage accounts attached to the VM. For e.g. NFS on AFS Shared Storage. +type StorageInformation struct { + // READ-ONLY + ID *string `json:"id,omitempty" azure:"ro"` +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -2391,7 +2606,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. @@ -2399,6 +2614,9 @@ type ThreeTierConfiguration struct { // Network configuration common to all servers NetworkConfiguration *NetworkConfiguration `json:"networkConfiguration,omitempty"` + + // The storage configuration. + StorageConfiguration *StorageConfiguration `json:"storageConfiguration,omitempty"` } // GetInfrastructureConfiguration implements the InfrastructureConfigurationClassification interface for type ThreeTierConfiguration. @@ -2411,7 +2629,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..08cad4425c51 100644 --- a/sdk/resourcemanager/workloads/armworkloads/models_serde.go +++ b/sdk/resourcemanager/workloads/armworkloads/models_serde.go @@ -163,6 +163,7 @@ func (c *CentralServerConfiguration) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CentralServerVMDetails. func (c CentralServerVMDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "storageDetails", c.StorageDetails) populate(objectMap, "type", c.Type) populate(objectMap, "virtualMachineId", c.VirtualMachineID) return json.Marshal(objectMap) @@ -177,6 +178,9 @@ func (c *CentralServerVMDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "storageDetails": + err = unpopulate(val, "StorageDetails", &c.StorageDetails) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) @@ -191,6 +195,41 @@ func (c *CentralServerVMDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CreateAndMountFileShareConfiguration. +func (c CreateAndMountFileShareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["configurationType"] = ConfigurationTypeCreateAndMount + populate(objectMap, "resourceGroup", c.ResourceGroup) + populate(objectMap, "storageAccountName", c.StorageAccountName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CreateAndMountFileShareConfiguration. +func (c *CreateAndMountFileShareConfiguration) 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", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configurationType": + err = unpopulate(val, "ConfigurationType", &c.ConfigurationType) + delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &c.ResourceGroup) + delete(rawMsg, key) + case "storageAccountName": + err = unpopulate(val, "StorageAccountName", &c.StorageAccountName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DB2ProviderInstanceProperties. func (d DB2ProviderInstanceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -201,6 +240,8 @@ func (d DB2ProviderInstanceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "dbUsername", d.DbUsername) populate(objectMap, "hostname", d.Hostname) objectMap["providerType"] = "Db2" + populate(objectMap, "sslCertificateUri", d.SSLCertificateURI) + populate(objectMap, "sslPreference", d.SSLPreference) populate(objectMap, "sapSid", d.SapSid) return json.Marshal(objectMap) } @@ -235,6 +276,12 @@ func (d *DB2ProviderInstanceProperties) UnmarshalJSON(data []byte) error { case "providerType": err = unpopulate(val, "ProviderType", &d.ProviderType) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &d.SSLCertificateURI) + delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &d.SSLPreference) + delete(rawMsg, key) case "sapSid": err = unpopulate(val, "SapSid", &d.SapSid) delete(rawMsg, key) @@ -250,6 +297,7 @@ func (d *DB2ProviderInstanceProperties) UnmarshalJSON(data []byte) error { func (d DatabaseConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "databaseType", d.DatabaseType) + populate(objectMap, "diskConfiguration", d.DiskConfiguration) populate(objectMap, "instanceCount", d.InstanceCount) populate(objectMap, "subnetId", d.SubnetID) populate(objectMap, "virtualMachineConfiguration", d.VirtualMachineConfiguration) @@ -268,6 +316,9 @@ func (d *DatabaseConfiguration) UnmarshalJSON(data []byte) error { case "databaseType": err = unpopulate(val, "DatabaseType", &d.DatabaseType) delete(rawMsg, key) + case "diskConfiguration": + err = unpopulate(val, "DiskConfiguration", &d.DiskConfiguration) + delete(rawMsg, key) case "instanceCount": err = unpopulate(val, "InstanceCount", &d.InstanceCount) delete(rawMsg, key) @@ -360,6 +411,7 @@ func (d *DatabaseProfile) UnmarshalJSON(data []byte) error { func (d DatabaseVMDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "status", d.Status) + populate(objectMap, "storageDetails", d.StorageDetails) populate(objectMap, "virtualMachineId", d.VirtualMachineID) return json.Marshal(objectMap) } @@ -376,6 +428,9 @@ func (d *DatabaseVMDetails) UnmarshalJSON(data []byte) error { case "status": err = unpopulate(val, "Status", &d.Status) delete(rawMsg, key) + case "storageDetails": + err = unpopulate(val, "StorageDetails", &d.StorageDetails) + delete(rawMsg, key) case "virtualMachineId": err = unpopulate(val, "VirtualMachineID", &d.VirtualMachineID) delete(rawMsg, key) @@ -535,6 +590,33 @@ func (d *DiscoveryConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DiskConfiguration. +func (d DiskConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "diskVolumeConfigurations", d.DiskVolumeConfigurations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskConfiguration. +func (d *DiskConfiguration) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "diskVolumeConfigurations": + err = unpopulate(val, "DiskVolumeConfigurations", &d.DiskVolumeConfigurations) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DiskInfo. func (d DiskInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -566,6 +648,68 @@ func (d *DiskInfo) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DiskSKU. +func (d DiskSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", d.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskSKU. +func (d *DiskSKU) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DiskVolumeConfiguration. +func (d DiskVolumeConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "count", d.Count) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "sizeGB", d.SizeGB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskVolumeConfiguration. +func (d *DiskVolumeConfiguration) 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", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &d.Count) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "sizeGB": + err = unpopulate(val, "SizeGB", &d.SizeGB) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type EnqueueReplicationServerProperties. func (e EnqueueReplicationServerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -862,6 +1006,64 @@ 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 FileShareConfiguration. +func (f FileShareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["configurationType"] = f.ConfigurationType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareConfiguration. +func (f *FileShareConfiguration) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configurationType": + err = unpopulate(val, "ConfigurationType", &f.ConfigurationType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FileshareProfile. func (f FileshareProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -948,7 +1150,9 @@ func (h HanaDbProviderInstanceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "instanceNumber", h.InstanceNumber) objectMap["providerType"] = "SapHana" populate(objectMap, "sqlPort", h.SQLPort) + populate(objectMap, "sslCertificateUri", h.SSLCertificateURI) populate(objectMap, "sslHostNameInCertificate", h.SSLHostNameInCertificate) + populate(objectMap, "sslPreference", h.SSLPreference) return json.Marshal(objectMap) } @@ -988,9 +1192,15 @@ func (h *HanaDbProviderInstanceProperties) UnmarshalJSON(data []byte) error { case "sqlPort": err = unpopulate(val, "SQLPort", &h.SQLPort) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &h.SSLCertificateURI) + delete(rawMsg, key) case "sslHostNameInCertificate": err = unpopulate(val, "SSLHostNameInCertificate", &h.SSLHostNameInCertificate) delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &h.SSLPreference) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) @@ -1174,6 +1384,33 @@ func (l *LinuxConfiguration) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type LoadBalancerDetails. +func (l LoadBalancerDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoadBalancerDetails. +func (l *LoadBalancerDetails) 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", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ManagedRGConfiguration. func (m ManagedRGConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1349,6 +1586,8 @@ func (m MonitorProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "msiArmId", m.MsiArmID) populate(objectMap, "provisioningState", m.ProvisioningState) populate(objectMap, "routingPreference", m.RoutingPreference) + populate(objectMap, "storageAccountArmId", m.StorageAccountArmID) + populate(objectMap, "zoneRedundancyPreference", m.ZoneRedundancyPreference) return json.Marshal(objectMap) } @@ -1385,6 +1624,12 @@ func (m *MonitorProperties) UnmarshalJSON(data []byte) error { case "routingPreference": err = unpopulate(val, "RoutingPreference", &m.RoutingPreference) delete(rawMsg, key) + case "storageAccountArmId": + err = unpopulate(val, "StorageAccountArmID", &m.StorageAccountArmID) + 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) @@ -1436,6 +1681,41 @@ func (m *MonitorPropertiesErrors) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MountFileShareConfiguration. +func (m MountFileShareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["configurationType"] = ConfigurationTypeMount + populate(objectMap, "id", m.ID) + populate(objectMap, "privateEndpointId", m.PrivateEndpointID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MountFileShareConfiguration. +func (m *MountFileShareConfiguration) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configurationType": + err = unpopulate(val, "ConfigurationType", &m.ConfigurationType) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "privateEndpointId": + err = unpopulate(val, "PrivateEndpointID", &m.PrivateEndpointID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MsSQLServerProviderInstanceProperties. func (m MsSQLServerProviderInstanceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1445,6 +1725,8 @@ func (m MsSQLServerProviderInstanceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "dbUsername", m.DbUsername) populate(objectMap, "hostname", m.Hostname) objectMap["providerType"] = "MsSqlServer" + populate(objectMap, "sslCertificateUri", m.SSLCertificateURI) + populate(objectMap, "sslPreference", m.SSLPreference) populate(objectMap, "sapSid", m.SapSid) return json.Marshal(objectMap) } @@ -1476,6 +1758,12 @@ func (m *MsSQLServerProviderInstanceProperties) UnmarshalJSON(data []byte) error case "providerType": err = unpopulate(val, "ProviderType", &m.ProviderType) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &m.SSLCertificateURI) + delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &m.SSLPreference) + delete(rawMsg, key) case "sapSid": err = unpopulate(val, "SapSid", &m.SapSid) delete(rawMsg, key) @@ -2423,6 +2711,8 @@ func (p PrometheusHaClusterProviderInstanceProperties) MarshalJSON() ([]byte, er populate(objectMap, "hostname", p.Hostname) populate(objectMap, "prometheusUrl", p.PrometheusURL) objectMap["providerType"] = "PrometheusHaCluster" + populate(objectMap, "sslCertificateUri", p.SSLCertificateURI) + populate(objectMap, "sslPreference", p.SSLPreference) populate(objectMap, "sid", p.Sid) return json.Marshal(objectMap) } @@ -2448,6 +2738,12 @@ func (p *PrometheusHaClusterProviderInstanceProperties) UnmarshalJSON(data []byt case "providerType": err = unpopulate(val, "ProviderType", &p.ProviderType) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &p.SSLCertificateURI) + delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &p.SSLPreference) + delete(rawMsg, key) case "sid": err = unpopulate(val, "Sid", &p.Sid) delete(rawMsg, key) @@ -2464,6 +2760,8 @@ func (p PrometheusOSProviderInstanceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "prometheusUrl", p.PrometheusURL) objectMap["providerType"] = "PrometheusOS" + populate(objectMap, "sslCertificateUri", p.SSLCertificateURI) + populate(objectMap, "sslPreference", p.SSLPreference) return json.Marshal(objectMap) } @@ -2482,6 +2780,12 @@ func (p *PrometheusOSProviderInstanceProperties) UnmarshalJSON(data []byte) erro case "providerType": err = unpopulate(val, "ProviderType", &p.ProviderType) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &p.SSLCertificateURI) + delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &p.SSLPreference) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", p, err) @@ -2879,6 +3183,7 @@ func (s SAPApplicationServerProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "kernelVersion", s.KernelVersion) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "status", s.Status) + populate(objectMap, "storageDetails", s.StorageDetails) populate(objectMap, "subnet", s.Subnet) populate(objectMap, "virtualMachineId", s.VirtualMachineID) return json.Marshal(objectMap) @@ -2929,6 +3234,9 @@ func (s *SAPApplicationServerProperties) UnmarshalJSON(data []byte) error { case "status": err = unpopulate(val, "Status", &s.Status) delete(rawMsg, key) + case "storageDetails": + err = unpopulate(val, "StorageDetails", &s.StorageDetails) + delete(rawMsg, key) case "subnet": err = unpopulate(val, "Subnet", &s.Subnet) delete(rawMsg, key) @@ -3129,6 +3437,7 @@ func (s SAPCentralServerProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "instanceNo", s.InstanceNo) populate(objectMap, "kernelPatch", s.KernelPatch) populate(objectMap, "kernelVersion", s.KernelVersion) + populate(objectMap, "loadBalancerDetails", s.LoadBalancerDetails) populate(objectMap, "messageServerProperties", s.MessageServerProperties) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "status", s.Status) @@ -3170,6 +3479,9 @@ func (s *SAPCentralServerProperties) UnmarshalJSON(data []byte) error { case "kernelVersion": err = unpopulate(val, "KernelVersion", &s.KernelVersion) delete(rawMsg, key) + case "loadBalancerDetails": + err = unpopulate(val, "LoadBalancerDetails", &s.LoadBalancerDetails) + delete(rawMsg, key) case "messageServerProperties": err = unpopulate(val, "MessageServerProperties", &s.MessageServerProperties) delete(rawMsg, key) @@ -3309,6 +3621,7 @@ func (s SAPDatabaseProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "databaseType", s.DatabaseType) populate(objectMap, "errors", s.Errors) populate(objectMap, "ipAddress", s.IPAddress) + populate(objectMap, "loadBalancerDetails", s.LoadBalancerDetails) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "status", s.Status) populate(objectMap, "subnet", s.Subnet) @@ -3337,6 +3650,9 @@ func (s *SAPDatabaseProperties) UnmarshalJSON(data []byte) error { case "ipAddress": err = unpopulate(val, "IPAddress", &s.IPAddress) delete(rawMsg, key) + case "loadBalancerDetails": + err = unpopulate(val, "LoadBalancerDetails", &s.LoadBalancerDetails) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) @@ -4344,6 +4660,8 @@ func (s *SSHPublicKey) UnmarshalJSON(data []byte) error { func (s SapNetWeaverProviderInstanceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) objectMap["providerType"] = "SapNetWeaver" + populate(objectMap, "sslCertificateUri", s.SSLCertificateURI) + populate(objectMap, "sslPreference", s.SSLPreference) populate(objectMap, "sapClientId", s.SapClientID) populate(objectMap, "sapHostFileEntries", s.SapHostFileEntries) populate(objectMap, "sapHostname", s.SapHostname) @@ -4369,6 +4687,12 @@ func (s *SapNetWeaverProviderInstanceProperties) UnmarshalJSON(data []byte) erro case "providerType": err = unpopulate(val, "ProviderType", &s.ProviderType) delete(rawMsg, key) + case "sslCertificateUri": + err = unpopulate(val, "SSLCertificateURI", &s.SSLCertificateURI) + delete(rawMsg, key) + case "sslPreference": + err = unpopulate(val, "SSLPreference", &s.SSLPreference) + delete(rawMsg, key) case "sapClientId": err = unpopulate(val, "SapClientID", &s.SapClientID) delete(rawMsg, key) @@ -4514,6 +4838,7 @@ func (s SingleServerConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "appResourceGroup", s.AppResourceGroup) populate(objectMap, "databaseType", s.DatabaseType) + populate(objectMap, "dbDiskConfiguration", s.DbDiskConfiguration) objectMap["deploymentType"] = SAPDeploymentTypeSingleServer populate(objectMap, "networkConfiguration", s.NetworkConfiguration) populate(objectMap, "subnetId", s.SubnetID) @@ -4536,6 +4861,9 @@ func (s *SingleServerConfiguration) UnmarshalJSON(data []byte) error { case "databaseType": err = unpopulate(val, "DatabaseType", &s.DatabaseType) delete(rawMsg, key) + case "dbDiskConfiguration": + err = unpopulate(val, "DbDiskConfiguration", &s.DbDiskConfiguration) + delete(rawMsg, key) case "deploymentType": err = unpopulate(val, "DeploymentType", &s.DeploymentType) delete(rawMsg, key) @@ -4614,6 +4942,33 @@ func (s *SiteProfile) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SkipFileShareConfiguration. +func (s SkipFileShareConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["configurationType"] = ConfigurationTypeSkip + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SkipFileShareConfiguration. +func (s *SkipFileShareConfiguration) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configurationType": + err = unpopulate(val, "ConfigurationType", &s.ConfigurationType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SoftwareConfiguration. func (s SoftwareConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -4668,6 +5023,60 @@ func (s *StopRequest) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type StorageConfiguration. +func (s StorageConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "transportFileShareConfiguration", s.TransportFileShareConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageConfiguration. +func (s *StorageConfiguration) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "transportFileShareConfiguration": + s.TransportFileShareConfiguration, err = unmarshalFileShareConfigurationClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StorageInformation. +func (s StorageInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageInformation. +func (s *StorageInformation) 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", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -4752,6 +5161,7 @@ func (t ThreeTierConfiguration) MarshalJSON() ([]byte, error) { objectMap["deploymentType"] = SAPDeploymentTypeThreeTier populate(objectMap, "highAvailabilityConfig", t.HighAvailabilityConfig) populate(objectMap, "networkConfiguration", t.NetworkConfiguration) + populate(objectMap, "storageConfiguration", t.StorageConfiguration) return json.Marshal(objectMap) } @@ -4785,6 +5195,9 @@ func (t *ThreeTierConfiguration) UnmarshalJSON(data []byte) error { case "networkConfiguration": err = unpopulate(val, "NetworkConfiguration", &t.NetworkConfiguration) delete(rawMsg, key) + case "storageConfiguration": + err = unpopulate(val, "StorageConfiguration", &t.StorageConfiguration) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", t, err) diff --git a/sdk/resourcemanager/workloads/armworkloads/monitors_client.go b/sdk/resourcemanager/workloads/armworkloads/monitors_client.go index c60d2be7eea7..b119ce56953a 100644 --- a/sdk/resourcemanager/workloads/armworkloads/monitors_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/monitors_client.go @@ -132,7 +132,9 @@ func (client *MonitorsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller[MonitorsClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MonitorsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[MonitorsClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -240,7 +242,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 +300,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..c7e94876aa48 100644 --- a/sdk/resourcemanager/workloads/armworkloads/polymorphic_helpers.go +++ b/sdk/resourcemanager/workloads/armworkloads/polymorphic_helpers.go @@ -11,6 +11,28 @@ package armworkloads import "encoding/json" +func unmarshalFileShareConfigurationClassification(rawMsg json.RawMessage) (FileShareConfigurationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b FileShareConfigurationClassification + switch m["configurationType"] { + case string(ConfigurationTypeCreateAndMount): + b = &CreateAndMountFileShareConfiguration{} + case string(ConfigurationTypeMount): + b = &MountFileShareConfiguration{} + case string(ConfigurationTypeSkip): + b = &SkipFileShareConfiguration{} + default: + b = &FileShareConfiguration{} + } + return b, json.Unmarshal(rawMsg, b) +} + func unmarshalInfrastructureConfigurationClassification(rawMsg json.RawMessage) (InfrastructureConfigurationClassification, error) { if rawMsg == nil { return nil, nil @@ -131,6 +153,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..1fb070d0b11e 100644 --- a/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go +++ b/sdk/resourcemanager/workloads/armworkloads/providerinstances_client.go @@ -142,7 +142,9 @@ func (client *ProviderInstancesClient) BeginDelete(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller[ProviderInstancesClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ProviderInstancesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[ProviderInstancesClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -260,7 +262,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 -}